Skip to main content
Participant
November 10, 2023
Answered

TOC issues when exporting to .EPUB

  • November 10, 2023
  • 2 replies
  • 864 views

Hi all, 

I have a textbook layout which was done in InDesign and has gone through the absolute ringer with revisions, in attempt to achieve a more ADA Compatible eBook. One of the last few issues left is that the Table of Contents is going awry when viewing the epub file. I am fairly new to using EPUBs, FYI, so no information is unnecessary here regarding this. 

 

When I open my EPUB file in Books (currently the default App for eBooks on my Mac), I click on the "Show Contents in List View" button in the top navigation bar, which I assume should be where the books TOC is listed, it shows a new entry for every single page, and the name of each entry is listed as whatever the file name is for those particular pages (see SS) (this same result is also being populated in the TOC within the reader where the eBook is hosted for sale–VitalSource). My interpretation of this is that the Books app is thinking that every page in the book is a new chapter marker for some reason. However, I have set up the Table of Contents within InDesign, and will include a SS of the settings used to populate the TOC. This filled in for me perfectly and is in place in my FM. Although, in addition to the Contents in List View page issue mentioned above, the TOC is not navigating to the Marked pages when I click the chapters in the TOC, in my exported EPUB. The cursor changes to the hand as if it's registering that its supposed to be a link, but doesnt go anywhere when I click the Chapter Title. If I click the page number associated with the Part/Chapter titles, it navigates me every time to the page immediately following the TOC.

 

Just for a little further back-info: Each chapter of the book is set up as a different ind file. The chapters are set up in an .indb and I have been using the "Export Book to EPUB..." function in the book panel to create the file we upload. I actually thought each chapter had a Section Marker listed in the Numbering & Section Options, however I guess I did not do this, as this cell is blank in each chapter (Could this be the reason for this issue happening?). *Also, as a slight sidebar: There are two Parts/Sections in the book–Part I containing Chaps 1–5, Part II chapts 6–12. When filling info for the Section Marker in Numbering & Section Options, would it be more ideal to simply list "Part #: [TITLE]" for each chapter here, OR list "Chapter #: Chapter Name" in each chapter? 

 

Please let me know if any of this is confusing or if you have additional questions for me, and of course, if you have any ideas to resolve the issue. I am waiting to hear back from VS's product team, but this is taking some time, and I thought I'd post my issue here for my fellow IND users here.

 

Thank you to anybody who can help!

This topic has been closed for replies.
Correct answer James Gifford—NitroPress

To start with, you need to be aware that almost no two EPUB readers are the same in how they interpret and render an EPUB book. Apple's reader is fairly good but has a number of nonstandard features and quirks. Unless you are building this book exclusively for Apple Books/iTunes, you may want to use a more "vanilla" reader like Calibre to proof your work to a more standard result.

 

That said, it's probably not the reader causing the TOC flaw, although it could be enabling it, if that makes sense. InDesign is very good at creating and exporting TOCs, even dual ones when a print version and a dynamic (reader) one are desired. I'd say there's something wrong with your TOC setup.

 

