Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-02-2008, 11:52 AM   #1
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
[Old Thread] RTF and Table of Contents

Hi

I've been happilly converting RTF to LRF using the fantastic Calibre.

One thing puzzles me - if it is possible to generate a table of contents?

Initially I didn't have any headings in the text, so in the LRF file one chapter led straight into the next.

So in Word I then marked all the chapter headings using the Word Heading 1 style. After Calibre had converted the RTF to LRF, I now had page breaks before each chapter. This seems to suggest that Calibre was able to detect the chapter headings correctly.

But I cannot get the "Add chapters to table of contents" option to work.

Is this supposed to create a TOC even if one does not exist already in the RTF?

I have also tried using Word to insert a TOC into the RTF - in Word 2003: Insert -> Reference -> Index and Tables -> Table of Contents -> Untick "Show Page Numbers". I then converted the RTF using Calibre; this has a couple of problems:

All the links in ToC in the LRF file jump to the first page of the document (The links work OK in Word).
There is two blank lines between each row in the ToC.

I will continue to play around with this but any help would be appreciated.

I realise that Word puts A LOT of "helpful" tags around headings that probably are not necessary. I imagine this makes Calibre's job very difficult - trying to separate the wheat from the chaff.

Thanks
ShellShock is offline   Reply With Quote
Old 11-02-2008, 12:23 PM   #2
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'd sugest converting to epub instead, it has more powerful options for the autogeneration of the TOC (change your output format to epub in the config dialog).

EDIT: Or the following options should work with lrf conversion

--chapter-attr h1,none, --add-chapters-to-toc
kovidgoyal is online now   Reply With Quote
Advert
Old 11-02-2008, 12:55 PM   #3
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
OK, I tried that but the conversion job is not completing - The hour glass is spinning and it has been going for 10 mins already. Conversion to LRF only takes a minute for the same RTF file.

