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

EPUB: What would cause this difference?

Community Beginner ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Attaching screenshots of a given chapter of a book; one in the Kindle app and one in the Apple Books app. In the Kindle, it shows both "Twenty-Two" above the title and then the number 22 prior to the chapter title. In Apple books, the numerical 22 isn't shown. Why would this be?

 

I'm trying to have the chapter numbers spelled out above the chapter title, but then in the TOC have the chapters numbered like:

 

1. [Chapter 1 title]

2. [Chapter 2 title]

 

This is a reflowable epub.

TOPICS
EPUB , How to

Views

509
Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jun 10, 2022 Jun 10, 2022

Well, my first six tricks didn't work. I am tempted to say it can't be done, at least not as a straightforward setup.

 

The only solution I see is (1) use no autonumbering at all and then (2) edit toc.xhtml in the exported EPUB. I try to avoid that kind of file surgery for many reasons but see no other easy solution.

 

Votes

Translate
Community Expert ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Are these from the same EPUB, or separate exports?

 

Don't auto-number the chapter headings in any way. Use auto-numbered TOC styles.

 

Votes

Translate

Report

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 ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Same epub file, different reading apps.

 

I've tried setting the TOC style to auto-number, but the TOC on the readers seems to ignore it. 

Votes

Translate

Report

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 ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Hmm. I was sure I had accomplished something like that, but a quick test shows both Kindle Previewer and Thorium discard the TOC numbering.

 

The Apple reader is anomalous in many ways (vs. most EPUB readers and Kindle), so I am not surprised it shows the numbers when the others don't.

 

There are a lot of options including things like conditional text. I will tinker with it.

 

Votes

Translate

Report

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 ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

Well, my first six tricks didn't work. I am tempted to say it can't be done, at least not as a straightforward setup.

 

The only solution I see is (1) use no autonumbering at all and then (2) edit toc.xhtml in the exported EPUB. I try to avoid that kind of file surgery for many reasons but see no other easy solution.

 

Votes

Translate

Report

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
New Here ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

