When I run the following file through htlatex main html,4, the first (main) page has a table of contents that is too deeply nested. I only need part,chapter and section in my toc. The section page should have the subsection in it. How to get rid of the subsection in the first page?

\part {First part}
\chapter{A chapter}
\section{A section}
\subsection{A subsection}
\section{A section}
\subsection{A subsection}
  • Did you try with htlatex main html,3? – egreg Feb 14 '12 at 15:07
  • @egreg when I read your comment, I realized that my question was wrong. I only want to get rid of the subsection, when the level is the part level. – topskip Feb 14 '12 at 16:02

Appereance of toc entries can be controlled with \ConfigureToc. When its parameters are empty, this toc level will be not print. Try this private config file


Save as pg.cfg and run htlatex file "pg,4"

  • That is the appearance only. I need to limit the entries in the part,chapter and section pages. – topskip Feb 15 '12 at 10:59

What worked for me (although it doesn't answer the question directly) is the following in the config file:


This limits the listed items of a "part" page to chapter and section and on a "chapter" page to section.

The first page is not affected however, but I got rid of it anyway.

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.