我正在尝试将公式放入双列样式的文档cases
中flalign
。如果不必要的空格不会妨碍,它几乎可以容纳。有没有什么方法可以删除它?
\documentclass[3p,times,12pt,draft,twocolumn]{elsarticle}
\usepackage{mathtools}
\begin{document}
\begin{flalign}
E_{\perp,diff}=
\begin{cases}
E_{g,meas}&\cdot(1.020-0.254\cdot k+0.0123\\
&\cdot\sin\gamma_S) \quad \text{for k $\le$ 0.3}\\
E_{g,meas}&\cdot(1.400-1.749\cdot k+0.177\\
&\cdot\sin\gamma_S) \quad \text{for 0.3 $<$ k $<$ 0.78}\\
E_{g,meas}&\cdot(0.486\cdot k-0.182\\
&\cdot \sin\gamma_S) \quad \text{for k $\geq$ 0.78}
\end{cases}
\end{flalign}
\end{document}
答案1
你不需要flalign
(我发现它经常被滥用)也不需要cases
,但是aligned
:
\documentclass[3p,times,12pt,draft,twocolumn]{elsarticle}
\usepackage{mathtools}
\begin{document}
\begin{equation}
E_{\perp,\mathrm{diff}}=
\left\{
\begin{aligned}
E_{g,\mathrm{meas}}
&\cdot(1.020-0.254\cdot k+0.0123\\
&\cdot\sin\gamma_S) \quad \text{for $k\le 0.3$}\\
E_{g,\mathrm{meas}}
&\cdot(1.400-1.749\cdot k+0.177\\
&\cdot\sin\gamma_S) \quad \text{for $0.3 < k < 0.78$}\\
E_{g,\mathrm{meas}}
&\cdot(0.486\cdot k-0.182\\
&\cdot \sin\gamma_S) \quad \text{for $k \geq 0.78$}
\end{aligned}
\right.
\end{equation}
\end{document}
然而,我会将其分成两个部分:一部分包含主要信息,另一部分包含复杂内容。
\documentclass[3p,times,12pt,draft,twocolumn]{elsarticle}
\usepackage{mathtools}
\begin{document}
\begin{gather}
E_{\perp,\mathrm{diff}}=E_{g,\mathrm{meas}}\varphi(k,\gamma_S)\\
\varphi(k,\gamma_S)=
\left\{
\begin{array}{@{}l@{}}
1.020-0.254k+0.0123\sin\gamma_S\\
\hfill\text{for $k\le 0.3$}\\[1ex]
1.400-1.749k+0.177\sin\gamma_S\\
\hfill\text{for $0.3 < k < 0.78$}\\[1ex]
0.486k-0.182\sin\gamma_S\\
\hfill\text{for $k \geq 0.78$}
\end{array}
\right.\notag
\end{gather}
\end{document}
答案2
我认为在乘法位置插入换行符不如在加法(或减法)位置换行。此外,我认为环境cases
不是特别适合手头的公式。我会使用一个基本\left\{ ... \right.
构造,并在两个子公式中各提供一个额外的换行符,以便更清楚地将数学部分与条件分开for...
。
\documentclass[3p,times,12pt,draft,twocolumn]{elsarticle}
\usepackage{mathtools}
\begin{document}
\begin{equation}
E_{\perp,\textit{diff}}=
\left\{
\begin{split}
&E_{g,\textit{meas}}\cdot(1.020-0.254 k\\
&\qquad +0.0123\sin\gamma_S)\\
&\qquad \text{for $k \le 0.3$}\\
&E_{g,\textit{meas}}\cdot(1.400-1.749 k\\
&\qquad +0.177\sin\gamma_S)\\
&\qquad \text{for $0.3 < k < 0.78$}\\
&E_{g,\textit{meas}}\cdot(0.486k-0.182\sin\gamma_S) \\
&\qquad \text{for $k \geq 0.78$}
\end{split}
\right.
\end{equation}
\end{document}
答案3
重新定义/修改cases
环境
\makeatletter
\def\env@cases{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{1.2}%
\array{@{}l@{\hspace{2pt}}l@{}} % adjust 2pt to suit your need
}
\makeatother
代码
\documentclass[3p,times,12pt,draft,twocolumn]{elsarticle}
%\usepackage[english]{babel}
\usepackage{mathtools}
\makeatletter
\def\env@cases{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{1.2}%
\array{@{}l@{\hspace{2pt}}l@{}} % adjust 2pt to suit your need
}
\makeatother
\begin{document}
\begin{flalign}
E_{\perp,diff}=
\begin{cases}
E_{g,meas}&\cdot(1.020-0.254\cdot k+0.0123\\
&\cdot\sin\gamma_S) \quad \text{for k $\le$ 0.3}\\
E_{g,meas}&\cdot(1.400-1.749\cdot k+0.177\\
&\cdot\sin\gamma_S) \quad \text{for 0.3 $<$ k $<$ 0.78}\\
E_{g,meas}&\cdot(0.486\cdot k-0.182\\
&\cdot \sin\gamma_S) \quad \text{for k $\geq$ 0.78}
\end{cases}
\end{flalign}
\end{document}
答案4
我建议将字体大小减小到\small
(本地)并用项目符号替换括号,使用命令\mathllap
来mathtools
实现条件的右对齐:
\documentclass[3p,times,12pt,draft,twocolumn]{elsarticle}
\usepackage{mathtools}
\begin{document}
{\small%
\begin{align}\label{eqA}
\mathrlap{ E_{ ⊥ ,\,\mathrm{diff}}=} \\
\notag &\! \begin{aligned}
\bullet\enspace &E_{g,\,\mathrm{meas}} · (1.020-0.254 · k+0.0123 · \sinγ_S) & \\
&\hspace*{-2em} & \mathllap{\text{for}\enspace k ≤ 0.3\quad}\\
\bullet\enspace & E_{g,\,\mathrm{meas}} · (1.400-1.749 · k+0.177 · \sinγ_S) & \\
& & \mathllap{\text{for}\enspace 0.3 < k < 0.78\quad} \\
\bullet\enspace & E_{g,\,\mathrm{meas}} · (0.486 · k-0.182 · \sinγ_S ) \\
& & \mathllap{\text{for}\enspace k \geq 0.78\quad}
\end{aligned}\
\end{align}
}%
\end{document}
变体,第一行是方程编号,并且是法线大小:
\documentclass[3p,times,12pt,draft,twocolumn]{elsarticle}
\usepackage{mathtools}
\begin{document}
{%
\begin{align}\label{eqA}
\mathrlap{ E_{ ⊥ ,\,\mathrm{diff}}=} \\
\notag &\! \begin{aligned}
\bullet\enspace &E_{g,\,\mathrm{meas}} · (1.020-0.254 · k+0.0123 · \sinγ_S) \hskip-1.5em & \\
&\hspace*{-2em} & \mathllap{\text{for}\enspace k ≤ 0.3}\\
\bullet\enspace & E_{g,\,\mathrm{meas}} · (1.400-1.749 · k+0.177 · \sinγ_S)\hskip-1.5em & \\
& & \mathllap{\text{for}\enspace 0.3 < k < 0.78} \\
\bullet\enspace & E_{g,\,\mathrm{meas}} · (0.486 · k-0.182 · \sinγ_S ) \\
& & \mathllap{\text{for}\enspace k \geq 0.78}
\end{aligned}\
\end{align}
}%
\end{document}