Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Newbie: TOC duplicating and HTML errors? (Related? Maybe not? Help!)

Community Beginner ,
Mar 07, 2025 Mar 07, 2025

I'm at the final step of my first-ever InDesign epub export and I'm running into a maddening issue. 

 

When I create my table of contents, it's pulling from a single header style, as shown here:

 

Siah_Clark_0-1741403154525.pngexpand image

 

The header style is only used at the beginning of each chapter. Nowhere else. 

 

Upon export, my epub is giving me the following error in Sigil: 

 

Siah_Clark_2-1741403714586.pngexpand image

 

I'm guessing this is related to the other part of my problem, which is that the table of contents in the exported epub is creating entries for every single page. Here it is in Adobe Digital Editions. 

 

Siah_Clark_1-1741403554074.pngexpand image

 

I have no idea what to do. I don't even know if these two problems are actually related, or if they're two separate issues. I've been following along with this tutorial: https://www.youtube.com/watch?v=xkRp7fyP6KM 

 

And I used this tutorial for the TOC specifically: https://www.youtube.com/watch?v=zRD6wHc14S0

 

Help very very appreciated! This book is for a client, so unfortunately I can't share files, but I am happy to screenshot any settings menus etc. if you tell me where to go. 

 

Learn how to automatically create a table of contents in Adobe InDesign using your paragraph styles. You will also learn how to use your paragraph styles to create leading dots in your table of contents. Become a channel member: https://www.youtube.com/channel/UCSyXRUw4nYVactx_5cwrpEA/join View ...
This video shows you step-by-step how to layout your book in InDesign for both print and digital. It's text only. I'll be doing another tutorial on image layout (this is because, when exporting an epub, images need to be anchored or they'll pop up at the end of the chapter instead of where you ...
TOPICS
EPUB , Import and export
430
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

Are you sure your TOC is setup correctly? Did you generate the TOC in InDesign or setup a TOC style, can you show your TOC page in InDesign.

 

What caught my eyes and maybe you have got it setup correctly, but the paragraph style names are confusing me.

are your paragraphs in the story called 20 Things Headers TOC? 

Your entry style is 20 Things Subheaders

EugeneTyson_0-1741424732808.pngexpand image

In my mind - the 20 Things Subheaders are the headings your story - and the 20 Things Headers TOC should be the entry style? 

 

Can you confirm the paragraph style names? 

 

Other than that @James Gifford—NitroPress is an ePub whiz and probably has more insight to the ePub side.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 08, 2025 Mar 08, 2025

Totally understand the confusion re: the naming - that's a result of banging my head against this for 4 hours yesterday trying everything I could think of, including creating totally new header styles (hence the TOC name,) etc. I am positive that all chapter headers are using the "20 Things Headers TOC" style - the whole header / subheader style thing comes from the TOC tutorial I was following. So the headers use the Header TOC style, and then are styled using the Subheader TOC syle when they're part of the TOC. 

 

As requested, here's the table of contents (chapter titles censored for client privacy.)

 

Siah_Clark_0-1741442322131.pngexpand image

 

A few more things come to mind as possibly relevant: 

  • As you can see from the screenshot above, the titles of many chapters are long. This caused problems by itself early on, because I was using full line breaks to arrange them on the page, which caused each header to be multiple entries. I had to go back through and use shift-enter for soft line breaks to keep this from happening, so now each entry is now coming through as one page reference. But I had to do a bunch of backspacing / removing the soft line breaks in the TOC on the page to make each title a continuous string. 
    • I do NOT think this is the cause of the "every page is TOC" issue, because pages are included in the epub TOC which are not included in the InDesign TOC (such as the title page.) 

 

Here's what my epub export settings look like. 

 

Siah_Clark_1-1741442955665.pngexpand image

 

You can see that the TOC is NOT set to be based on file names, but rather on the TOC style. (While I have saved my TOC style, it does not appear on the TOC Style dropdown in this particular menu.) 

 

I'm sure there's got to be something obvious I'm missing here, but I have no idea what it is. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

You need two styles to generate the body of the ToC.

20ThingsHeaders would be the style you are searching for, in order to gather a list.

Once found, a second style would be 20ThingsHeadersToC.

The second style dresses the text gathered by the first style in order for the list of chapters to look like a ToC.

Mike Witherell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 08, 2025 Mar 08, 2025

A few thoughts:

1. Make sure you are linking accurately to your TOC style when you export to EPUB. 

Screenshot 2025-03-08 at 10.08.26 AM.pngexpand image

 

2. Re: the Sigil HTML errors. You can very likely ignore that. Sigil's built-in checkers are not always up to date or are squawking about things that aren't actually errors. The true test of the validity of your EPUB is EPUB Checker. That is the only validator that you can trust. 

 

3. Finally, style sheet names. HTML and CSS rules are that style names cannot start with a numeral. InDesign will automatically put an "x" in front of that style name but this may be getting in your way, nonetheless. 

I hope this is helpful. You might consider this YouTube playlist instead of others for accurate, up-to-date help. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

There's too much to unpack and figure out here, so let's start with some simple, basic changes.

  • Rename all your styles to NOT begin with a number. As Laura Brady points out, it's somewhere between bad practice, confusing and technically faulty to export style names to HTML/EPUB with number-led style names.
  • Delete all your TOC definitions and any existing TOC you've generated.
  • Create a TOC-entry style, a simple one based on your Body text.
  • Create a new TOC 'style' using just that one heading style. It looks as if you've done everything else pretty much right, but be sure not to specify page numbers. Assign the TOC-entry style to it. (One not-uncommon mistake is to use the same style for the TOC entries as for the TOC targets, creating a loop in which the TOC lists its own entries as further entries... make sure the styles are sorted out for this!)
  • Be sure to save the TOC style under a defined name (Just "EPUB" is good enough.) But be sure to save this style every time you open the TOC panel for any further changes — TOC has a maddening glitch in that changes are used once and once only, to generate the next/current TOC, and then lost afterwards, unless you save the 'style' BEFORE you exit or generate the next TOC iteration.
  • In EPUB export, be sure to use Multi-Level TOC and specify your named TOC style. (If there's one error that jumps out here, it looks as if you have a named TOC style but then leave the export at [Default], which is both a fault in itself and a fault of using ANY InDesign default setting or style, ever.)

 

That should clear up the TOC issues.

 

As for EPUB errors... I deprecate the use of all legacy EPUB tools (and post-export modifications) and most things like validation for InDesign-generated EPUBs, and most flags, warnings, errors and hassles are more rooted in... useless fussiness than actual faults. The only truly valid passage is Export, review in a vanilla EPUB reader like Calibre or Thorium, and then upload to a sales portal such as KDP or Apple. There may be further steps generated by those checks, but in general if a book passes that simple road, fussy bits over this setting and that setting are irrelvant to real-world use.

 

(There is a monumental shift going on in the name of accessibility that is causing endless problems with validation and acceptance as the various players take their time about updating their standards in step with each other; if you're deeply concerned about accessibility and perfect validation, you have both a hard road to hoe and will have to use processes different from simple InDesign export. But, by and large, warnings about this jot or tittle or detail or setting do not get in the way of simple commercial production, upload and sale.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 08, 2025 Mar 08, 2025

🙄

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

Your screenshot above carefully presents and highlights a setting that is completely irrelevant to useful export or this conversation.

 

I remind you again, gently, that this is the InDesign forum, mostly populated by ID users who want to get their project done, and not acolytes avidly absorbing this week's micro-changes to the grossly outdated and contradictory EPUB standard. Deeply technical answers about standards and editing in Sigil aren't of much use to this audience, and nor are flatly off-target answers about ID.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 08, 2025 Mar 08, 2025

I do not have the time or inclination to engage with you, James. But I will say unequivocally: your advice is bad and is putting people at legal risk. The European Accessibility Act goes into effect in June 2025. Ebooks that don't meet the EPUB accessibility specification could be subject to fines as high as â‚¬7,500 per territory. All the work we've done to change how InDesign creates EPUBs is centered on accessibilty and on making better ebooks — better ebooks for all manner of readers. Disparaging that work shows me who you really are and what your interests are; i.e., you don't want your self-published and already out-of-date book that you flog in every signature to become (even more) irrelevant. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

Please take it off line.

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

I did, David. When the esteemed expert and I first clashed, a few weeks ago, I sent a long and humorous DM suggesting we could restart and be of mutual advantage to this forum. Her reply: "I don't have time to read that sh*t."

 

I have not engaged her once, since; I have made complimentary references to the suggestions she's made that I feel are in line with this forum and its users' needs.

 

She has, in fact, basically followed me around to dump  on my answers (which come from a completely different perspective on the field) and call me names  — mostly in ignorance and contradiction to what I've actually said or written. Her answers are either stratospheric code-tech, often incomprehensible to the workaday ID user, or (as above) that of a weak journeyman ID user, misleading where not simply unhelpful.

 

I'm as tired of this BS as everyone, but I will not be stalked, badmouthed, namecalled and have appropriate technical discussions derailed by someone who can't comprehend that not every EPUB author sleeps with a copy of the standard under their pillow.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

I would bring it up with Sil.

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 08, 2025 Mar 08, 2025

Does this look correct? I have removed the number entries from the beginning of all styles, as you and Laura advised. And I have also created a new, separate document specifically for Table of Contents (because I noticed the "table of contents" landmark in the exported epub was just going to the cover as well.) Finally, I went through and modified all files to make sure they all used the new, numberless styles in all locations.

 

Siah_Clark_0-1741458769262.pngexpand image

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

You shouldn't have to create a separate document for the TOC. For one thing, a TOC in the e-book itself can be seen as something of an anachronism; some authors like them, and I believe they have their place in dense, technical books where a TOC acts in part as a secondary index. But for your basic ten-chapter novel or narrative or the like... omit it from the visible pages. The dynamic EPUB/Kindle/reader TOC is much more useful and accessible.

 

If you do put the TOC in the pages, it's best to create one style for it and another for the dynamic TOC, just so you can fine-tune each for its purpose. And when you do, just put the TOC frame in the usual place among the front matter... but be sure to anchor it to prior text such as the title or copyright notice, otherwise the text will just "fall" to the bottom of the document. (The styling of the TOC can also be problematic; some readers insist on ugly blue-underline links no matter what styles you apply to them.)

 

If you don't place a visible TOC, you don't need to place the TOC frame at all. (I do a suspenders-and-belt move of placing the loaded cursor each time I get it, then deleting the result... just to make sure the process is completed. Probably voodoo, though.)

 

But as for the dynamic TOC  — it looks as if you have it correct. Export using MultiLevel/TOC and select that TOC style name to go with it. That should give you a working, reader-level, dynamic TOC.

 

And then we can move on to any next problems. 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 22, 2025 Mar 22, 2025

Sorry for the (very) long delay in reply. The client had other priorities come up, so this project got pushed to the backburner. 

 

I'm afraid I'm still having issues. I can't believe the table of contents of all things is what I've spent half my hours on this book just troubleshooting.

 

Here's what's happening now:

  • I have followed all previous instructions, recreating all paragraph styles as advised, etc. 
  • When I export the EPUB, I'm no longer getting the duplicated table of contents entries, so that's good at least. 
  • There is a new problem though. Two, actually:
    • The second-to-last chapter, which has the exact same header style, etc. as all the rest, and which appears in the TOC when regenerated, does not work in the TOC links in the EPUB's table of contents. All other TOC entries jump to that part of the book, but this one does not. I have no idea why. 
    • Bigger problem - the visible TOC pages in the EPUB don't actually work. If you click them, they just jump you to page 4 of the EPUB. The TOC pages in the file itself DO work except for the second-to-last chapter, but the ones you can actually see inside the book do not.
    • I read what you were saying about not needing a visible TOC inside the book, but I don't fully understand it. When I try exporting using multilevel TOC as you recommend, the only style that appears in the list is [Default]. Even though I have a TOC style saved, and it's the one I'm using for the generated TOC, it just doesn't appear in that list. 
  • One last problem, this one's NOT about TOC haha. When I export the EPUB, there are no line breaks between my paragraphs. The paragraphs go to new lines, but there's no space between them, if that makes sense. It doesn't resemble the way it's laid out in InDesign at all, which has large gaps between the headers and body text, and double-breaks between sections, etc. What could be causing this? 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2025 Mar 22, 2025

Okay... it sounds as if you might have some significant structural errors in your document. Those will have to be resolved before things like a TOC will generate correctly.

 

I don't see an answer to this: what EPUB reader are you using view the result? This is critical, as not al readers are equal and some are truly awful. Some of the faults could trace to using the wrong viewer.

 

TOCs: You need a solid grasp of how TOCs are created and managed to use them at this level of complexity. Put simply, you can define multiple TOCs under different "style" names, and all exist side by side in the document. They don't have to be placed/visible. For EPUB, once you have a TOC defined, it doesn't need to appear anywhere as long as you select it correctly for the export process (which will turn it into the dynamic, reader-based TOC). If you want that TOC, or another one, visible in the document, you have to create the style and then place it as a text frame, and all of the link and source options have to be correctly specified. (That's about as much as I can say in general.)

 

As for the document spacing issues, most properly defined spacing in InDesign exports to EPUB — but it can have some quirks such as being about half the defined value in the result. So one possibility is that you have fairly small spacing defined that is actually exporting, but "collapsing" to small values in the EPUB. But your description sounds as if something else is going on, maybe in parallel. A very basic point is that you cannot use soft returns/line returns in EPUB export except with some fairly significant limitations/caveats. Paragraphs have to be real paragraphs, ending in a paragraph return and with an assigned style defined. All kinds of things that look fine on screen and even in print are too "sloppy" and structurally faulty to export properly to EPUB. ALSO: never use multiple paragraph returns. Not at all in InDesign layout (it's very poor practice). Definitely not for EPUB export, as they are deleted in the export process. It sounds as if your spacing depends on extra returns, and not on properly defined space-below and space-above settings in the paragraph styles.

 

Maybe these are all minor things we can resolve with some further feedback. But I'm getting the sense that you don't have good mastery of proper layout in InDesign, and while you can get away with that for print/PDF, EPUB export demands absolutely meticulous, technically-perfect layout or you'll get... the kind of problems you're reporting.

 

Answers to the above questions and more details about your layout process will help move things forward here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 22, 2025 Mar 22, 2025

Yeah I definitely don't have that technical mastery haha - this is my first time really using InDesign for a project at all, so it's been entirely a learning process through the tutorials. And I'm realizing that those tutorials were woefully inadequate, because they definitely didn't break things down like the returns vs. paragraph styles, etc.

 

I'm using Adobe Digital Editions as my viewer. 

 

What you said about the returns is 100% what's happening, I can tell you without even looking. Been using double returns to make the spaces between, etc. That doesn't explain the lack of space between the headers and body text of each chapter, since those are using different text boxes entirely from one another, but I'm sure it's a similar issue happening there. 

 

Honestly I hate to say it, but I think I'll just need to start the whole thing over from scratch. It won't actually take that long, and trying to fix all the ways it's broken will probably be more time-consuming than just starting off right from the get-go. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2025 Mar 22, 2025

Okay. To start with, ADE is just about the worst document viewer on the market. (It's a half-finished effort at making a universal e-doc viewer that has many flaws and handles EPUB more poorly than any other reader I know of.) If you want to do serious EPUB development, the reader to use is Calibre (which comes as a set of e-doc tools, most of which I don't recommend, but the reader is as close to a plain, reliable EPUB viewer as we get). You can also install Thorium, whch should be a completely standards-based reader and is very good but has some persistent bugs that can mislead you during development. If your goal is KIndle publication, you'll want Kindle Previewer, which is essential to optimize books for that portal and is a fairly good EPUB proofing viewer as well. There are many others, including Apple's Books, but they start to drift away from the generic/vanilla model and introduce rendering issues of their own.

 

You're going to have to reformat your document beginning to end, using standard practice. No soft returns. No extra line returns. Every paragraph needs an assigned, unmodified style. Any spacing between them needs to use style-based space-above or space-below. (And all text overrides, like bold or italic, must be applied using defined character styles, not spot-overrides. Basically, never ever use spot overrides for anything (grab some text, apply a color, font, size, bold, etc.) You must use styles for everything.

 

There are good tutorials on all of these, from Adobe, Lynda, LinkedIn, CreativePro and others. The Adobe ones are always reliable if not necessarily the easiest to grasp and follow. But you have to avoid the tsunami of absolute crap on YouTube etc. — what isn't outdated is often idiosyncratic to limited to just plain idiotic. And that's for InDesign help; when it comes to EPUB/e-book info on the web, the complete garbage outnumbers the useful, current stuff by 100:1 or more.

 

But until you have a cleanly structured and formatted document, following ID best practices and some added points that apply to EPUB export (mostly, doubling down on being 'meticulous' without any shortcuts or patchwork), you aren't going to get to a successful EPUB export, TOC or no.

 

This forum exists to answer all those questions and help. Ask away, but start with some searches for things like "adobe indesign paragraph styles" and select only the results that lead to top-quality sources, almost none of which will be found on YouTube, Reddit or ChatGPT. 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2025 Mar 22, 2025
LATEST

And just an addendum, if you're going to reformat your doc: all content should be in one text flow, with any images or such anchored to preceding text. It's possible to have multi-story docs export to EPUB, but everything is greatly simplified if ALL content (other than a TOC, which has to be a separate text frame/flow) is in one text flow or story.

 

That is, if you have content broken up by multiple text boxes (to position chapter heads, sidebars, tables etc. as is sometimes done) those divisions will just add to the problems of getting an acceptable export. The cursor should travel from page 1, start of frame 1 to page last, item last without any breaks except across primary text frames.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2025 Mar 08, 2025

Are you sure you are not picking up the style used in a header/footer? 

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines