![如何在聚集方程环境中左对齐文本](https://linux22.com/image/381883/%E5%A6%82%E4%BD%95%E5%9C%A8%E8%81%9A%E9%9B%86%E6%96%B9%E7%A8%8B%E7%8E%AF%E5%A2%83%E4%B8%AD%E5%B7%A6%E5%AF%B9%E9%BD%90%E6%96%87%E6%9C%AC.png)
我目前正在尝试将方程式添加到我的论文中,由于方程式很长,我想使用简写将方程式拆分。我想要实现的是方程式有两个换行符,后面跟着一个左对齐的 where,其他方程式位于一个聚集环境中,方程式编号与顶行对齐。我已经实现了大部分功能,但在聚集环境中我无法让“where”行左对齐,我试过了,\intertext
使用聚集时似乎不起作用。有什么建议吗?
\begin{equation}\label{eq:triclinic(hkl)}
\begin{gathered}[t]
\frac{1}{d^2} = \frac{1}{V^2} (S_{11}h^2 + S_{22} k^2 + S_{33} \ell^2 + 2S_{12}hk + 2S_{23}k\ell + 2S_{13}h\ell)\\~\\
\text{where}\\~\\
V = abc \sqrt{1 - cos^2(\alpha) - cos^2(\beta) - cost^2(\gamma) + 2cos(\alpha) cos(\beta) cos(\gamma)}\\
S_{11} = b^2c^2sin^2(\alpha)\\
S_{22} = a^2c^2sin^2(\beta)\\
S_{33} = a^2 b^2 sin^2 (\gamma)\\
S_{12} = abc^2 (cos(\alpha) cos(\beta) - cos(\gamma))\\
S_{23} = a^2bc (cos(\beta) cos(\gamma) - cos(\alpha)\\
S_{13} = ab^2c (cos(\gamma) cos(\alpha) - cos(\beta)\\
\end{gathered}
\end{equation}
答案1
您可以在中设置此项align
,并使用它\notag
来删除不需要编号的方程式的任何方程式编号:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
Original equation
\begin{equation}
\begin{gathered}[t]
\frac{1}{d^2} = \frac{1}{V^2} (S_{11}h^2 + S_{22} k^2 + S_{33} \ell^2 + 2S_{12}hk + 2S_{23}k\ell + 2S_{13}h\ell)\\~\\
\text{where}\\~\\
V = abc \sqrt{1 - cos^2(\alpha) - cos^2(\beta) - cost^2(\gamma) + 2cos(\alpha) cos(\beta) cos(\gamma)}\\
S_{11} = b^2c^2sin^2(\alpha)\\
S_{22} = a^2c^2sin^2(\beta)\\
S_{33} = a^2 b^2 sin^2 (\gamma)\\
S_{12} = abc^2 (cos(\alpha) cos(\beta) - cos(\gamma))\\
S_{23} = a^2bc (cos(\beta) cos(\gamma) - cos(\alpha)\\
S_{13} = ab^2c (cos(\gamma) cos(\alpha) - cos(\beta)\\
\end{gathered}
\end{equation}
Proposed improvement
\begin{align}
\frac{1}{d^2} &= \frac{1}{V^2} \bigl( S_{11}h^2 + S_{22} k^2 + S_{33} \ell^2 + 2S_{12}hk + 2S_{23}k\ell + 2S_{13}h\ell \bigr) \\
\shortintertext{where}
V &= a b c \sqrt{1 - \cos^2(\alpha) - \cos^2(\beta) - \cos^2(\gamma) + 2 \cos(\alpha) \cos(\beta) \cos(\gamma)} \notag \\
S_{11} &= b^2 c^2 \sin^2(\alpha) \notag \\
S_{22} &= a^2 c^2 \sin^2(\beta) \notag \\
S_{33} &= a^2 b^2 \sin^2 (\gamma) \notag \\
S_{12} &= a b c^2 \bigl( \cos(\alpha) \cos(\beta) - \cos(\gamma) \bigr) \notag \\
S_{23} &= a^2 b c \bigl( \cos(\beta) \cos(\gamma) - \cos(\alpha) \bigr) \notag \\
S_{13} &= a b^2 c \bigl( \cos(\gamma) \cos(\alpha) - \cos(\beta) \bigr) \notag
\end{align}
\end{document}
答案2
我建议这样的布局:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align}
\frac{1}{d^2} &= \frac{1}{V^2} \bigl( S_{11}h^2 + S_{22} k^2 + S_{33} \ell^2 + 2S_{12}hk + 2S_{23}k\ell + 2S_{13}h\ell \bigr) \\
\intertext{where \quad$ \begin{array}[t]{|l@{}}
V = a b c \sqrt{1 - \cos^2\alpha - \cos^2\beta - \cos^2\gamma + 2 \cos\alpha \cos\beta \cos\gamma} \\[1ex] \begin{aligned}[t]
S_{11} &= b^2 c^2 \sin^2\alpha \qquad &
S_{12} &= a b c^2 \bigl( \cos\alpha \cos\beta - \cos\gamma \bigr) \\
S_{22} &= a^2 c^2 \sin^2\beta & S_{23} &= a^2 b c \bigl( \cos\beta \cos\gamma - \cos\alpha \bigr)\\
S_{33} &= a^2 b^2 \sin^2 \gamma & S_{13} &= a b^2 c \bigl( \cos\gamma \cos\alpha - \cos\beta \bigr)
\end{aligned}
\end{array}$} \notag
\end{align}
\end{document}
答案3
没有必要将所有内容都放在一个显示器上:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}\label{eq:triclinic(hkl)}
\frac{1}{d^2} = \frac{1}{V^2} (
S_{11}h^2 + S_{22} k^2 + S_{33} \ell^2 +
2S_{12}hk + 2S_{23}k\ell + 2S_{13}h\ell
)
\end{equation}
where
\begin{align*}
V &= abc \sqrt{
1 - \cos^2(\alpha) - \cos^2(\beta) - \cos^2(\gamma) +
2\cos(\alpha) \cos(\beta) \cos(\gamma)
}\\
S_{11} &= b^2c^2\sin^2(\alpha)\\
S_{22} &= a^2c^2\sin^2(\beta)\\
S_{33} &= a^2b^2\sin^2(\gamma)\\
S_{12} &= abc^2 (\cos(\alpha) \cos(\beta) - \cos(\gamma))\\
S_{23} &= a^2bc (\cos(\beta) \cos(\gamma) - \cos(\alpha)\\
S_{13} &= ab^2c (\cos(\gamma) \cos(\alpha) - \cos(\beta)
\end{align*}
\end{document}
如果愿意,您可以gather*
在底部显示中使用(没有尾随,请注意)。\\
使用\cos
和\sin
作为三角函数。