ePub Formatting – How To Create an Entry in an ePub’s Built-In Table of Contents That Does Not Appear Anywhere Else In The ePub Document

You’ll view an ePub’s built-In Table Of Contents whenever you open the ePub file up in an eReader. For example, if you open an ePub in the well-known eReader Adobe Digital Editions, you’ll see the built-in Table Of Contents in the the left pane in the eReader.

An ePub’s built-in Table Of Contents are always hierarchical. Typically chapter titles appear on the first level, subchapter titles appear on the second level, and so on.

The H1, H2, H3 header tags determine what level each TOC entry will assume. If you open up an ePub file in an ePub editor such as Sigil, you can view the XHTML code which creates the content of the ePub. Always keep in mind that an ePub document is really a mini web site, complete with pages of XHTML code, a folder containing images or links to images, and a folder containing a CSS style sheet.

Once you’ve opened your ePub file in an ePub editor such as Sigil, you will notice that chapter titles are usually enclosed within H1 header tags. Any text within an ePub file enclosed within H1 header tags will be assigned to a first-level position in the built-in ePub table of contents. Any text within an ePub file enclosed within H2 header tags will be assigned to a second-level position in the built-in ePub table of contents. The H3, H4, etc. headers follow the same pattern.

Once you have enclosed text inside of one of the header tags, you may apply a CSS style to that tag to achieve the styling and appearance that you want for that text.

In most eBooks, it is desirable to have entries in the ePub’s built-in TOC that do not appear within the text content of the ePub. For example, you may want a first-level TOC entry linked to the Title Page and called “Title Page” within the ePub’s table of contents. You probably do not want that same text – “Title Page” – to appear anywhere on the actual title page in the ePub document.

There is an easy and quick way to achieve this. You can make an object invisible on a page by simply setting the object’s CSS visibility characteristic to “hidden.” You can implement this by applying the following CSS class to any object.

.Hidden_Visibility {
visibility: hidden;
}

If you apply this CSS class to any H1-tagged text, you have created a first-level ePub TOC entry that will not show up on the page which holds that text.

1 thought on “ePub Formatting – How To Create an Entry in an ePub’s Built-In Table of Contents That Does Not Appear Anywhere Else In The ePub Document

  1. This was great … I found that I also had to add margin:0; padding:0; line-height:0; on pages where there was only an image.

    Thanks again

Leave a comment