\ifHtml \HCode{...} \fi
However, this causes problems when running PdfLatex. Is there a way to
detect whether the tex4ht package is loaded so that we can ignore the
above segment when tex4ht is not used?
\ifTex4ht \ifHtml \HCode{...} \fi \fi
By the way, I did not declare tex4ht package in my tex file, Instead,
the tex4ht command itself will load in the package for me.
Thanks in advance!
-czwang
I believe it is a wrong approach to include translator-dependent code
within source files. Tex4ht offers an alternative route through local
configuration files. For instance, the command line
htlatex file "foo"
expects a private configuration file foo.cfg of the form
\Preamble{html}
\begin{document}
... private definitions and configurations ...
\EndPreamble
> However, this causes problems when running PdfLatex. Is there a way to
> detect whether the tex4ht package is loaded so that we can ignore the
> above segment when tex4ht is not used?
>
> \ifTex4ht \ifHtml \HCode{...} \fi \fi
e.g.,
\ifx\HCode\UnDef\else \HCode{...} \fi
-eitan
I use
\newif\ifhttex \ifx\HCode\undefined \httexfalse \else \httextrue \fi
quite successfully (along with \ifpdf)
Anthony
--
Anthony Williams
Software Engineer, Nortel Networks Optical Components Ltd
The opinions expressed in this message are not necessarily those of my
employer
I use the optional.sty package to do conditional code.
\usepackage{optional}
% \opt{dvi}{DVI specific text}
% \opt{html}{HTML specific text}
% \opt{pdf}{PDF specific text}
% \opt{ps}{PostScript specific text}
\newcommand{\ExplainOptions}{dvi = DVI output, html = HTML output, pdf
= PDF output, ps = PostScript output}
\AskOption
I then mark the pdf specific text with \opt{pdf}{pdf
specific}\opt{html}{html specific} ....
The down-side is that you will always have to specify which
conditional text you wish processed when you run latex.
--
/***************************************************/
/* Rakesh Vidyadharan */
/* Applications Specialist, Tribune Media Services */
/***************************************************/