Sub-Numbering Placeholders Not Populating (ePub)

Hello. I’m using the auto numbering placeholder <$n> to number my acts (parts), and the sub-numbering placeholder <$sn> for my chapters. When I compile to a PDF, it works fine and the expected act and chapter numbers are displayed in the final document. But when I compile to an ePub or .mobi, the sub-numbering placeholder displays instead of the chapter number… both in the table of contents, and in the individual chapter headers. Not sure how to fix this.

I’m not running into the same problem immediately, so here is what I tried:

  1. First I set up the project so that my level one groups are parts, and their child documents are chapters.

  2. Open compile, and set the file type to ePub, and select the “Ebook” starter format in the left sidebar.

  3. I make the following Section Type & Layout assignments:

    Part → Part Number
    Chapter → Chapter

    (You may use the variants with titles, but that’s fine, we’re changing the numbering that will be used, anyway, and that’s the part that matters.)

  4. Double-click on the “Ebook” format in the sidebar to duplicate and edit it.

  5. In Section Layouts, select “Part Number”, and in the Title Options tab, replace Part <$t:part> with Part <$n>.

  6. For the “Chapter” layout, replace Chapter <$t:chapter> with Chapter <$sn> (the scene reset, in the suffix, can be left alone, but I’ll come back to that).

  7. I save the settings, and give that a test compile.

Here are the results I get, in the Calibre ebook reader component:

Earlier I mentioned a scene reset, which you would have seen as <$rst_scene>. If for some reason you cannot get <$sn> working the way you would like (it is a little picky, it only works with a plain <$n> to reset it, basically), then using named counters, like you saw demonstrated in the Ebook format, and resetting them at the right level, is how you can go beyond what this simple counter provides.

Examples:

  • On parts: <$n:part> / <$rst_chapter>
  • On chapters: <$n:chapter>
1 Like

That worked like a champ. Thank you SO much!

1 Like