
iopartドキュメントクラスはiopart.cls
ファイル内で以下を定義します
\def\cases#1{%
\left\{\,\vcenter{\def\\{\cr}\normalbaselines\openup1\jot\m@th%
\ialign{\strut$\displaystyle{##}\hfil$&\tqs
\rm##\hfil\crcr#1\crcr}}\right.}%
amsmath
これはの環境の代わりでしょうかcases
? どのように使用すればいいですか? この定義はファイル内の他の場所には表示されません。
ケース環境を手動で実装する方法についてはすでに質問されていますここその投稿の古さを考えると、これがまだ必要かどうか疑問に思います。
答え1
この定義\cases
(環境ではありません) は、LaTeX カーネルの定義を変更したもので、LaTeX カーネルは基本的にプレーン TeX の定義と同じです。
ちなみに、\rm
やなどのコマンドは\bf
廃止されており、約 30 年前から非推奨となっています。
をamsmath
と一緒にロードできるようにする非常に簡単な方法があります。のとiopart
の結果を比較するために、トリックも使用します。iopart
\cases
amsmath
cases
\documentclass[10pt]{iopart}
% for using amsmath
\expandafter\let\csname equation*\endcsname\relax
\expandafter\let\csname endequation*\endcsname\relax
%%% This is just to compare the results
\let\iopartcases\cases
%%%
\usepackage{amsmath}
\begin{document}
In the following display I'll be using \verb|\cases| as
defined by \verb|iopart| in order to check the differences
\[
f(x)=\iopartcases{1 & abc \\ 0 & uvw}
\]
The following display will use \verb|cases| as defined by
\verb|amsmath| in order to check the differences
\[
f(x)=\begin{cases} 1 & abc \\ 0 & uvw \end{cases}
\]
Now we can decide which one to use.
\end{document}
この方法を好む場合はiopart
、環境を定義できますiopcases
(オーバーライドはしませんamsmath
)。
\documentclass[10pt]{iopart}
% for using amsmath
\expandafter\let\csname equation*\endcsname\relax
\expandafter\let\csname endequation*\endcsname\relax
%%% This is just to compare the results
\let\iopartcases\cases
%%%
\usepackage{amsmath}
\usepackage{mathtools}
\makeatletter
\newcases{iopcases}{\tqs}
{$\m@th\displaystyle##$\hfil}
{##\hfil}
{\lbrace}
{.}
\makeatother
\begin{document}
In the following display I'll be using \verb|\cases| as
defined by \verb|iopart| in order to check the differences
\[
f(x)=\iopartcases{1 & abc \\ 0 & uvw}
\]
The following display will use \verb|iopcases| as defined
above in order to check the differences
\[
f(x)=\begin{iopcases} 1 & abc \\ 0 & uvw \end{iopcases}
\]
Now we can decide which one to use.
\end{document}
薄いスペースが欲しいですかiopart
?
\makeatletter
\newcases{iopcases}{\tqs}
{$\m@th\displaystyle\,##$\hfil}
{##\hfil}
{\lbrace}
{.}
\makeatother
そしてあなたは得るでしょう
個人的な目的では使用しませんiopart
。数学の組版に基本的なツールを使用するためにトリックを必要としないクラスは他にもいくつかあります。