# tex4ht: limit toc

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?

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\begin{document}
\part {First part}
\chapter{A chapter}
\blindtext
\section{A section}
\blindtext
\subsection{A subsection}
\blindtext
\section{A section}
\blindtext
\subsection{A subsection}
\end{document}

-
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

\Preamble{html}
\ConfigureToc{subsection}{}{}{}{}
\begin{document}
\EndPreamble


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:

\TocAt{part,chapter,section}
\TocAt{chapter,section}


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.

-