04-10-2012, 07:39 AM | #1 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
How do I add a Table of Contents to a Kindle Previewer mobi?
I've made an epub with Indesign. I converted it to a mobi using KindlePreview after a bit of help from this forum everything looks great! I'm ready to upload to Amazon. I manually created a table of contents with hyperlinks at the start of the book and this works fine. But the Go to Table of Contents function is not working.
Searching the internet I've learnt I have to tinker with this myself by creating a html document and adding a 'toc tag?' into my file. I've seen some comments to use Mobipocket creator but they refer to people who are making books with Word. I'm not sure if this would also affect the formatting of my book. I'm a complete beginner with this but would appreciate any advice or links to a step by step guide. I really don't know where to start. Thanks |
04-10-2012, 07:55 AM | #2 |
Grand Sorcerer
Posts: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
In order for the "Go to Table of Contents" functionality to work. There must be a reference item in the Guide section of the OPF file identifying the html ToC.
Code:
<guide> . . <reference href="Text/your_file_name.xhtml" title="Table Of Contents" type="toc" /> . . </guide> Make sure the "href" attribute actually points to your html toc (correct file name/location). If your ToC is a single stand-alone html file, that's all you need to do. But if it's just a section of another HTML file, you'll have to identify it with an anchor (or any tag with an "id" attribute actually) and include that url fragment in the <reference /> tag's href attribute. In the HTML file: Code:
<a id="toc"></a> Code:
<reference href="Text/your_file_name.xhtml#toc" title="Table Of Contents" type="toc" /> |
Advert | |
|
04-10-2012, 08:28 AM | #3 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
DiapDealer Im finding it quite difficult so thanks for taking the time to help.To keep things simple its probably best I create a separate html ToC rather then muck about with my code. So let me reiterate and see if I've understood this right.
* I first unzip the original epub * I create a separate html table of contents. With this code listed at the top Code:
<a id="toc"></a> * I then add the Guide code you listed above to my OPF file. -In my OPF there isn't a Guide section. There is metadata, manifest, and a spine toc=ncx. So I add it between metadata and manifest? And it will look like this Code:
<guide> <reference href="Text/your_file_name.xhtml" title="Table Of Contents" type="toc" /> </guide> Code:
<reference href="Text/your_file_name.xhtml#toc" title="Table Of Contents" type="toc" /> Is that right?! Also, do I need to put some markers at the start of each html document (chapter page) so the ToC can find it? Last edited by Kratos; 04-10-2012 at 08:33 AM. |
04-10-2012, 09:08 AM | #4 |
Grand Sorcerer
Posts: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Sorry to be unclear. It's an either/or situation. If you have a separate html file for your TOC (and it's already listed in the Manifest and the Spine), all you need to do is add the one reference item to the guide section of the OPF:
Code:
<reference href="Text/your_file_name.xhtml" title="Table Of Contents" type="toc" /> The Guide section usually appears after the Spine section, but I doubt if that's a requirement. Code:
. . . </spine> <guide> <reference href="Text/your_file_name.xhtml" title="Table Of Contents" type="toc" /> </guide> </package> As to the actual content/formatting of the HTML ToC, you'd indicated that you already created it. But it's nothing more than a bunch of html links to different points in the ebook. Nothing special is really needed. If the links were working properly (with the exception of the "Go to ToC" functionality), then you've already done that part correctly. |
04-10-2012, 10:41 AM | #5 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
Oh Lord I am so stuck. I haven't done anything yet. Nothing listed in my Manifest or Spine. No ToC created yet. I don't know what step 1 should be.
So close to finishing but so far. Why doesn't Amazon include a ToC maker? The mental thing is I can't find any relevant instructions via the internet. They are all for Word or html. I'm trying a non-coding method. I've installed Sigil. I have edited the metadata with it. But not created a Table of Contents. It tells me to use Calibre! Which is not an option because it loses the formating I have. |
Advert | |
|
04-10-2012, 10:55 AM | #6 | ||
Grand Sorcerer
Posts: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Just so we're somewhat on the same page... this: Quote:
|
||
04-10-2012, 11:19 AM | #7 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
I do have a internal Table of Contents that is viewable like an ordinary page. But not the Kindle menu accessible ToC.
|
04-10-2012, 11:32 AM | #8 | |
Grand Sorcerer
Posts: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
04-10-2012, 11:37 AM | #9 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
yes I do!
|
04-10-2012, 11:59 AM | #10 |
Grand Sorcerer
Posts: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Open a copy of that ePub with Sigil and locate the html file that contains that viewable ToC in Sigil's Book Browser (where you can see all the folders, html files, css, opf... etc) and double-click it to open it. Does that html file contain other parts of the ebook in addition to the ToC section? Or does it only contain the ToC?
|
04-10-2012, 12:02 PM | #11 | |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
Quote:
On the panel on the left I can see all the internal files which are * the individual html files for each page/chapter * Styles, Images, Fonts, Misc folders * toc.ncx * content.opf |
|
04-10-2012, 12:14 PM | #12 |
Grand Sorcerer
Posts: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Can you find/select the HTML file that contains what you described as the "internal Table of Contents that is viewable like an ordinary page"? The list of "hyperlinks at the start of the book"?
When you do find it... does that HTML file contain ONLY the Table of contents (the working hyperlinks), or does it also contain more of the ebook (like the first chapter or more)? |
04-10-2012, 12:21 PM | #13 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
In the book I created a page that has just the table of contents and nothing else. This is a sample from the body part -edited.
Code:
<body> <div class="story" id="AAA-Fab-05b-chapter-heads-2.html" xml:lang="en-GB"> <p class="chapter" id="toc_marker-3"><span class="body sgc-1"><a id="Anchor-376"></a></span><span class="Chapter-Text sgc-2">Table of Contents</span></p> <p class="body"><span class="ToC-larger-Text sgc-3"><br /></span><a href="#Anchor-317"><span class="ToC-larger-Text sgc-3">Foreword</span></a></p> |
04-10-2012, 12:37 PM | #14 |
Grand Sorcerer
Posts: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Don't confuse "page" with "file." What I'm asking is if the TOC "page" that you created is the only thing in that particular html "file." Or does that same html file contain many other pages (in addition to the TOC).
|
04-10-2012, 12:40 PM | #15 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
It just has references to the ToC.
Because when I created the epub in Indesign on export I chose to break the document at my Chapter Title paragraph style. So the next chapter is in its own html page. Here is the code from the page - with extra chapter hyperlinks removed. Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>AAA Fab 05b chapter heads-2.html</title> <link href="../Styles/template.css" rel="stylesheet" type="text/css" /> <style type="text/css"> /*<![CDATA[*/ span.sgc-4 {font-size:1.43em;} span.sgc-3 {font-size:1.14em;} span.sgc-2 {font-size:1.11em;} span.sgc-1 {font-size:0.67em;} /*]]>*/ </style> </head> <body> <div class="story" id="AAA-Fab-05b-chapter-heads-2.html" xml:lang="en-GB"> <p class="chapter" id="toc_marker-3"><span class="body sgc-1"><a id="Anchor-376"></a></span><span class="Chapter-Text sgc-2">Table of Contents</span></p> <p class="body"><span class="ToC-larger-Text sgc-3"><br /></span><a href="#Anchor-317"><span class="ToC-larger-Text sgc-3">Foreword</span></a></p> <p class="body"><span class="Chapter-Text sgc-4"><a id="Anchor-317"></a><br /> <br /> <br /></span></p> </div> </body> </html> Last edited by Kratos; 04-10-2012 at 12:55 PM. |
Tags |
mobi, table of contents, toc |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creator How do I add a table of contents when using mobipocket creator? | Kratos | Kindle Formats | 24 | 06-20-2012 05:03 AM |
Extract table of contents from mobi file | oecherprinte | Kindle Formats | 7 | 04-16-2012 12:10 PM |
Table of Contents RTF > MOBI | daxmon87 | Calibre | 12 | 10-09-2010 12:46 AM |
Table of Contents - html to Mobi problem | thames | Calibre | 3 | 06-02-2010 07:24 PM |
PRS-500 Can I add a table of contents to a given lrf file? | harpum | Sony Reader Dev Corner | 0 | 07-13-2007 08:36 PM |