My book does not have numbered chapters, and it is typeset correctly, but in the ncx table of contents TeX4ebook provides the chapter number 0 before chapters in the main matter only. Here is my MWE:


\usepackage{titletoc}   %fails if commented out
\setcounter{secnumdepth}{-2}%   don't number parts or anything else

This is the preface.

A chapter

Another chapter

No chapter number here, either


And here is the .cfg file:

  \ConfigureMark{chapter}{} %has no effect either way

"Preface" and "Backmatter" have no zero put in front in the ncx TOC, but "One" and "Two" do.

One thing I note as well is that there is a blank page at the beginning of the ebook, presumably because ebook readers put a page break between files. This is not a problem for me (and maybe not for anyone else) since my book has cover, copyright etc up front, but I just thought I'd mention it. Seems like it might be hard to "fix" and probably not worth it.

Many thanks, as always!

1 Answer 1


ncxtable is printed using complicated customized \tableofcontents. I didn't realize that I have to deal with missing sectioning numbers when secnumdepth counter is used. I updated tex4ebook with some tests for this case and it should work correctly on your file now:

    <navPoint id="navPoint-1" playOrder="1">
      <content src="samplech1.html#x3-2000" />
    <navPoint id="navPoint-2" playOrder="2">
      <content src="samplech2.html#x4-30000" />
    <navPoint id="navPoint-3" playOrder="3">
      <content src="samplech3.html#x5-40000" />
    <navPoint id="navPoint-4" playOrder="4">
      <content src="samplech4.html#x6-50000" />

Your configuration with \ConfigureMark can't work because it is used in sectioning commands, not in table of contents.

Regarding blank file, this is because it is because you have no text outside chapters and sections, which are all extracted to standalone files. So this is the main file, from which all information is cut off. You can add some text here if you place it before first \chapter command. if you've used \maketitle, title page would be placed here.

  • thanks again so much for your help! I will try this out on my full project.
    – Nat Kuhn
    Oct 27, 2014 at 21:34
  • @NatKuhn you are welcome. there is lack of testers of tex4ebook, so I am actually happy when I can fix some deficiencies which I wouldn't find otherwise
    – michal.h21
    Oct 27, 2014 at 21:38
  • Thanks @michal.h21. I have a series of TeX4ebook questions which will be coming up, I guess the best thing is just to keep posting them here?
    – Nat Kuhn
    Oct 27, 2014 at 22:38
  • @NatKuhn sure, post it here, as it may be useful also for other users
    – michal.h21
    Oct 27, 2014 at 22:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .