02-01-2009, 03:22 AM | #1 |
Member
Posts: 11
Karma: 12
Join Date: Mar 2008
Device: iLiad, Cybook, Palm T|X, iPod Touch
|
Help on TOC creation
Hi all,
I've problem to understand ho to automatically create the Table of Contents with Calibre. I wish to start from an OpenOffice .odt file, with chapter marked with standard styles Header 1, Header 2 and so on. Then, i convert it to mobipocket o epub files (I don't use .lrf) but no TOC is created. I tried to change the regular expression formula in Chapter detection option, but with no results. How can I do it? thanks MZ |
02-01-2009, 05:22 AM | #2 |
book creator
Posts: 9,656
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Could you post your RegEX expression, please (as zip or rar)?
There is a tool in OO to create a TOC, btw. You could use that and link the chapters to that TOC. If you use Calibre, you can use Calibre to create a TOC with XPath (works largely like RegEx) You use a tag, class, or even recurring word to create those. Instructions can be found in the Calibre manual (online at Kovid's site) |
Advert | |
|
02-01-2009, 01:56 PM | #3 |
creator of calibre
Posts: 44,469
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
unzip your epub file, look at the xhtml files in it. Identify what tags are used to mark headings.
Then read the XPath tutorial in the User Manual to figure out what XPath expression will match those tags |
02-03-2009, 04:59 PM | #4 |
Member
Posts: 11
Karma: 12
Join Date: Mar 2008
Device: iLiad, Cybook, Palm T|X, iPod Touch
|
ok, I start by uncompress and analyze a .odt file. The file that contains data is called content.xml. In this file are present the tags surrounding the styles.
The tag that identifies the chapter heading is: <text:h text:style-name="Heading_20_1" textutline-level="1"> </text:h> I wish to build a TOC (in Mobi or Epub files) by creating a Xpath expression that recognize these tags. Unfortunately I'm not able to write a working expression. Do you have some suggestion? Thanks |
02-03-2009, 06:28 PM | #5 |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
For formats like OpenOffice documents, calibre first converts the file to XHTML. Your XPath expression needs to be in terms of the XHTML calibre generates. To look at that XHTML and figure out the expression you need, create an EPUB file, then unzip it and look at the HTML it contains. (The EPUB container is just a ZIP file, so you can unzip it with the tool of our choice.)
|
Advert | |
|
02-03-2009, 06:37 PM | #6 | |
creator of calibre
Posts: 44,469
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
02-04-2009, 12:11 AM | #7 |
Member
Posts: 11
Karma: 12
Join Date: Mar 2008
Device: iLiad, Cybook, Palm T|X, iPod Touch
|
Oh, my God! It's working... It's simplest that I figure...
Thanks for your support, now the mobi creation from OOo files is almost perfect! Just one more question. What about ticket #1730 ? The mobi (and epub, too) files creation, ignoring the line and page breaks. Using other tools like Mobicreator, the page and line breaks are retained, but not with Calibre. This generate a less readeble mobi (and epub too) files. Thanks again |
02-04-2009, 12:43 AM | #8 |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TOC Creation Problem | penguintri | Calibre | 8 | 10-06-2010 08:36 PM |
TOC Creation & Calibre vs. MobiPocket | Themus | Calibre | 8 | 05-15-2010 11:32 AM |
TOC Creation - simplifying suggestion | Fredom | Calibre | 1 | 04-21-2010 08:29 PM |
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working | Magitek | LRF | 0 | 05-06-2009 01:25 PM |
Chapter or TOC Creation help needed | gandor62 | Calibre | 4 | 04-15-2009 02:18 PM |