View Full Version : Epub to Mobi & TOC


Nate the great
09-30-2009, 08:32 PM
Does anyone know how I can tell calibre to incorporate the table of contents that's in the Epub into the Mobipocket file? It does not do it by default.

GRiker
10-01-2009, 06:00 AM
In the .opf file, add this section:

<guide>
<reference type="toc" title="Table of Contents" href="TOC.html" />
</guide>

where 'TOC.html' points to your Table of Contents.

G

Nate the great
10-01-2009, 07:18 AM
In the .opf file, add this section:

<guide>
<reference type="toc" title="Table of Contents" href="TOC.html" />
</guide>

where 'TOC.html' points to your Table of Contents.

G

Yeah, no. I'm not going to do that for 500 books. Besides, the Epub toc isn't a html file; it's the toc.ncx file. What you suggest isn't going to help.

Jellby
10-01-2009, 07:55 AM
Shouldn't it include the TOC by default?

--no-inline-toc Don't add Table of Contents to end of book. Useful if the book has its own table of contents.

There doesn't seem to be a reverse option, maybe you have --no-inline-toc in your default settings somewhere?

GRiker
10-01-2009, 08:11 AM
Sorry if I misunderstood your objective. Adding the <guide> section makes an existing TOC accessible in a MOBI file. For example, with the Kindle, it enables the 'Table of Contents' feature when you press 'Menu' in a book. Calibre uses the TOC.NCX file to specify where the chapter breaks will occur on the Kindle.

Generating the actual TOC content is a different matter. Your question suggested that you wanted to use an existing TOC.

G

Nate the great
10-01-2009, 08:16 AM
Shouldn't it include the TOC by default?

--no-inline-toc Don't add Table of Contents to end of book. Useful if the book has its own table of contents.

There doesn't seem to be a reverse option, maybe you have --no-inline-toc in your default settings somewhere?

I'm using the GUI. The only thing I had checkboxed was "don't add detected chapters to the toc". I left that unchecked when I converted several titles last night and it had no effect. And just to be clear, I know that the Epubs had a toc. I looked.

JSWolf
10-01-2009, 08:19 AM
Are any of the ePubs in question able to be posted here so we can take a look?

GRiker
10-01-2009, 09:19 AM
One other thing to check ...

Is the toc.html file listed in the manifest and spine sections of the OPF file?

G

Nate the great
10-01-2009, 09:53 AM
One other thing to check ...

Is the toc.html file listed in the manifest and spine sections of the OPF file?

G

I'm not talking about a html file, or an inline toc. But if I were, I said that I knew the TOC was in the Epub. That means I saw it. If the inline toc is in the Epub, then it is obviously named in the OPF file.

Jellby
10-01-2009, 11:03 AM
I'm using the GUI. The only thing I had checkboxed was "don't add detected chapters to the toc".

So, you don't have "Do not add Table of Contents to book" checked in the "MOBI output" section?

And just to be clear, I know that the Epubs had a toc. I looked.

It works when opening the ePUB in ebook-viewer, then?

Nate the great
10-01-2009, 11:08 AM
So, you don't have "Do not add Table of Contents to book" checked in the "MOBI output" section?


Correct.


It works when opening the ePUB in ebook-viewer, then?

Correct.

I guess I need to file a bug report.

Nate the great
10-01-2009, 02:04 PM
I filed a bug report. Kovid said not to use "Kindle" as an output setting, which didn't help because I wasn't using it. I tried other settings like "Cybook G3" and "Mobipocket Books". Neither Mobi had a toc.

JSWolf
10-01-2009, 03:33 PM
I just converted the following two ePubs to Mobi and they both came out fine.

The Secret Adversary
http://www.mobileread.com/forums/showthread.php?t=53913

The Mysterious Affair at Styles
http://www.mobileread.com/forums/showthread.php?t=54721

The only thing that didn't convert well was the SVG cover used in The Mysterious Affair at Styles.