amsmath で \if@display は何に使用されますか?

amsmath で \if@display は何に使用されますか?

私は、答え\podが を使用して再定義される場合\mathchoice、ステートメント\if@display... \else...\fiは の最初の 2 つのオプションに使用されます\mathchoice。 はどういう意味ですか、また、ステートメント... ...@displayを使用する必要がある (または推奨される) のはいつですか?\if@display\else\fi

答え1

\if@displayは単一のトークンであり、\if @displayamsmath では次のように定義および文書化されています。

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

基本的にこれは amsmath の内部構造であり、他の場所での使用は想定されていませんが、通常の構造の代替として注意して使用される場合もあります\mathchoice

関連情報