I'm working on an ebook and i'm trying to make a main toc at the beginning like

1. chapter 1
    1.1 section 
    1.2 section
2. chapter 2

and minitocs at every chapter like

1.1 section
   1.1.1 subsection
1.2 section

the "minitocs" work fine with


and the maintoc works almost fine with


but the sections go 1,2,3,4 instead of 1.1,1.2,1.3,1.4. I somewhere found the config.cfg

      {\tocNesting{1}\HCode{<li>}}{ }{}{ }
      {\tocNesting{2}\HCode{<li>}}{ }{}{ }
      {\tocNesting{3}\HCode{<li>}}{ }{}{ }
      {} {\tocNesting{0}} {} {} {}

      \expandafter\ifx \csname level#1\endcsname\relax
          \ifnum #1>0 \HCode{<ul>}\fi
          \expandafter\def \csname level#1\endcsname{\HCode{</ul>}}
      \c=#1 \advance\c by 1
        \csname level\the\c\endcsname
        \expandafter\let \csname level\the\c\endcsname\relax
        \advance\c by 1
      \ifnum \c<10   \repeat

now the numbering is correct, but subsections are also printed (which should be an easy fix i guess?) and in some epub-viewers i get an error message like "wrong tag, expected <\li>". Is there a way to configure the main toc to achieve what i want, without affecting the minitocs?

And another question: is it possible to include list of figures and list of tables in each chapter in tex4ht? (like minilof and minilot)


It seems that you generate Ebook in the Epub 3 format. It requires table of contents in a specific format, where numbered html list is used. It interfered with the section numbering explicitly added by tex4ht, so I disabled the section numbering and used only numbers added by the reading application. It is possible to revert this behavior with the following configuration:

\Css{nav\#toc ol{list-style: none;}}

The NavSection configuration takes care of the HTML list, in the original version it also suppressed the section numbering. The \Css command disables the HTML numbering for TOC.

This is the result:

enter image description here

Regarding your last question, it should be possible, but it would be better if you could to post a new question with a full MWE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.