Wofür wird \if@display in amsmath verwendet?

Wofür wird \if@display in amsmath verwendet?

Mir fiel auf, dass in einem Teileine Antwortwobei \podmit neu definiert wird \mathchoice, wird die Anweisung \if@display\else\fifür die ersten beiden Optionen von verwendet \mathchoice. Ich habe mich gefragt: Was bedeutet das @displayund wann ist es notwendig (oder empfohlen), die Anweisung \if@display\else… zu verwenden \fi?

Antwort1

\if@displayist ein einzelnes Token, nicht aber \if @displayes ist in amsmath wie folgt definiert und dokumentiert:

%    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}

Grundsätzlich handelt es sich hierbei um eine interne Konstruktion in amsmath, die nicht für die Verwendung an anderer Stelle vorgesehen ist, obwohl sie manchmal mit Vorsicht als Alternative zur üblichen \mathchoiceKonstruktion verwendet werden kann.

verwandte Informationen