Problem: Running this generates an extra TOC
htlatex foo.tex "htm,2" %-------------- \documentclass{article}% \usepackage{ifpdf} \usepackage{lipsum} \begin{document} \title{test toc} \author{me} \date{\today} \maketitle \tableofcontents \section{section 1} \lipsum{1} \subsection{subsection 1} text \section{section 2} \lipsum{1} \section{section 3} \lipsum{1} \end{document}
One solution is this:
htlatex foo_split.tex "htm,0" ------------------------------------- \documentclass{article}% \usepackage{ifpdf} \usepackage{lipsum} \begin{document} \title{test toc} \author{me} \date{\today} \maketitle \ifx\HCode\undefined \else \CutAt{section} % tell is to cut as if we did "htm,2", make \fi % section separate \tableofcontents \section{section 1} \lipsum{1} \subsection{subsection 1} text \section{section 2} \lipsum{1} \section{section 3} \lipsum{1} \end{document}
Another is (thanks to Radhakrishnan) is
htlatex foo.tex "html,2,notoc*" \documentclass{article}% \usepackage{ifpdf} \usepackage{lipsum} \begin{document} \title{test toc} \author{me} \date{\today} \maketitle \tableofcontents \section{section 1} \lipsum{1} \subsection{subsection 1} text \section{section 2} \lipsum{1} \section{section 3} \lipsum{1} \end{document}