It appears that the content inserted via \AtBeginDocument is being ignored by htlatex. Is there a workaround to this other than not using \AtBeginDocument?
To reproduce save the MWEs below and run
htlatex <filename>
The only difference between the two is that one uses \AtBeginDocument{\Dedication} and the other has \Dedication in the main body of the document.
Using \Dedication in the main body produces
<!--l. 9--><p class="indent" > This is dedicated to me as I wrote it!! :-)
<h2 class="chapterHead"><span class="titlemark">Chapter 1</span><br /><a
id="x1-10001"></a>First Chapter</h2> Text for first chapter.
</body></html>
whereas using \AtBeginDocument{\Dedication} produces
<!--l. 11--><p class="indent" >
<h2 class="chapterHead"><span class="titlemark">Chapter 1</span><br /><a
id="x1-10001"></a>First Chapter</h2> Text for first chapter.
</body></html>
Note that the dedication text is missing.
References
Code: Dedication
\documentclass{book}
\newcommand*{\Dedication}{%
\clearpage
This is dedicated to me as I wrote it!! :-)
}
\begin{document}
\Dedication
\chapter{First Chapter}
Text for first chapter.
\end{document}
Code: \AtBeginDocument{\Dedication}
\documentclass{book}
\newcommand*{\Dedication}{%
\clearpage
This is dedicated to me as I wrote it!! :-)
}
\AtBeginDocument{\Dedication}%
\begin{document}
\chapter{First Chapter}
Text for first chapter.
\end{document}