[texhax] How to test for existence of a macro?
D. R. Evans
doc.evans at gmail.com
Sat Aug 29 02:14:48 CEST 2009
I couldn't find this in the TeXbook, but perhaps I was just looking in the
How should I test cleanly for the existence of a particular macro?
The use case is that I have been using pdfTeX for quite some time, and
hence using commands of the form \pdfxxx with impunity. Now that I'm trying
to use tex4ht, the first thing that happens is that it halts with an error
as soon as it hits the first of those commands.
(Actually, I guess I'm making an assumption that the \pdfxxx commands are
equivalent to macros, even though they're built-in.)
Anyway, what I want to do is stuff like replacing:
with something logically equivalent to:
do something else;
Presumably to do this one creates:
and then sets it to true or false depending on whether (say) \pdfoutput is
defined... but I don't know how to perform the test to see whether
\pdfoutput is defined in a way that doesn't cause an error if it's undefined.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 260 bytes
Desc: OpenPGP digital signature
More information about the texhax