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

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 08-19-2011, 06:16 AM   #1
Skeezix
Enthusiast
Skeezix began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jun 2011
Device: Kindle
TOC/chapter stop issues in .mobi

Okay, I've read the manual about TOCs and MOBI TOCs and the sticky here about TOCs and I'm still hopelessly confused. Here's what I want to do. I have an HTML file that I'm going to convert to MOBI. When I open it in my Kindle, I want it to start where the <h1> tag is. When I press the next section key, I want it to go to either the next <h2> tag or the next <p class="section> tag, whichever comes first. But in the TOC, I only want the <h2> tags listed. Is this even possible? If so, how do I do it?

Part of my confusion when converting this stuff is that there seems to be two places to specify where to detect chapters: one is "Detect chapters at" under "Structure Detection", and the other is the Levels 1-3 TOC under "Table of Contents", and I don't understand the difference or how they relate.

I also don't understand some of the options under "Table of Contents". Like with "Force use of Auto-generated Table of Contents": when I hover over it, it says it will use the source file's Table of Contents if it has one. Well, fine, but if my source file is HTML, how do I include a Table of Contents? Is there a special <div> ID I'm supposed to use, or something? And the "Do not add detected chapters to Table of Contents"... as opposed to what? How would it get chapters, if not by detecting them?

Sorry if I seem completely clueless. The fact is that I've been using Calibre for a while now, and everything else is fairly clear, but this TOC stuff is driving me to drink.
Skeezix is offline   Reply With Quote
Old 08-19-2011, 07:05 AM   #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
Part of the issue is every user has their own pet preferences on how they want their TOC to look & behave, and unfortunately getting even basic TOC is already a lot of work. Basically these types of TOC requirements require authoring tools, and Calibre isn't an authoring tool.

The H1 and H2 being tied to the 5 way controller is no problem - just follow the tutorial in the sticky.

Your other two requirements are getting you into special areas that are more appropriately authoring/editing - Calibre can't automatically meet those requirements. You'd need to convert to ePub, build a TOC by hand in Sigil (optionally convert to Mobi which will gen a two level TOC, and convert that to ePub). Once you have the TOC looking the way you'd want you need to mark it semantically in the ePub so that Calibre knows that the user visible TOC html file is the semantic TOC.

After that you need fix the starting point in a different way, which is also triggered by editing some ePub semantics, I think an element needs to be defined as a guide or a start point (though I'm not sure if you can do that with Sigil or if you need to do it by hand).

Finally when everything is correctly marked semantically and looking as you'd like you need to convert from ePub to mobi with the 'do not add detected chapter to Table of Contents' option.

That's just a high level of what's required - I'm more or less assuming that may scare you away, but if you're willing to tackle that then there is more detail floating around the forum.


Someone else may be able to suggest a way to get the multi-level TOC settings doing some of this for you, but I have a feeling they weren't designed to meet this use case.

Last edited by ldolse; 08-19-2011 at 07:08 AM.
ldolse is offline   Reply With Quote
Advert
Old 08-19-2011, 03:45 PM   #3
Skeezix
Enthusiast
Skeezix began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jun 2011
Device: Kindle
Hmm, okay. I realize Calibre isn't an authoring tool, but I am writing this HTML from scratch in a text editor. It seems odd that I should have to convert it to ePub first to do what I want... aren't ePubs just zip files containing HTML anyway? Seems like I should be able to skip the middleman. But thank you, I will try that.

Any thoughts on my other questions?
Skeezix is offline   Reply With Quote
Old 08-20-2011, 12:58 AM   #4
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 need to use ePub as a format to mark the correct items semantically - Calibre triggers off these semantics during conversion to mobi. HTML doesn't have ebook semantics, it's just html.

When you use ePub, your ePub TOC in Sigil will equate to where the tic marks show up on the Kindle for navigation. The inline user visible TOC is the one you will create by hand.

Here's the post describing how to make your hand-edited TOC the one that's used as a Kindle TOC:
https://www.mobileread.com/forums/sho...0&postcount=11

And here's the thread on controlling the start point:
https://www.mobileread.com/forums/sho...ght=mobi+start

If you go through the Sigil forum there are descriptions there about how the power users go straight from text editors to Sigil for final tweaking as an ebook.

Last edited by ldolse; 08-20-2011 at 01:01 AM.
ldolse is offline   Reply With Quote
Old 08-20-2011, 05:22 AM   #5
Skeezix
Enthusiast
Skeezix began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by ldolse View Post
Here's the post describing how to make your hand-edited TOC the one that's used as a Kindle TOC:
https://www.mobileread.com/forums/sho...0&postcount=11
Aha! Thank you, that gave me the info I needed. There's no need to convert to epub, though (I was trying to avoid doing that because I would lose small-caps formatting in epub). Here's how I did it:
  1. Imported the HTML;
  2. Converted the HTML to MOBI, setting the xpath in "Detect Chapters" to where I wanted the chapter stops to be, and turning on debugging;
  3. In the debug output folder, edited processed\content.opf and added the line mentioned in that post to the <guide> section;
  4. zipped the contents of processed to a new zipfile;
  5. removed all formats from the book's entry in calibre;
  6. imported the new zip file;
  7. converted the ZIP to MOBI, only this time removing the xpath in "Detect Chapters", removing the debugging path, and checking "Do not add table of contents" in the MOBI output options.

Voila! Different TOC and NCX listings, which is what I wanted, with no epub step necessary. Thanks very much for the help!
Skeezix is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre settings for using 'chapter' in TOC TargonD Calibre 13 11-03-2010 08:57 PM
mobi conversion - kindle chapter marker issues foghat Calibre 10 09-29-2010 07:46 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
html2epub TOC and chapter detection help ilovejedd Calibre 6 02-22-2009 05:58 PM


All times are GMT -4. The time now is 05:39 PM.


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