ePUB - Table of Contents

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
ajtthethird
Posts: 3
Joined: Fri Sep 05, 2008 3:55 pm

ePUB - Table of Contents

Unread post by ajtthethird »

Hi there,

I hope you are all keeping well!

Is there any way to set H&M8 to NOT output a Table of Contents at the start of an EPUB? I have to create a contents page as part of the book interior so I don't need the automatically created one.

At present I have to edit the EPUB in Oxygen and remove the line "<itemref idref="htmltoc" linear="yes"/>" from the spine toc in the file "content.opf" which is a bit of an annoyance.

Thanks,
Andrew
User avatar
Tim Green
Site Admin
Posts: 23183
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: ePUB - Table of Contents

Unread post by Tim Green »

Hi Andrew,

You can't do it actively at the moment and I'm not sure whether the output would still be a standards-compatible ePub if we provided the option for it. I'm checking with our developers on this. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Alexander Halser
EC-Software Support
Posts: 4105
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: ePUB - Table of Contents

Unread post by Alexander Halser »

Hi Andrew,

There is currently no option to remove the TOC page from the ePUB altogether in Help+Manual, but you can modify it. The actual TOC is inserted through a variable. H&M tests if the variable is present (though that's an option we could easily change to a simple warning instead of an error). However, you can simply make the TOC invisible and replace the HTML code of the contents page with your own content.
I have to create a contents page as part of the book interior so I don't need the automatically created one.
Alternatively you can use this template to style your TOC. See screenshot below. Would that make sense? I assume that you have some kind of TOC in your eBook. The TOC page created by H&M is pretty naked by default, but lets you style the page with CSS.

As for the file "content.opf", this is mandatory and required. It is hardly ever displayed, because this is the fallback option for ePUB 2.0 readers. A modern ePUB 3.0 reader ignores this file and displays your custom TOC/contents page instead. Older readers will use "content.opf" instead and they need it for navigation.
You do not have the required permissions to view the files attached to this post.
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Alexander Halser
EC-Software Support
Posts: 4105
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: ePUB - Table of Contents

Unread post by Alexander Halser »

You can actually do a lot to style your TOC in this template. It's even possible to add graphics if you need to. Here's an example that removes the bullets from the TOC, displays the top-level entries only and hides sub-chapters. Above the actual TOC I've placed a baggage image for illustration.
You do not have the required permissions to view the files attached to this post.
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply