[texhax] testing font encoding

Bob Tennent rdt at cs.queensu.ca
Thu Feb 23 16:08:13 CET 2017


I need to test in LaTeX whether the current font encoding is
OT1. My first attempt was

\makeatletter
\def\ot1@{OT1}
\ifx\f at encoding\ot1@ ... \fi
\makeatother

This didn't work even though \f at encoding generates OT1 so I
assumed that \f at encoding was not a "simple" macro.

I then tried

\edef\enc@{\f at encoding}
\ifx\enc@\ot1@ ... \fi

to force expansion but that didn't work either. Finally,
in desperation to try to understand what \ifx was doing, I
tried

\def\ot1@{OT1}
\def\enc@{OT1}
\ifx\enc@\ot1@ ... \fi

and that didn't work either. I'm now completely at a loss
over \ifx. Please help.

Bob T.


More information about the texhax mailing list