Any thoughts?
ShellShock is offline   Reply With Quote
Old 11-02-2008, 12:58 PM   #4
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
epub conversion can be slow sometimes because it has to split the file into smaller chunks (a limitation of adobe's reader software on the 505). You can click the hourglass and then double click the job entry to see what its doing.
kovidgoyal is online now   Reply With Quote
Old 11-02-2008, 01:26 PM   #5
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
I wasn't giving it long enough to convert the file - it took about 20 mins in the end, at least 10 of which was on "Saving stylesheets".

I still didn't get a TOC though...
ShellShock is offline   Reply With Quote
Advert
Old 11-02-2008, 01:43 PM   #6
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
try the options i talked about above for lrf conversion.
kovidgoyal is online now   Reply With Quote
Old 11-02-2008, 02:29 PM   #7
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
OK I tried those options...I think. I ticked "Add chapters to table of contents" and set "Detect chapter at tag" to "h1,none,", but still no joy.

By the way the RTF has both "Heading 1" and "Heading 2" chapter headings. In the LRF these both have page breaks before them, so Calibre seems to be detecting them OK, but it is not creating a TOC.
ShellShock is offline   Reply With Quote
Old 11-02-2008, 03:13 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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's odd. Open a ticket and send me this rtf.
kovidgoyal is online now   Reply With Quote
Old 11-02-2008, 04:17 PM   #9
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
OK I have raised this as #1220.

Many thanks
ShellShock is offline   Reply With Quote
Old 11-10-2008, 06:12 AM   #10
dmitcalf
Junior Member
dmitcalf began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2008
Device: PRS505
TOC in RTF - a solution

I have also tried the auto chapter detection with a number of different formats inc RTF and HTML. I created several test documents so I can control the chapter tag and attribute + value. Nothing works. The only reliable way to get a TOC is to go via Mobipocket Creator which detects the chapter tag ok. The full procedure I used is:

- Edit the doc in Word and save in RTF. Create a word style - I called it ChapterHeading - based on Heading 1. Give all the chapter headings this style. There must be a hard page break before the chapter heading with no other page or section breaks in the doc. Whilst you are at it you can get rid of split lines and multiple blank lines also. Save as RTF.

- Switch to Mobipocket Creator and create a new publication by importing a Word doc. Import the RTF and add a TOC. In the TOC panel set 'h' as the tag, 'class' as the attribute and 'ChapterHeading' as the value. Build the publication to get the .prc file.

- Switch to Calibre and convert to LRF.

- Bingo you have a perfect eBook with TOC.

- repeat for the other 15000 ebooks in your collection.
dmitcalf is offline   Reply With Quote
Old 11-16-2008, 03:37 AM   #11
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
This turned out not to be a bug in Calibre at all but my misunderstading

Calibre does not embed a TOC in the ebook itself. However, if you press the Menu button on the Reader and go to the main menu for the book, there is a "Table of Contents" option which will take you to the TOC created by Calibre. This is easier to use than an embedded TOC as it is easier to get to.

ShellShock is offline   Reply With Quote
Old 11-16-2008, 09:21 AM   #12
alexxx
Connoisseur
alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.alexxx ought to be getting tired of karma fortunes by now.
 
Posts: 68
Karma: 479602
Join Date: Aug 2006
Device: Kindle DX
Quote:
Originally Posted by ShellShock View Post
This turned out not to be a bug in Calibre at all but my misunderstading

Calibre does not embed a TOC in the ebook itself. However, if you press the Menu button on the Reader and go to the main menu for the book, there is a "Table of Contents" option which will take you to the TOC created by Calibre. This is easier to use than an embedded TOC as it is easier to get to.

don't worry, I made the same mistake some months ago, keeping Kovid awake at night to hunt for the bug, while the TOC was patiently waiting there in the menu...


alessandro
alexxx is offline   Reply With Quote
Old 02-13-2013, 05:16 AM   #13
yarr
Junior Member
yarr can extract oil from cheeseyarr can extract oil from cheeseyarr can extract oil from cheeseyarr can extract oil from cheeseyarr can extract oil from cheeseyarr can extract oil from cheeseyarr can extract oil from cheeseyarr can extract oil from cheeseyarr can extract oil from cheese
 
Posts: 2
Karma: 1234
Join Date: Feb 2013
Device: none
Working TOC in RTF

Code:
{\rtf1\ansi\deff0\adeflang1045
{\fonttbl {\f0\fsserif\fcharset238 Verdana;}}

\titlepage\line\line\line\line\line
{\pard
{\field{\*\fldinst HYPERLINK \\l "toc"} {\fldrslt\f0\fs80\b\scaps\qc\ul0 Title Page\line go to Table of Contents}}
\par}

\page{\*\bkmkstart page2}{\*\bkmkend page2}\line\line\line\line\line{\pard\f0\fs80\b\scaps\qc\sa10000{\field{\*\fldinst HYPERLINK \\l "toc"} {\fldrslt Page}} \chpgn\par}
\page{\*\bkmkstart page3}{\*\bkmkend page3}\line\line\line\line\line{\pard\f0\fs80\b\scaps\qc\sa10000{\field{\*\fldinst HYPERLINK \\l "toc"} {\fldrslt Page}} \chpgn\par}
\page{\*\bkmkstart page4}{\*\bkmkend page4}\line\line\line\line\line{\pard\f0\fs80\b\scaps\qc\sa10000{\field{\*\fldinst HYPERLINK \\l "toc"} {\fldrslt Page}} \chpgn\par}
\page{\*\bkmkstart page5}{\*\bkmkend page5}\line\line\line\line\line{\pard\f0\fs80\b\scaps\qc\sa10000{\field{\*\fldinst HYPERLINK \\l "toc"} {\fldrslt Page}} \chpgn\par}

\page{\*\bkmkstart toc}{\*\bkmkend toc}{\pard\sa1000\f0\fs50\b\qc{\field{\*\fldinst TOC}{\fldrslt Table of Contents}}\par}
{\pard\f0\fs28\fi0\trowd\cellx8000\cellx8600
\pard\intbl\ql {\field{\*\fldinst HYPERLINK \\l "page2"} {\fldrslt\ul0 Link to anchor #page2}}\cell\pard\intbl\qr {\field{\*\fldinst PAGEREF page2}}\cell\row
\pard\intbl\ql {\field{\*\fldinst HYPERLINK \\l "page3"} {\fldrslt\ul0 Link to anchor #page3}}\cell\pard\intbl\qr {\field{\*\fldinst PAGEREF page3}}\cell\row
\pard\intbl\ql {\field{\*\fldinst HYPERLINK \\l "page4"} {\fldrslt\ul0 Link to anchor #page4}}\cell\pard\intbl\qr {\field{\*\fldinst PAGEREF page4}}\cell\row
\pard\intbl\ql {\field{\*\fldinst HYPERLINK \\l "page5"} {\fldrslt\ul0 Link to anchor #page5}}\cell\pard\intbl\qr {\field{\*\fldinst PAGEREF page5}}\cell\row
\par}
}

Last edited by yarr; 02-13-2013 at 08:43 AM.
yarr is offline   Reply With Quote
Old 02-13-2013, 05:39 AM   #14
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
Welcome to MobileRead!

Moderator Notice
I know you mean well and I encourage you to help folks with your knowledge, but stop resurrecting ancient threads. The thread you are posting to is over 4 years old. Calibre has gone through Five Major revisions and over 200 minor version updates since this thread was created.

There was an Old Thread Warning below your reply window that you didn't see or chose to ignore. As a general rule necroposting should be avoided. When in doubt start a new thread.

Quote:
Old Thread Warning
Quote:
This thread is quite old and may contain outdated information. We recommend that you begin a new discussion if you like to talk about a similar topic. Of course, you may also proceed and reply here.

Last edited by DoctorOhh; 02-13-2013 at 05:44 AM.
DoctorOhh is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of Contents not being identified as Table of Contents openletter Conversion 2 10-19-2012 12:54 AM
[Old Thread] Table of contents forced to end not start of .mobi irishpolyglot Conversion 4 05-24-2011 08:33 PM
Table of Contents ucoa Calibre 1 01-07-2011 09:01 PM
Table of Contents RTF > MOBI daxmon87 Calibre 12 10-09-2010 12:46 AM
PRS-500 Is Working Table of Contents Possible with RTF? Falstaff Sony Reader Dev Corner 2 12-20-2006 11:42 PM


All times are GMT -4. The time now is 12:15 AM.


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