3

This MWE properly displays subsections in the TOC but when I create an epub with tex4ebook -l main.tex the TOC only goes as deep as the sections. How can I make it include subsections?

\documentclass{memoir}

\begin{document}

\tableofcontents

\chapter{Chapter 1}
\section{Section 1.1}
\subsection{Subsection 1.1.1}
\subsection{Subsection 1.1.2}
\section{Section 1.2}
\subsection{Subsection 1.2.1}

\chapter{Chapter 2}
\section{Section 2.1}
\subsection{Subsection 2.1.1}
\subsection{Subsection 2.1.2}
\section{Section 2.2}
\subsection{Subsection 2.2.1}
\subsection{Subsection 2.2.2}

\end{document}

enter image description here

1 Answer 1

3

It is in line with Memoir's behaviour, which doesn't include \subsections in TOC either. You can request them with this config file:

\Preamble{xhtml}
\Configure{tableofcontents*}{chapter,section,subsection}
\begin{document}
\EndPreamble

This configuration lists types of sectioning commands that should be listed in \tableofcontents. If you want to include starred versions of sections, use like prefix, for example likesection.

This is the resulting TOC:

enter image description here

Note that subsection numbers aren't included, because these are not saved in TOC metadata by Memoir.

You must log in to answer this question.

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