Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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"

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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