[texhax] testing font encoding

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu Feb 23 16:51:35 CET 2017


Am 23.02.2017 um 16:08 schrieb Bob Tennent:
> 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

\documentclass{article}
\usepackage[T1,OT1]{fontenc}
\def\OTIenc{OT1}
\begin{document}

\makeatletter
   \f at encoding:
  \ifx\f at encoding\OTIenc
   is defined
  \else
   is not defined
  \fi

\fontencoding{T1}\selectfont
OT1:
  \ifx\f at encoding\OTIenc
  is defined
  \else
  is not defined
  \fi

\end{document}

Herbert



More information about the texhax mailing list