如果我比较下面的两个等式,括号和案例第一行之间的空间
(-f_{0}) 不同。我知道如果我将 \hspace{-0.1cm} 放在
第二个方程,我可以调整额外的空间,但有没有根本的方法可以消除空间
当我开始时制作alignedat
的&
?
或者,您可以建议一种完全不同的方法来输入我想要的方程式。
\begin{equation*}
(G^{*} \vec{x}^{*})(\vec{w}^{*})=
\left\{
\begin{alignedat}{3}
&-f_{0}^{*}(\vec{x}_{0}^{*})&&-(f_{1}^{*} \upsilon_{1}^{*})(\vec{x}_{1}^{*})-\cdots-(f_{m}^{*} \upsilon_{m}^{*})(\vec{x}_{m}^{*}) \\
&&&\text {if } \vec{u}^{*} \geq \vec{0} \text { and } \vec{x}_{0}^{*}+\cdots+\vec{x}_{m}^{*}=\vec{x}^{*}, \\
&-\infty &&\text {otherwise}.
\end{alignedat}\right.
\end{equation*}
\begin{equation*}
(G^{*} \vec{x}^{*})(\vec{w}^{*})=
\left\{
\begin{alignedat}{3}
-f_{0}^{*}(\vec{x}_{0}^{*})&&-(f_{1}^{*} \upsilon_{1}^{*})(\vec{x}_{1}^{*})-\cdots-(f_{m}^{*} \upsilon_{m}^{*})(\vec{x}_{m}^{*}) \\
&&\text {if } \vec{u}^{*} \geq \vec{0} \text { and } \vec{x}_{0}^{*}+\cdots+\vec{x}_{m}^{*}=\vec{x}^{*}, \\
-\infty &&\text {otherwise}.
\end{alignedat}\right.
\end{equation*}
答案1
由于您无论如何都需要选择对齐点,因此我建议采用不同的方法,即说明对象的所需宽度(默认 3em):
\documentclass{article}
\usepackage{amsmath}
\renewcommand{\vec}[1]{\mathbf{#1}}
\newcommand{\splitcase}[2][3em]{%
\makebox[#1][l]{$\displaystyle#2$} &
\settowidth{\dimen0}{$\displaystyle#2$}%
\addtolength{\dimen0}{-1em}%
\hspace*{\dimen0}%
\\
}
\begin{document}
\begin{equation*}
(G^{*} \vec{x}^{*})(\vec{w}^{*})=
\begin{cases}
\splitcase{
-f_{0}^{*}(\vec{x}_{0}^{*})
-(f_{1}^{*} \upsilon_{1}^{*})(\vec{x}_{1}^{*})
-\dots
-(f_{m}^{*} \upsilon_{m}^{*})(\vec{x}_{m}^{*})
}
&\text{if $\vec{u}^{*} \geq \vec{0}$ and
$\vec{x}_{0}^{*}+\dots+\vec{x}_{m}^{*}=\vec{x}^{*}$},
\\
-\infty &\text{otherwise}.
\end{cases}
\end{equation*}
\begin{equation*}
(G^{*} \vec{x}^{*})(\vec{w}^{*})=
\begin{cases}
\splitcase[5em]{
-f_{0}^{*}(\vec{x}_{0}^{*})
-(f_{1}^{*} \upsilon_{1}^{*})(\vec{x}_{1}^{*})
-\dots
-(f_{m}^{*} \upsilon_{m}^{*})(\vec{x}_{m}^{*})
}
&\text{if $\vec{u}^{*} \geq \vec{0}$ and
$\vec{x}_{0}^{*}+\dots+\vec{x}_{m}^{*}=\vec{x}^{*}$},
\\
-\infty &\text{otherwise}.
\end{cases}
\end{equation*}
\end{document}
答案2
我不会对第一个方程的设置做太多改动,除了 (a) 确保-
数学行开头的符号排版为一元符号,(b) 更改\begin{alignedat}{3}
为\begin{alignedat}{2}
,以及 (c) 在第 2 行和第 3 行之间留出更多空白。是否使用箭头重音或粗体矢量在很大程度上取决于个人喜好;如果使用箭头方法,请确保在上标符号前留出一些空格*
。
\begin{cases} ... \end{cases}
如果使用\left\{ ... \right.
\documentclass{article}
\usepackage{amsmath} % for 'alignedat' env and '\text' macro
\usepackage{bm} % for '\bm' macro
\begin{document}
\begin{align*}
(G^{*} \vec{x}^{\mkern1.5mu*})(\vec{w}^{\mkern1.5mu*})
&= \left\{
\begin{alignedat}{2}
&{-}f_{0}^{*}(\vec{x}_{0}^{\mkern1.5mu*})
&&-(f_{1}^{*} \upsilon_{1}^{*})(\vec{x}_{1}^{\mkern1.5mu*})
-\dots-(f_{m}^{*} \upsilon_{m}^{*})(\vec{x}_{m}^{\mkern1.5mu*}) \\
&&&\text{if $\vec{u}^{\mkern1.5mu*} \geq \vec{0}$ and
$\vec{x}_{0}^{\mkern1.5mu*}+\dots+\vec{x}_{m}^{\mkern1.5mu*}
=\vec{x}^{\mkern1.5mu*}$}, \\[1ex]
&{-}\infty
&&\text{otherwise}.
\end{alignedat}
\right. \\ % end of first equation
(G^{*} \bm{x}^{*})(\bm{w}^{*})
&= \left\{
\begin{alignedat}{2}
&{-}f_{0}^{*}(\bm{x}_{0}^{*})
&&-(f_{1}^{*} \upsilon_{1}^{*})(\bm{x}_{1}^{*})
-\dots-(f_{m}^{*} \upsilon_{m}^{*})(\bm{x}_{m}^{*}) \\
&&&\text{if $\bm{u}^{*} \geq \bm{0}$ and
$\bm{x}_{0}^{*}+\dots+\bm{x}_{m}^{*}
=\bm{x}^{*}$}, \\[1ex]
&{-}\infty
&&\text{otherwise}.
\end{alignedat}
\right. % end of second equation
(G^{*} \bm{x}^{*})(\bm{w}^{*})
&= \begin{cases}
\begin{alignedat}{2}
&{-}f_{0}^{*}(\bm{x}_{0}^{*})
&&-(f_{1}^{*} \upsilon_{1}^{*})(\bm{x}_{1}^{*})
-\dots-(f_{m}^{*} \upsilon_{m}^{*})(\bm{x}_{m}^{*}) \\
&&&\text{if $\bm{u}^{*} \geq \bm{0}$ and
$\bm{x}_{0}^{*}+\dots+\bm{x}_{m}^{*}
=\bm{x}^{*}$}, \\[1ex]
&{-}\infty
&&\text{otherwise}.
\end{alignedat}
\end{cases}
\end{align*}
\end{document}