Just coming to ask if this answer (can't be done without editing the html) still holds. I've been desperately searching for a way to add a chapter number to a chapter title in my EPUB TOC as above without having to edit the code.

 

The last book I did had 51 chapters. The chapter numbers used their own paragraph style, and the chapter names used their own paragraph style. (Between the number and the name there was a pull quote -- all three elements were styled differently. The author did NOT want to lose this formatting order in the ebook. So the number and the name could not on the same line/be the same paragraph style.)

 

Exporting the EPUB TOC resulted in having the chapter number (level 1) on its own tab, and then the chapter name (level 2) hidden until the number was clicked on -- and obviously, they're both really level 1s. But that results in just have separate little tabs for number and name. . . . 

Re-adding allllllll of those numerals to the exported EPUB file by hand, every time I re-exported it and thought it was "final," (oh, if only!) was soooo tedious.

 

I'm working on another book now. Very similar layout. Client likes having the chapter numbers and chapter names styled differently. This does not seem unreasonable and looks GREAT. But again -- there are FORTY chapters. I'm dreading the EPUB export, and having to number all of those names by hand, every single time I think I've got everything finalized, but don't. . . . 

Is there any hope?

 

 

Votes

Translate

Report

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 ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

The short answer is that there isn't really any good method that will work, export after export and across the maximum range of readers, other than hand-numbering a single chapter heading paragraph. It really only takes a few minutes in a final pass; while there are other approaches, most take a fair amount of setup and management and may not result in a "tidy" TOC in the EPUB. The interaction of ID's auto-numbering etc. and what the EPUB/TOC structure expects is not reliable, so time spent on a simple approach is likely saved in elaborate setup, management, fixes, etc.

 

I'd also make a case that numbering chapters in a dynamic TOC is... unnecessary, more of a holdover from print TOC layout and other conventions, than it is any asset. But, you know, authors.

 

But you're on the right road by avoiding editing the export EPUB, which is archaic and counterproductive in today's production world. The correct approach is to find the method within ID that achieves your aims with the least "wasted" effort — and there always is one, IME.

Votes

Translate

Report

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
New Here ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

Well, I think I do need to edit the EPUB, then (unless I'm misunderstanding) -- he absolutely does NOT want the chapter number on the same line as the chapter name on the ebook pages themselves, only in the TOC.

 

I tried a workaround where I did add a number before the chapter name on the page itself -- then applied a character style only to that number, making it white, or having "none" for a color, or giving it 0% transparency, hoping it would NOT show up on the ebook page but WOULD show up for the TOC. But Kindle Previewer would not let the number be white/none/transparent. It would display the number as a "readable" shade of gray, maybe assuming I'd made a mistake in trying to make it invisible. . . .

 

Might there be a way to edit just that character style in the exported EPUB to tell the ereaders NOT to give it any black at all, maybe? That would be a much easier edit than having to renumber 40 chapters in the EPUB code, every time I want to re-export the book. . . .

 

I'm a noob, so adding these chapter numbers to the code is the first and only time so far I've manually edited EPUB code. . . .

Votes

Translate

Report

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 ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

There are a couple of ways to achieve the goal, then.

 

Try using a soft return between the number and title, with a hard space after the number. I am not sure how the TOC will process the soft return unless you check the box to strip them from the result (which is generally the right option anyway.)

 

You could also put an invisible chapter number in front of the chapter title — use 1pt type and [None]  coloration with a 1pt hard space following; optionally, squish the number horizontally to minimize its effect on layout; adjust the paragraph left spacing as needed. (ETA: a hint here: use a character style you can switch from [None] to magenta or some such, for easier editing and review.)

 

I have many reasons for objecting to editing EPUBs, but the first and foremost is that, especially when exporting from ID, you have to repeat the edits — flawlessly — every single time you update. Setting up the ID doc and export to do the work for you so that the EPUB is final as exported is... simply the modern, correct way to do it.

 

The other method is to get authors to accept that e-books cannot be exact replicas of print, nor usually should be — sometimes because it involves ridiculous amounts of work for trivial results, and sometimes because it just can't be done. But (as a writer, editor and publisher myself) I know most authors, especially those in the current DIY spectrum, have their own ideas about esthetics and practicality. After all, they read it somewhere. 😛

Votes

Translate

Report

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
New Here ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

Yep -- almost all of my authors are first-time self-publishing, and although I try to break some news gently, it can result in some people being pretty frustrated with me when I tell them they cannot use italicized and bolded French Script in their ebooks, just because they "were able to do it in Word" [sad face]. Le sigh. But this chapter numbering thing comes up again and again. And yes, having to go in and (flawlessly) add 51 chapter numbers to the code several times over (every time I need to change something in another part of the book, and need to re-export) would be delightful to avoid. . . .

I'm going to try putting the invisible chapter number in at 1pt with "none" coloring (as mentioned, I tried assigning it paper or none or transparent color before, and Kindle Previewer kept defaulting to a readable gray) -- but I didn't try making it super-duper tiny. Will report back, and thank you so much.

Votes

Translate

Report

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 ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

You're right that it's a perennial request, and not always a faulty one. But other than simple body text to TOC text, there aren't any easy solutions to get from one to the other, allowing for the overall structure differences. The invisible text ruse has a long history in things like PDF TOCs and other uses, and with a few setup styles can be managed pretty easily. (A more advanced technique would be to use a very narrow, brightly colored font for editing etc, switched to the "invisible" one for final output. You can do that in a couple of different ways, including having two style setups you import into the working document.

 

Making a note to experiment with better approaches. 🙂

Votes

Translate

Report

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 ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

Just to complete/update this discussion, I tried three variations and all worked — with a caveat.

 

EPUB NUMBERED TOC method 1

  • Use separate paragraphs/para styles for the Chapter number and Chapter title. Style as preferred.
  • Include the Chap Number as a Level 1 TOC entry, and the Chap Title as a Level 2 TOC entry.
  • Result will be a staggered EPUB TOC of:
    • NUMBER
      • TITLE
    • NUMBER
      • TITLE

...which ain't bad, is simple to implement, and should allow maximum styling options in both print and EPUB.

 

EPUB NUMBERED TOC method 2

  • Use a single paragraph/para style for the Chapter Number/Title.
    • Separate the two with a hard space OR a soft return.
    • Apply a Char Style to the Chapter Number if desired.
  • Include the Chapter Heading style as a Level 1 TOC entry.
  • Result will be both elements on one line:
    • 1  Chapter One
    • 2 Chapter Two

...works well, easy management, limits print styling just a bit.

 

EPUB NUMBERED TOC method 3

  • Use separate paragraphs/para styles for the Chapter number and Chapter title. Style as preferred.
    • Put a second chapter number + hard space at the beginning of the Chapter Title line.
    • Use a character style to make this text (nums+space) tiny and either [None] or [Paper] color.
      • Use size, horizontal scale, etc.
    • Adjust Chapter Title left spacing to compensate as needed.
  • Include the Chap Title as a Level 1 TOC entry.
  • TOC will include number, space and title.
  • CAVEAT: the numbering text will appear in the EPUB body unless a CSS style is applied to minimize them:Something like:
    • span.InvisNums {
      color:white;
      font-size:0;
      display:none;
      }
      
    • Only the display element may be needed; experiment with your layout.
  • This should result in a linear TOC display as with method 2.

 

ETA: method 4

  • Auto-numbering the Chapter Title style works fine, too; just set up the style to be compatible with the dynamic TOC, and maker sure to set the "include entire paragraph" mode in the export menu.

Votes

Translate

Report

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
New Here ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

YES! We both came to pretty much the same end with the same method (3). (I was off experimenting and finally got it, only to see yours, almost the same.)

 

I made the Character Style color "[Paper]" and size "0.1" (the smallest INDD will let you make the size) and this resulted in not having to open or tweak the CSS at all after export. Results in Kindle Previewer, iBooks, and Calibre viewer of the EPUB body all look good -- at least, *I* can't see the chapter number, at all. Maybe I'm just old. . . .

 

All my previous experiments with trying to apply paper/none/transparent to make the character style invisible always resulted in the ebook body displaying a tiny gray number anyway -- but I always had the size set to "1" not "0.1" before. So I think perhaps it's the "0.1pt" size that might be the key to exporting this without having to actually open the EPUB CSS after exporting.

 

Thank you SO much for your help. This literally makes my day! 

Votes

Translate

Report

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 ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

No problem; it's always fun to get a new challenge and work through the options that conform to my no-edit workflow. Note, though, my last entry — I made auto-numbering work just fine. You can use a character style for the number, manually break it with a soft return if you want them stacked on the chapter page, and use two TOC definitions to get what you like in both print and the EPUB export. Can't find a glitch in it, so you might try it to avoid the tedious bottle-of-wine hand numbering. 🙂

Votes

Translate

Report

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
New Here ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

Can I control the "space after" the chapter number if it needs to be different than the space after the chapter name that way (with just a soft return), though?

 

(Also: I'd thought I'd had that pull quote after the chapter number [as I'd mentioned in my first message here], but it's actually after the chapter name.)

 

Screenshot 2025-02-15 at 1.14.26 PM.png

 

Votes

Translate

Report

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 ,
Feb 15, 2025 Feb 15, 2025

Copy link to clipboard

Copied

All four iterations need to be styled and managed separately, and then in concert. No small trick.

 

If you want a lot of control over the printed page, the two paragraph approach might be best. It gives you unlimited control on the print page but limits you to the two-line TOC display.

 

The single-Para Style, soft-return plus Char Style method means you have to juggle line spacing and then spacing below on the print page, which should be do-able. Leading is controlled, more or less, by the following paragraph, so if you have 36pt leading to separate the number and title, then 14pt Body text following will be as close as any bottom/top spacing allows.

 

This is 24/48 for the auto-numbered heading, with a following em space and 1pc space below, and 12/14 with 6pt bottom spacing for the Body:

JamesGiffordNitroPress_0-1739655124207.png

 

Seems like that should get you where you want... or did I miss something?

Votes

Translate

Report

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
New Here ,
Feb 16, 2025 Feb 16, 2025

Copy link to clipboard

Copied

LATEST

Awesome -- thank you so much. I'm going to try this on my current project (still waiting for manuscript revisions, so it's actually a ways out) but am very excited. Thanks!

Votes

Translate

Report

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