Create a new TOC 'style' in the TOC menu. (It's much more than a style, but that's Adobe's clumsy name for it.) Set up the headings you want, omit page numbers, don't bother assigning any styles, and make sure "Make text anchor" is checked. And then save that 'style' under a unique name like EPUB-TOC. (If you don't save a TOC style after every change, it will often revert in the next update — silently and frustratingly.)

 

As a LAST STEP before each export attempt, generate a new TOC using that style. When the place icon appears, either drag out a small text frame and then delete it, or hit Esc. There does not need to be any visible/text component for a dynamic TOC. A common fault is to generate a TOC, then do editing and so forth, which can move content around and break and delete TOC links, so be sure that if you've done any 'editing' at all to regenerate the TOC as that last step.

 

When you export,  be sure to select Multi Level TOC Style, and set the style selection below to your defined style.

 

If that doesn't solve your TOC problems, update us with the details and we'll try something else. 🙂

2 replies

Participant
November 10, 2023

UPDATE: With a little further research, and the help of this forum (https://community.adobe.com/t5/indesign-discussions/toc-text-anchor-not-found/m-p/12779395#M467282), I've resolved one of my issue's of the TOC entries not linking properly. In my case this was caused because the layers were hidden which contained the P styles in each chapter used to fill the TOC. Keeping these layers hidden will allow the TOC to auto fill, however will cause the error message "Text anchor not found" "Text anchor ... is missing", upon EPUB export, even when selecting the "Include text on hidden layers" in the TOC Settings. My text anchors were resolved by changing the P style to be Paper colored, and thus invisible to the eye. I am wondering, however if this will now cause additional issues with the above mentioned TTS functions, since there is additional text on the page still, even if it isnt visible. I haven't tested this out yet, but I may go ahead and go back into files and mark these text boxes (which contain the P styles for the TOC) as artifacts in the Object Export Options, just to be totally safe with the TTS.

James Gifford—NitroPress
Legend
November 10, 2023

Yeah, hidden layers are often a problem when exporting to EPUB (and sometimes PDF). The model is entirely visual, which works fine for print, but if you hide components that are needed to build the live structure of an EPUB... hilarity ensues.

 

That said... using 'hidden' tags for TOC linking is usually a poor choice for many reasons. Again, it's something you can get away with in print — although I think it's a hack technique there, too — but as ALL text ends up in an EPUB, it's just an avenue for clutter, breakage and mess.

Participant
November 10, 2023

Ideally, I would've set up one P style that worked for both for Part/Chapter numbers and headers. Unfortunately though, I was brought into the project to make the files more ADA Compatible after the initial layout was completed by someone else. So instead of going through the effort to redo/reduce the current Part #, Part Name, Chapt #, Chapt Name P styles that are currently used, I just went with the method of creating entirely new P styles, 1 for Part Openers and another for Chapter Openers. Styled that text to be white, which worked for populating the TOC properly, but am now worried this will effect whats read aloud when using TTS. Though, it wouldn't be the end of the world I suppose. If this 'invisible' text was read alou dby TTS, it would just be reading the Part or Chapter headers twice–once for the Header in the invisible text box and once for the visible Header. 

 

I do see that there are EPUB specific Object Export Options. Would this be resolved if in the dropdown for "Preserve Appearance from Layout", I selected "Rasterize Container" or "Rasterize Content"? I worry that selecting these options would then, again, have some negative effect on the TOC when exporting.

James Gifford—NitroPress
Legend
November 10, 2023

To start with, you need to be aware that almost no two EPUB readers are the same in how they interpret and render an EPUB book. Apple's reader is fairly good but has a number of nonstandard features and quirks. Unless you are building this book exclusively for Apple Books/iTunes, you may want to use a more "vanilla" reader like Calibre to proof your work to a more standard result.

 

That said, it's probably not the reader causing the TOC flaw, although it could be enabling it, if that makes sense. InDesign is very good at creating and exporting TOCs, even dual ones when a print version and a dynamic (reader) one are desired. I'd say there's something wrong with your TOC setup.

 

Create a new TOC 'style' in the TOC menu. (It's much more than a style, but that's Adobe's clumsy name for it.) Set up the headings you want, omit page numbers, don't bother assigning any styles, and make sure "Make text anchor" is checked. And then save that 'style' under a unique name like EPUB-TOC. (If you don't save a TOC style after every change, it will often revert in the next update — silently and frustratingly.)

 

As a LAST STEP before each export attempt, generate a new TOC using that style. When the place icon appears, either drag out a small text frame and then delete it, or hit Esc. There does not need to be any visible/text component for a dynamic TOC. A common fault is to generate a TOC, then do editing and so forth, which can move content around and break and delete TOC links, so be sure that if you've done any 'editing' at all to regenerate the TOC as that last step.

 

When you export,  be sure to select Multi Level TOC Style, and set the style selection below to your defined style.

 

If that doesn't solve your TOC problems, update us with the details and we'll try something else. 🙂

Participant
November 10, 2023

Thank you for your reply!

I'll give Calibre a try and see if I get any different results. Since this file did get the same results for the TOC within the reader where the eBook is hosted, I thought perhaps it could be something that would be consistent across numerous EPUB readers. 

 

I've saved my settings for my TOC as a preset TOC Style and am using this style now instead of [Default]. I followed your instructions to not include page numbers or styles, create a toc for the text box, and then delete. One problem I am encountering however, is that when I go to export my epub, when I go to select the TOC Style to use, there are no options listed other than [Default]. I've saved my files, my indb, and fully quit my indesign app. Upon reopening and attempting again to export and select the TOC Style, it is still only listing [Default] (SS attached). 

 

I still went ahead and exported with the default preset, but am still seeing that every page is marked in the contents list. 

 

Also PS regarding the SS attached–Disregard the blank space in the File location path. Just edited out my mac's name in the pic lol