如何在纯 TeX 中输入括号括起来的编号方程式?

如何在纯 TeX 中输入括号括起来的编号方程式?

基本上看起来像:

方程式

我试过了\eqalign,但右边不能有方程数字。我也试过了\eqalignno,但左边不能有括号。

答案1

我不会这么做。如果它是一个系统,它最多应该有一个数字;如果它是三个方程式,就不应该有括号。

\def\casesno#1{%
  \setbox0=\vbox{
    \tabskip=0pt
    \def\no##1{}
    \halign{$\displaystyle##$&&$\displaystyle{}##$\cr
      #1\crcr
    }
  }
  \openup2\jot
  \dimen0=-\wd0
  \advance\dimen0\hsize
  \advance\dimen0-2em
  \dimen0=.5\dimen0
  \def\no##1{&(##1)}
  \vbox{\tabskip=0pt
  \vskip-2\jot
  \hfill$\left\{
  \vcenter{\halign{%
    \hfil$\displaystyle##$&
    \hfil$\displaystyle{}##$&
    \hfil$\displaystyle{}##$&
    \hfil$\displaystyle{}##$&
    \kern\dimen0\hfil##\cr
    #1\crcr
  }}\right.\kern-\nulldelimiterspace$}
}

Some text that should wrap over two or more lines; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense.
$$
\casesno{
  a_0 & +a_1 & +a_2 & =1 \no{1}\cr
  a_0 & +\left(-{1\over2}+j{\sqrt{3}\over2}\right)a_1 & + \left(-{1\over2}-j{\sqrt{3}\over2})\right)a_2 & =0 \no{2}\cr
  a_0 & +\left(-{1\over2}-j{\sqrt{3}\over2}\right)a_1 & + \left(-{1\over2}+j{\sqrt{3}\over2})\right)a_2 & =0 \no{3}\cr
}
$$
Some text that should wrap over two or more lines; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense.
\bye

在此处输入图片描述

同样与 + 号对齐:

\def\casesno#1{%
  \setbox0=\vbox{
    \tabskip=0pt
    \def\no##1{}
    \halign{$\displaystyle##$&&$\displaystyle{}##$\cr
      #1\crcr
    }
  }
  \openup2\jot
  \dimen0=-\wd0
  \advance\dimen0\hsize
  \advance\dimen0-2em
  \dimen0=.5\dimen0
  \def\no##1{&(##1)}
  \vbox{\tabskip=0pt
  \vskip-2\jot
  \hfill$\left\{
  \vcenter{\halign{%
    \hfil$\displaystyle##$&     % a_0
    \hfil$\displaystyle{}##{}$& % +
    \hfil$\displaystyle{}##$&   % a_1
    \hfil$\displaystyle{}##{}$& % +
    \hfil$\displaystyle{}##$&   % a_2
    \hfil$\displaystyle{}##$&   % = c
    \kern\dimen0\hfil##\cr      % eqno
    #1\crcr
  }}\right.\kern-\nulldelimiterspace$}
}

Some text that should wrap over two or more lines; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense.
$$
\casesno{
  a_0 & + & a_1 & + & a_2 & =1 \no{1}\cr
  a_0 & + & \left(-{1\over2}+j{\sqrt{3}\over2}\right)a_1 & + & \left(-{1\over2}-j{\sqrt{3}\over2}\right)a_2 & =0 \no{2}\cr
  a_0 & + & \left(-{1\over2}-j{\sqrt{3}\over2}\right)a_1 & + & \left(-{1\over2}+j{\sqrt{3}\over2}\right)a_2 & =0 \no{3}\cr
}
$$
Some text that should wrap over two or more lines; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense; just add
some nonsense until we're up with this nonsense.
\bye

在此处输入图片描述

相关内容