Related question tex4ht: limit toc
I give up trying things. This is too hard.
I have this document
\section A
\section B
\subsection B.1
\subsection B.2
\section C
I want one main TOC, but also want TOC for each section that includes its subsections. I can break the document to 2 levels using htlatex. Hence the main level will have this toc
section A
section B
subsection B.1
subsection B.2
section C
then when clicking on section B link, it open a new page as expected, where now all the sections B.1 and B.2 are in that one html page as expected. but I want this page to have another TOC in it as well, since it has many subsections there. So I need a TOC like this
section B
subsection B.1
subsection B.2
on its own HTML page. But now there is no such TOC there. there is only one main global TOC on the first HTML page.
This is the command I use
htlatex foo.tex "htm,2"
I also tried config file with \ConfigureToc{chapter}{section}{}{}{}
in it. But I get only one TOC.
foo.tex:
\documentclass[]{article}%
\begin{document}
\tableofcontents
\section{A}
\section{B}
\subsection{B1}
\subsection{B2}
\subsection{B3}
\section{C}
\end{document}
foo.cfg:
\Preamble{xhtml,mathml,NoFonts,ext=htm,charset="utf-8"}
\ConfigureToc{chapter}{section}{}{}{} %?
\begin{document}
%\TocAt{chapter,section} ?
\EndPreamble
command:
htlatex foo.tex "nma.cfg,htm,2" " -cunihtf"
also tried
htlatex foo.tex "nma.cfg,htm,3" " -cunihtf"
Any idea how to make a TOC in each separate HTML page?