[tex4ht] tex4ht defines

Nasser M. Abbasi nma at 12000.org
Fri Jan 25 18:47:29 CET 2013


On 1/25/2013 9:14 AM, Zdzislaw Meglicki wrote:
> What are the tex4ht defines that I could use in
>
> \if...
> \fi
>
> constructs, to customize my tex file for tex4ht conversion?
>

This is what I use

     \if\texforht
       ...
     \else
       ...
     \fi

--------------------------------------
\documentclass[titlepage]{article}%
\usepackage{ifpdf}
\usepackage{hyperref}

\makeatletter
\edef\texforht{TT\noexpand\fi
   \@ifpackageloaded{tex4ht}
     {\noexpand\iftrue}
     {\noexpand\iffalse}}
\makeatother

\begin{document}

\ifpdf
         I am in pdf mode %  pdflatex code,will show up in pdf only
\else
       %  latex code, check if htlatex is loaded and use link only then
       \if\texforht
          \href{../../index.htm}{home} % show up in HTML only
       \else
        I am in latex mode %  shows up in dvi and .ps only but not in html
       \fi
\fi
\end{document}
------------------------------------

reference:
http://tex.stackexchange.com/questions/93852/what-is-the-correct-way-to-check-for-latex-pdflatex-and-html-in-the-same-latex

--Nasser


More information about the tex4ht mailing list