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.

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?

share|improve this question
    
I found a solution: \HCode{<!--comment-->} but now I can't export to pdf any more. Is there a way to mask out this tex4ht command for other latex interpreters? –  raulix Jun 9 '11 at 22:03
3  
\def\HCode#1{} should disable the command. –  Caramdir Jun 9 '11 at 22:31
    
raulix: You should add that (with Caramdir's comment) as an answer so that others who look for this will see that it has an answer. –  Andrew Stacey Jun 10 '11 at 7:05
3  
you can also use ifpdf if you're using pdf(la)tex or ifxetex if you're using XeTeX. –  ℝaphink Jun 10 '11 at 7:52
add comment

1 Answer

\def\HCode#1{}
...
\begin{document}
...
\HCode{<!--comment-->}

It works. tex4ht writes the comment and pdflatex ignores the tag. Fine.

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