I have a problem with footnotes and tex4ht. The following document has a wrong next pointer in subsection 1 and a bad previous pointer in subsection 3:
\documentclass{book}
\begin{document}
\chapter{chap}
\section{A}
\subsection{aa}
xxx\footnote{A}yyy
\subsection{ab}
text
\subsection{ac}
text
\end{document}
The command I use to generate html files is: htlatex main xhtml,4,next. To reproduce: open main.html and click on 1.1.1 "aa" and then click on "next" to go to 1.1.3 (instead of 1.1.2).
When running the above command a second time, everything works fine. What is the correct way to get a sane document at the first run? That is with a directory that contains only the .tex file and no intermediate files?