Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-03-2010, 06:12 PM   #1
alias_neo
Junior Member
alias_neo began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
Order of Chapters in HTML->ePub

I am trying to convert a HTML book to ePUB, it works perfectly except the chapters are all out of order.

The HTML files are named chapter_1.html, chapter_2.html etc.

Is there any way I can cause it to recognise them in order, I don't mind some manual editing.

I already tried renaming the titles within the headers to 1->01, 2->02 etc to see if that helped, but the order just seems very random.

If anyone can suggest a solution I'd be grateful.

Thanks
alias_neo is offline   Reply With Quote
Old 09-03-2010, 08:17 PM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by alias_neo View Post
I am trying to convert a HTML book to ePUB, it works perfectly except the chapters are all out of order.

The HTML files are named chapter_1.html, chapter_2.html etc.

Is there any way I can cause it to recognise them in order, I don't mind some manual editing.

I already tried renaming the titles within the headers to 1->01, 2->02 etc to see if that helped, but the order just seems very random.

If anyone can suggest a solution I'd be grateful.

Thanks
If the book has a table of contents or a main index page that links to the other chapters then all you have to do is grab the main page and drag just that page to calibre and during adding the book calibre will grab the rest of the files that are linked from that file.

During conversion this main page or TOC will be used to keep the chapters in order.
DoctorOhh is offline   Reply With Quote
Advert
Old 09-03-2010, 08:50 PM   #3
alias_neo
Junior Member
alias_neo began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
Thanks

Quote:
Originally Posted by dwanthny View Post
If the book has a table of contents or a main index page that links to the other chapters then all you have to do is grab the main page and drag just that page to calibre and during adding the book calibre will grab the rest of the files that are linked from that file.

During conversion this main page or TOC will be used to keep the chapters in order.
I tried this, as per the instructions. My main page contains a TOC of chapters split into subsections, it uses the built in TOC but if go to the options and open TOC the page order is completely messed up and chapters are out of order.

The files are ordered correctly in the directory name "_chapter 01.htm" ... "_chapter 21.htm"

doesn't seem to work.

Any Further suggestions?
alias_neo is offline   Reply With Quote
Old 09-03-2010, 09:00 PM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by alias_neo View Post
I tried this, as per the instructions. My main page contains a TOC of chapters split into subsections, it uses the built in TOC but if go to the options and open TOC the page order is completely messed up and chapters are out of order.
Is the epub in order? If you go to what options for the TOC?

Quote:
Originally Posted by alias_neo View Post
The files are ordered correctly in the directory name "_chapter 01.htm" ... "_chapter 21.htm"
I need some clarification, are the chapters in order in the book? Ignoring the TOC if you read the book straight through are the chapters physically in order?
DoctorOhh is offline   Reply With Quote
Old 09-03-2010, 09:02 PM   #5
alias_neo
Junior Member
alias_neo began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
Quote:
Originally Posted by dwanthny View Post
Is the epub in order? If you go to what options for the TOC?



I need some clarification, are the chapters in order in the book? Ignoring the TOC if you read the book straight through are the chapters physically in order?
After Conversion .... no.

If I read through Chapter one, it jumps to Chapter 29.
alias_neo is offline   Reply With Quote
Advert
Old 09-03-2010, 09:04 PM   #6
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by alias_neo View Post
After Conversion .... no.

If I read through Chapter one, it jumps to Chapter 29.
I have no clue.

Does the html works fine in your browser?
DoctorOhh is offline   Reply With Quote
Old 09-03-2010, 09:11 PM   #7
alias_neo
Junior Member
alias_neo began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
Quote:
Originally Posted by dwanthny View Post
I have no clue.

Does the html works fine in your browser?
Yes, it works ok in the browser, in HTML format, but then that's via links because since it's seperate files it doesn't change chapters until I click the next one.

I'm assuming the problem much be in the chapter search algorithm/expression.

I am corrently playing with modifying the filenames and links but it takes a while as it's a 2000 page book and takes forever (2-3 minutes) to convert even on a high end PC.
alias_neo is offline   Reply With Quote
Old 09-03-2010, 10:32 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre follows links in depth first order if I remember correctly. If your files contain interlinks that can mess up the ordering. I would suggest using an EPUB editor to fix the ordering post conversion, or use the command line ebook-convert tool with the --breadth-first option to convert the html.
kovidgoyal is offline   Reply With Quote
Old 09-03-2010, 10:35 PM   #9
alias_neo
Junior Member
alias_neo began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
Thanks

Quote:
Originally Posted by kovidgoyal View Post
calibre follows links in depth first order if I remember correctly. If your files contain interlinks that can mess up the ordering. I would suggest using an EPUB editor to fix the ordering post conversion, or use the command line ebook-convert tool with the --breadth-first option to convert the html.
It's a reference manual of sorts so there are a lot of interlinks.

I think I found a solution however.

I extracted the epub with 7zip and found the toc.ncx which is a plain text XML file, in here the chapters appear in the same incorrect order they do when viewing, as long as I can modify this and zip it back up I should be good to go.

Last edited by alias_neo; 09-03-2010 at 10:36 PM. Reason: typo
alias_neo is offline   Reply With Quote
Old 05-16-2011, 11:55 AM   #10
thomass
Wizard
thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.thomass ought to be getting tired of karma fortunes by now.
 
Posts: 1,669
Karma: 2300001
Join Date: Mar 2011
Location: Türkiye
Device: Kindle 5.3.7
if you ensure that the first link is to next html file on each html file, then calibre gives no error on page order. (On my book I put an 1*1 white image file with links to following page on the top of each page. Outcome was awesome. (I'm aware of the dates. This is for the future reference)
ie:
Code:
<body  topmargin="0" >
<div align="center"><center>
<table border="0" cellspacing="1" >
  <tr>
    <td valign="top"><a href="1569.htm" target="_self"><img src="../images/b42.gif" border="0" width="1" height="1"></a></td>
  </tr>
</table>
</center></div>

<p>........
in this case 1569.htm is the next page and b42.gif is a blank gif image

Last edited by thomass; 05-16-2011 at 08:26 PM.
thomass is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RTF to ePub, Chapters Daddy Warpig Calibre 6 05-11-2010 11:06 PM
Make chapters for a document/HTML iodine9176 ePub 12 02-23-2010 02:24 PM
chapters (HTML-files) not showing up erik5000 ePub 1 12-21-2009 04:22 PM
ePub Chapters vs. Stanza Chapters kjk Sigil 4 09-14-2009 10:50 AM
Multi-html files as chapters... WigglePig Sony Reader 5 09-16-2008 04:06 AM


All times are GMT -4. The time now is 08:35 AM.


MobileRead.com is a privately owned, operated and funded community.