At exporting a LaTeX file to HTML via tex4ht I have to write some HTML comments to the HTML source. So I would like to write the HTML code in the LaTeX file and let tex4ht export it directly. How can I achieve this? Are there some special LaTeX commands to do this?
Asked
Active
Viewed 1,514 times
6
Display Name
- 46,933
raulix
- 159
1 Answers
6
\def\HCode#1{}
...
\begin{document}
...
\HCode{<!--comment-->}
It works. tex4ht writes the comment and pdflatex ignores the tag. Fine.
raulix
- 159
-
To get this to work with both
pdflatexandhtlatexI needed to use\ifpdf\def\HCode#1{}\fi. – Peter Grill Oct 01 '14 at 18:09
\def\HCode#1{}should disable the command. – Caramdir Jun 09 '11 at 22:31ifpdfif you're usingpdf(la)texorifxetexif you're using XeTeX. – raphink Jun 10 '11 at 07:52