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-30-2010, 02:26 PM   #1
daxmon87
Member
daxmon87 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
Table of Contents RTF > MOBI

I have several e-books as RFT files, and I've been using Calibre to convert them to the Mobi format (which btw, Calibre does a great job of doing this!).

I just wanted to know if there was any way I could make a table of contents in the RFT documents, and once I converted to Mobi, I could click on each chapter to jump to that chapter on the Kindle.

Disclaimer: I am not a programmer! Most of my coding experience is basic HTML. I have an inkling that some code may be used in this process, if so, please explain in simple terms. I am a new at all this e-book stuff :P I am a fast learner though.

(My computer runs Mac OS X Snow Leopard and I have the new Kindle 3).

Dax
daxmon87 is offline   Reply With Quote
Old 09-30-2010, 10:01 PM   #2
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
You could try enabling preprocessing under structure detection in the conversion options - if your chapters are marked with typical chapter headings then it will mark those in such a way that Calibre will build a table of contents later in the conversion process.
ldolse is offline   Reply With Quote
Old 10-02-2010, 10:35 AM   #3
daxmon87
Member
daxmon87 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
Quote:
Originally Posted by ldolse View Post
You could try enabling preprocessing under structure detection in the conversion options - if your chapters are marked with typical chapter headings then it will mark those in such a way that Calibre will build a table of contents later in the conversion process.
"If your chapter are marked with typical chapter headings..."

I don't know if they are marked this way. I make the RFT files myself. I like reading fanfiction, so I just copy stories from the internet.

How can I mark the chapters myself so that they will be identified by Calibre?

Thank you for responding!
daxmon87 is offline   Reply With Quote
Old 10-02-2010, 11:07 AM   #4
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,909
Karma: 4329387
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by daxmon87 View Post
How can I mark the chapters myself so that they will be identified by Calibre?
You don't say how you're creating your RTFs but if you're using MSWord then you should style your headings with one (or more) of the built-in heading styles (Heading 1, Heading 2 etc).

For example if you styled your chapter headings with Word style 'Heading 2' then this is the equivalent of using <h2> HTML tags and you should set [Convert] - [StructureDetection] - [Detect chapters at] to //h:h2
and [Convert] - [Table of Contents] - [Level1 TOC] to //h:h2

Edit: This suggestion is not related to Idolse's pre-processing suggestions

Last edited by jackie_w; 10-02-2010 at 11:12 AM. Reason: clarification
jackie_w is offline   Reply With Quote
Old 10-02-2010, 11:31 AM   #5
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Jackie's suggestion is definitely the best way to go about this, especially if you're the author/doc creator.

The point with preprocessing is there are a lot of documents where the publisher of the doc didn't do this, and you're stuck with a doc where chapter detection doesn't work. Preprocessing looks for different patterns in the doc. It starts with lines that say 'Chapter xxx', or similar common headings. If it doesn't detect any chapters it tries numeric headings, and lastly it looks for lines which are composed entirely of uppercase words. This approach can lead to false positives, which is why the help indicates that it could potentially screw up your conversion. In practice false positives are pretty low, and if it happens it's generally easier to fix one or two false positives than it is to manually mark up the whole book beforehand.

Did you actually try enabling preprocessing yet?

Last edited by ldolse; 10-02-2010 at 11:41 AM. Reason: Confused different threads
ldolse is offline   Reply With Quote
Old 10-02-2010, 11:53 AM   #6
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
By the way, even if you do enable preprocessing, you would still need to follow Jackie's advice about Calibre's settings under structure detection/TOC to actually build the Table of Contents. Preprocessing takes those common types of chapter headings I mentioned and wraps them in <h2> tags, but then the structure detection settings must still match how the chapters are defined.

The default rule is this:
Code:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter']
With that and preprocessing you would get an automatically generated TOC if your book happened to use Chapter xxx, or one of the other words in that pattern.

You can change that simply follow Jackie's advice to match all h2 headers in structure detection and TOC creation:
Code:
//h:h2
I'll often just edit the existing xpath though, to match numbers:
Code:
//*[((name()='h1' or name()='h2') and re:test(., '\d+', 'i')) or @class = 'chapter']
or anything:
Code:
//*[((name()='h1' or name()='h2') and re:test(., '.*', 'i')) or @class = 'chapter']
That last one basically does the same as Jackie's suggestion, but all you need to remember is to change the words to '.*' or '\d+'

Last edited by ldolse; 10-02-2010 at 11:59 AM.
ldolse is offline   Reply With Quote
Old 10-02-2010, 02:42 PM   #7
daxmon87
Member
daxmon87 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
I'm using TextEdit on the Mac to create the RTF files. I don't see any options for Headings though.

