Monday, January 20, 2014

Possible Table of Contents EPUB validation Error - Case Study

Recently, a UK reader sent me a message with an epub validation error related to the table of contents file.  Without getting into all the reasons this can occur, let me provide you the most common reason and how to make sure it doesn't happen to you in the future.

By defaut, Jutoh generates a table of contents with links to all your chapters.  Most of the time this is great, but depending on your style sheet it can sometimes create a problem.  Specifically, when a level 2 or more heading was found, but not a level 1 heading, then Jutoh would add a level 1 entry using the first bookmark it found - which had already been used by the level 2 heading which creates a TOC error with two TOC identifiers sharing the same item.

As most of us flail about while using style sheets, or have many styles included that are not used, it is easy for this error to occur.  Just in case you are not perfect (I know I'm not), I suggest you do two things to make sure your table of contents is generated correctly.

First UNCHECK the  "generate table of contents" in your configuration file.

Second use the Table of Contents wizard to generate your table of contents from the sections you have defined in Jutoh. This will make sure that the TOC reflects exactly what you intend it to reflect. 

So, let's take a look at how to do these two steps.


Open a Jutoh file with your book. Then click on the Book menu item, and select Edit Configuration.

Scroll down in the configuration for building Epub files until you see Generate table of contents under Options.  There should NOT be a checkmark here. If there is, click on it and the checkmark will go away.

Click the OK button to save your new configuration. 


Go to the Book menu item and select Build table of contents.

The Table of Contents Wizard screen will appear. Click in the circle next to the first item, "Leave it to Jutoh." 

This will create a Table of Contents based on your section titles (see in the content section on the left side of your Jutoh screen). It will not search for styles or headers or anything. It will only take those sections as you have already defined them.

Click the NEXT button and it will create that for you, but it will NOT appear in your contents.

Now click the COMPILE button and a new EPUB will be generated with your table of contents.

NOTE:  In most e-readers this table of contents does not appear as the first or second page. However, when the user selects the Table of Contents option it does appear.  This means it is available whenever the reader wishes to access it but it does not take up a valuable page in the front matter.

Non-Fiction books where multiple level headings are desired may NOT want to use this "Leave it to Jutoh" option. You will instead want to use the advanced option in order to select what you want included in your table of contents and navigation.  See this Jutoh documentation from the Jutoh creator for more information.

Then click on COMPILE button again to generate a new EPUB file for your book without the table of contents generated as a separate item.

No comments:

Post a Comment