Does anyone know a way to detect whether one is running in pdfTeX
or Knuth's TeX
? I want to be able to conditionally include extra features when a document is being built using pdfTex
, but also support original TeX
as a fallback.
Something like
\ifdefined\pdfpagewidth
\pdfpagewidth 8.5 true in
\pdfpageheight 11 true in
\fi
would get the job done — however the above relies on the e-TeX
extensions and doesn't build on Knuth TeX
.
Thanks
Best Answer
Something like this?
Since
\csname foo\endcsname
expands to\relax
if\foo
is not defined, it's possible use\ifx....
to compare the command sequence to be equal to\relax
. This does not neede-TeX
at all.Compiling with
tex
gives the image below.