6

I noticed that in part of an answer where \pod is redefined using \mathchoice, the statement \if@display...\else...\fi is used for the first two options of \mathchoice. I was wondering: what does @display mean, and when is it necessary (or encouraged) to use the statement \if@display...\else...\fi?

justin
  • 1,509

1 Answers1

7

\if@display is a single token, not \if @display it is defined and documented as follows in amsmath:

%    The straightforward \cs{ifinner} test to see if the current math
%    context is non-display, fails if, for instance, we are typesetting
%    a multiline display within an \cs{halign}, with the pieces going
%    into constructions like
%    \begin{verbatim}
%    $\displaystyle...$
%    \end{verbatim}
%    So we need a better test to find out if we are `in a display'. We
%    therefore create \cs{if@display}.
%
%    \begin{macrocode}
\newif\if@display
\everydisplay\@xp{\the\everydisplay \@displaytrue}
%    \end{macrocode}

Basically this is an internal construct in amsmath not intended for use elsewhere, although it can sometimes be used with care as an alternative to the usual \mathchoice construct.

egreg
  • 1,121,712
David Carlisle
  • 757,742