I also have Pages and I know you can use Heading styles. They aren't labeled as Heading 1 or 2. Just Heading, Title, and Subtitle. I'm thinking that Heading would be the H2. (Title being H1 and Sub-heading being H3).

I'm going to experiment with it a little and see what happens.

Thanks!
daxmon87 is offline   Reply With Quote
Old 10-03-2010, 10:00 PM   #8
daxmon87
Member
daxmon87 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
It didn't work. I honestly don't know what I'm doing. As I said, I'm not very technically inclined.

But thanks for all the help.
daxmon87 is offline   Reply With Quote
Old 10-03-2010, 10:19 PM   #9
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
I've attached a sample RTF file. You'll note the rtf file includes three kinds of common chapter headings.
  1. Take this rtf file add it to Calibre
  2. Highlight the book in Calibre
  3. Click 'c' to open the convert dialog
  4. Click on Structure detection
  5. Enable the preprocessing option
  6. Under 'Detect Chapters (xpath expression), change 'chapter|book|section|part\s+' to '.*'
  7. Select your preferred output format on the upper right corner
  8. Click convert

You generally can't mix and match those three types of chapter headings in a full book (just choose one), but in a test case like this it works fine.

I tested that in Kindle for Mac and Adobe DE, both showed me TOCs. If you're not seeing a TOC maybe you need to describe how you're attempting to view it.
Attached Files
File Type: rtf test_preprocessing.rtf (531 Bytes, 256 views)

Last edited by ldolse; 10-03-2010 at 10:22 PM.
ldolse is offline   Reply With Quote
Old 10-06-2010, 12:36 PM   #10
daxmon87
Member
daxmon87 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
Hi, Idolse:

I just viewed this today, I will try it out.

Thanks for the help.
daxmon87 is offline   Reply With Quote
Old 10-08-2010, 05:36 AM   #11
Gwen Morse
Addict
Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.
 
Posts: 254
Karma: 59872
Join Date: Dec 2009
Location: New York, USA
Device: Kindle 3 (wifi) + nokia n900 tablet phone
Quote:
Originally Posted by ldolse View Post
Jackie's suggestion is definitely the best way to go about this, especially if you're the author/doc creator.

The point with preprocessing is there are a lot of documents where the publisher of the doc didn't do this, and you're stuck with a doc where chapter detection doesn't work. Preprocessing looks for different patterns in the doc. It starts with lines that say 'Chapter xxx', or similar common headings. If it doesn't detect any chapters it tries numeric headings, and lastly it looks for lines which are composed entirely of uppercase words. This approach can lead to false positives, which is why the help indicates that it could potentially screw up your conversion. In practice false positives are pretty low, and if it happens it's generally easier to fix one or two false positives than it is to manually mark up the whole book beforehand.

Did you actually try enabling preprocessing yet?
Does it recognize chapters on lines where the chapter number is Roman numerals (ie: Chapter XXIV) or do the chapter number have to be Arabic numerals?
Gwen Morse is offline   Reply With Quote
Old 10-08-2010, 06:18 AM   #12
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Roman numerals match as well, forgot to include those in the examples. Not because it's looking for Roman numerals specifically, but looking for all uppercase letters without punctuation on a single line is one of the things it looks for.
ldolse is offline   Reply With Quote
Old 10-09-2010, 01:46 AM   #13
Gwen Morse
Addict
Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.Gwen Morse never is beset by a damp, drizzly November in his or her soul.
 
Posts: 254
Karma: 59872
Join Date: Dec 2009
Location: New York, USA
Device: Kindle 3 (wifi) + nokia n900 tablet phone
Quote:
Originally Posted by ldolse View Post
Roman numerals match as well, forgot to include those in the examples. Not because it's looking for Roman numerals specifically, but looking for all uppercase letters without punctuation on a single line is one of the things it looks for.
Thank you, I'll be glad to re-generate my Georgette Heyer ebooks.
Gwen Morse 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
[Old Thread] RTF and Table of Contents ShellShock Calibre 13 02-13-2013 06:39 AM
[Old Thread] Table of contents forced to end not start of .mobi irishpolyglot Conversion 4 05-24-2011 09:33 PM
Table of Contents - html to Mobi problem thames Calibre 3 06-02-2010 08:24 PM
preserve table format when converting mobi to rtf moogoogai Calibre 4 02-26-2010 01:50 PM
PRS-500 Is Working Table of Contents Possible with RTF? Falstaff Sony Reader Dev Corner 2 12-21-2006 12:42 AM


All times are GMT -4. The time now is 10:38 AM.


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