09-17-2010, 05:41 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
|
Authoring Kindle eBooks with chapter markers
Hey guys,
Just got my kindle 3 in the mail (early even), and I'm pretty excited. I've been getting familiar with the tools (calibre, sigil, etc).. I've put together some books (epub) from scratch in sigil, then I've run them through calibre to convert them to mobi. However, I can't get the chapter indicators to show up on the bottom progress bar on the kindle while reading. Also, is there a more direct way to author mobi files or am I doing it right? Please advise. |
09-17-2010, 06:19 PM | #2 |
Guru
Posts: 973
Karma: 2458402
Join Date: Aug 2010
Location: St. Louis
Device: Kindle Keyboard, Nook HD+
|
Are you breaking up the chapters into separate files (within Sigil)? (You hit CTRL-Enter after a chapter ends)
I think that's the key to getting the chapter marks when they convert. At least that's what I do and I get those marks. |
Advert | |
|
09-17-2010, 06:31 PM | #3 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
The key is to have a fully-filled out NCX file properly referenced in the OPF. Without that, there can be no chapter marks, which you can direct at various points within a single file, if you prefer, rather than splitting your chapters up into separate files.
The more direct way is to do your markup/assembly by hand/with text editor and command-line tools. As far as the NCX goes, this can be kind of tedious, but I like to fine tune mine, so I have a cut and paste template which I fill out) or with whatever suitable ePub-creating tool you like. One warning: if you create nested navpoints, only the first level of them will seem to show up on the Kindle, but the rest will apparently be there, but inaccessible until you navigate to where one of them should be, and then flick the controller back and forth. They'll still be invisible though, which can be very frustrating. Hope this helps, and welcome to MobileRead! Last edited by ATDrake; 09-17-2010 at 06:49 PM. Reason: Needz moar welcome message. |
09-17-2010, 07:53 PM | #4 | ||
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
|
Quote:
Quote:
This is definitely what I've been looking for.. What epub creating tool do you use? Thanks for the welcome, it's nice to find some fellow literate people out here Thanks! I hope I continue being this motivated to read. Being able to travel with books is key |
||
09-17-2010, 08:34 PM | #5 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
I'm actually one of those text editor/command-line people and a Mac user besides, so you might not find my usual toolset all that helpful.
But if you want to make a quickie NCX, just shove a few id="yourlinkhere" attributes into each and every <h1>, <div>, <p> or whatever other tag you want to have a link to, and then cut and paste the following to a new file, filling in the [] bits as appropriate. Code:
<?xml version="1.0" encoding="UTF-8"?> <ncx version="2005-1" xmlns="http://www.daisy.org/z3986/2005/ncx"> <head> <meta name="dtb:uid" content="[use same as unique-identifier="" from OPF]" /> <meta name="dtb:depth" content="1" /> <meta name="dtb:totalPageCount" content="0" /> <meta name="dtb:maxPageNumber" content="0" /> </head> <docTitle> <text>[Book Name]</text> </docTitle> <docAuthor> <text>[Book Author]</text> </docAuthor> <navMap> <navPoint id="[yourlinkhere]" playOrder="[number in order]"> <navLabel><text>[Chapter X Section Y]</text></navLabel> <content src="[name of file].html#[yourlinkhere]" /> </navPoint> </navMap> </ncx> If you've split into multiple files, you don't need to bother adding the id="" to the text or using the .html#yourlinkhere unless you want internal subsections or the like. Just go directly to the files as src="chapter01.html" and everything will take care of itself. Kindlegen will even start fresh chapters on new pages instead of running the text on from the previous. When you're done, add the following to the OPF if it doesn't already exist: <item id="ncx" media-type="application/x-dtbncx+xml" href="toc.ncx" /> under the "manifest" element and <spine toc="ncx"> You can call the "ncx" to anything you like, as long as you give the item id="" and toc="" the exact same name. After that, you should be good to go once you've zipped up the ePub or converted straight to Mobi from the OPF, whichever you prefer. |
Advert | |
|
09-17-2010, 08:42 PM | #6 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
|
Thanks again for your help ATDrake!
Your post was very helpful as I completely screwed up my header id's, once I cleaned them up it worked great. That was a pretty quick/straightforward fix. Retested and works great now! |
09-17-2010, 08:48 PM | #7 |
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
Glad to hear it worked out! Nicest thing about e-books is the way they can be customized just the way you like them.
|
09-17-2010, 11:15 PM | #8 |
Guru
Posts: 973
Karma: 2458402
Join Date: Aug 2010
Location: St. Louis
Device: Kindle Keyboard, Nook HD+
|
Are you making a TOC in Sigil? I've been going from text files as my source, so I just also highlight the first line of each chapter and making it the heading (the dropdown box on the top left).
That and splitting up the chapters is all I do out of the ordinary, and as I've said, all my books have had those chapter marks. |
01-27-2011, 12:02 PM | #9 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: none
|
Hi, I know this thread has been inactive for awhile, but hopefully someone will see this and be able to help. I'm trying to build mobi/prc files from epubs and consistently get the error message: "Hyperlink not resolved in tocblah blah blah)" I'm using an NCX file, and I've noticed that this error always seems to occur when attempting to make a nested TOC using anchors... the error occurs at the first sign of an anchor using #.
Example: <content src="Chapter1.xhtml#section1"/> This corresponds to a paragraph in the file "Chapter1.xhtml" that has the id tag, that is: <p id="section1">Text text text</p>. I've looked around a bunch of threads here and elsewhere and haven't been able to find a solution... can anyone help? (Note: I am sometimes, though not always, able to convert these epubs to mobi format using kindlegen, but I need to use mobipocket creator to add DRM.) |
01-27-2011, 12:25 PM | #10 |
Wizard
Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
|
Maybe the tool(s) you are using expect the older format of tag, using <a name="section1"> instead of a tag with the id attribute (<p id="section1">)?
|
01-27-2011, 01:01 PM | #11 |
Groupie
Posts: 180
Karma: 558490
Join Date: Jan 2011
Device: Kindle 5, Amazon Fire 5th Gen, Moto Z Play Droid
|
I have bought more than one ebook for my Kindle from Amazon that didn't come with chapter markers, as well it didn't have an NCX file (and sometimes didn't even have a Table of Contents). God knows why someone would publish said books without these things. =\
But anyways, I've learned how to get Calibre to create decent chapter markers for said books. Different books have different problems, but I've found that, for the most part, the following works: (In the convert settings for the book) change the "Detect Chapters at" field at the top of the Structure Detection section to: //*[((name()='h1' or name()='h2' or name()='h3') and re:test(., 'chapter|book|section|part|prologue|epilogue\s+', 'i')) or @class = 'chapter'] (most of it is default, but I add the bolded part) Check the box for "Force use of auto-generated Table of Contents" in the Table of Contents section For books that have a TOC but no chapter markers, a good thing to do is to: Check the box for "Do not add Table of Contents to book" under MOBI output (or w/e output you use) if the book already has a working TOC, so that it will add chapter markers in places where the generated TOC would link them, but linking to the TOC from the menu takes you to the original TOC at the front of the book instead having created a new one in the back. With Star Trek: New Frontier, which contains the first 4 books of the series in one volume (and which came with no chapter marks, no table of contents, and an NCX file which was in a tree format which didn't seem to work at all,) I basically did this while leaving the "Do not add Table of Contents to book" unchecked in the MOBI Output section, since there was no TOC in the first place. The formatting of the chapters is really weird for this book, but what Calibre did for it was certainly tolerable. Now, in the case of my copy of the 50th anniversary The Lord of the Rings (one volume containing all 3 books,) the only chapter markers that existed pointed to the start of each book (ie. there were only 3 chapter markers, period.) When I used the above method, Calibre added chapter markers for each entry in the existing TOC itself, made a pagebreak between each, and detected the actual chapter headings and their subheadings as seperate chapter breaks. So I had to change the dropbox labeled "Chapter Mark" in Structure Detection to none, and put the word Chapter in the "TOC Filter" box in Table of Contents (because it also detected the chapter headings and subheadings as different chapters.) I did check the "Do not add Table of Contents to book" in the MOBI Output section, since a TOC came with the book and did work. This all sounds sloppy, but it works rather well. Last edited by chyron8472; 01-27-2011 at 01:13 PM. |
01-27-2011, 03:59 PM | #12 |
Junior Member
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: none
|
Susan, I've been able to use Mobipocket Creator to convert some epubs that use the id attribute rather than the old <a> tag, so I don't think that's the problem here. However, your comment got me thinking in this direction: I've only looked at a limited sample size so far (4-5 of each), but I noticed that the epubs I have been able to convert to a DRM'd mobi consist of htm or html files, while those that have NOT been able to convert consist of xhtml files. Again, I've only looked at a few, but I'm wondering... does Mobipocket Creator have some sort of problem with xhtml (files)? Does it require all the content files to be htm(l)? I find it hard to believe that none of the epubs I've converted to DRM'd mobi so far have been built of xhtml files, but I suppose it is possible. Can anyone confirm Mobipocket Creator's compatibility with xhtml?
|
01-27-2011, 08:06 PM | #13 | |||
Wizzard
Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
Quote:
Though it's always possible MBPC is choking on the XHTML, as you hypothesized. I don't think it's been updated in years, and possibly either the filetype declaration in the OPF or the <empty-tag /> structure or maybe the DOCTYPE declaration if exists is something it refuses to parse. Hope this helps, and welcome to MobileRead! Quote:
I've seen it happen with freebie books that were available at multiple outlets, where the ePub version had a proper TOC and NCX and showed chapter marks once converted, whereas the AZW from Amazon didn't. Quote:
To navigate to the sub-levels (which are invisible, but exist), you have to first navigate to a top level dot (say, "Part I"), page forward until you reach the start of a second-level location (a chapter or individual poem) and then you can flick back and forth between the chapters at that level. Amazon should include on the actual Kindle something like they have in the Kindle Previewer app, where you click a button and you can see and navigate through the entire nested NCX structure at once. |
|||
01-27-2011, 08:38 PM | #14 |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
I've got a feeling this has something to do with the EPUB file containing multiple XHTML files, and the same "id" value being used in more than one XHTML file. When compiled into a MOBI file, the content is rolled up into a single file, but I've got a notion the "id" values used in links like these ones in your NCX file remain unchanged. So if you have a "section1" bookmark in both "chap01.xhtml" and "chap02.xhtml", when converting to MOBI using MobiPocket Creator, I think you end up with the problem of multiple occurrences of the same bookmark name.
If I'm right, and this is what is causing the problem, you need to go through the EPUB and change these bookmark names so that they are unique without relying on being in different files (so the example given might become "chap01sect1"), and change all references that point to each bookmark (such as references in the NCX file, OPF file and inline TOC). |
01-27-2011, 08:43 PM | #15 |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
Just a quick follow-up to clarify something there:
Inside the MOBI file itself, links to named locations in the file are converted to numerical byte locations within the file. However the id (bookmark) value is used by prcgen in the process of generating the MOBI file from the source files. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle Chapter Markers | penguintri | Amazon Kindle | 7 | 09-13-2010 01:47 PM |
inline page markers overtop of text?? | Stinger | Kobo Reader | 9 | 05-28-2010 05:42 PM |
Ebooks battle for next chapter | Moejoe | News | 13 | 04-26-2009 09:18 AM |
guardian.co.uk:Ebooks battle for next chapter | Kris777 | News | 1 | 04-26-2009 01:29 AM |