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?


1 Answer 1


\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}
\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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .