![将两线方程的项与指数对齐](https://linux22.com/image/411397/%E5%B0%86%E4%B8%A4%E7%BA%BF%E6%96%B9%E7%A8%8B%E7%9A%84%E9%A1%B9%E4%B8%8E%E6%8C%87%E6%95%B0%E5%AF%B9%E9%BD%90.png)
我有一个分成两行的方程式,我想对齐这些项,以便指数和 + 号彼此重叠。我像往常一样尝试了align
和&
,但无法获得所需的结果。
\documentclass{article}
\usepackage{amsmath}
\pagestyle{empty}
\begin{document}
\begin{align*}
\varepsilon(\vec{k})=
\varepsilon_{0} -\alpha - \gamma
&(
%{\phantom{=}}
e^{-i \vec{k} \cdot \vec{\rho}_{1}}
&+ e^{-i \vec{k} \cdot \vec{\rho}_{2}}
&+ e^{-i \vec{k} \cdot \vec{\rho}_{3}}
&+ e^{-i \vec{k} \cdot \vec{\rho}_{4}}
&+ e^{-i \vec{k} \cdot \vec{\rho}_{5}}
&+ e^{-i \vec{k} \cdot \vec{\rho}_{6}}\\
&+ e^{i \vec{k} \cdot \vec{\rho}_{1}}
&+ e^{i \vec{k} \cdot \vec{\rho}_{2}}
&+ e^{i \vec{k} \cdot \vec{\rho}_{3}}
&+ e^{i \vec{k} \cdot \vec{\rho}_{4}}
&+ e^{i \vec{k} \cdot \vec{\rho}_{5}}
&+ e^{i \vec{k} \cdot \vec{\rho}_{6}}
)
\end{align*}
\end{document}
这是我得到的。并非所有的 + 号都在第二行对齐,有什么解决办法吗?
答案1
我会用alignedat
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\varepsilon(\vec{k})=
\varepsilon_{0} -\alpha - \gamma
\begin{alignedat}[t]{6}
(&e^{-i \vec{k} \cdot \vec{\rho}_{1}}
&&+ e^{-i \vec{k} \cdot \vec{\rho}_{2}}
&&+ e^{-i \vec{k} \cdot \vec{\rho}_{3}}
&&+ e^{-i \vec{k} \cdot \vec{\rho}_{4}}
&&+ e^{-i \vec{k} \cdot \vec{\rho}_{5}}
&&+ e^{-i \vec{k} \cdot \vec{\rho}_{6}}\\
\makebox[0pt][r]{${}+{}$}
&e^{i \vec{k} \cdot \vec{\rho}_{1}}
&&+ e^{i \vec{k} \cdot \vec{\rho}_{2}}
&&+ e^{i \vec{k} \cdot \vec{\rho}_{3}}
&&+ e^{i \vec{k} \cdot \vec{\rho}_{4}}
&&+ e^{i \vec{k} \cdot \vec{\rho}_{5}}
&&+ e^{i \vec{k} \cdot \vec{\rho}_{6}}
&)\end{alignedat}
\end{equation*}
\end{document}
答案2
在我看来,使用multlined
第二行并使其稍微靠近一些会看起来不错:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\varepsilon(\vec{k})=
\varepsilon_{0} -\alpha - \gamma
\begin{multlined}[t]
\Bigl(e^{-i \vec{k} \cdot \vec{\rho}_{1}}
+ e^{-i \vec{k} \cdot \vec{\rho}_{2}}
+ e^{-i \vec{k} \cdot \vec{\rho}_{3}}
+ e^{-i \vec{k} \cdot \vec{\rho}_{4}}
+ e^{-i \vec{k} \cdot \vec{\rho}_{5}}
+ e^{-i \vec{k} \cdot \vec{\rho}_{6}}\\[-1ex]
{}+ e^{i \vec{k} \cdot \vec{\rho}_{1}}
+ e^{i \vec{k} \cdot \vec{\rho}_{2}}
+ e^{i \vec{k} \cdot \vec{\rho}_{3}}
+ e^{i \vec{k} \cdot \vec{\rho}_{4}}
+ e^{i \vec{k} \cdot \vec{\rho}_{5}}
+ e^{i \vec{k} \cdot \vec{\rho}_{6}}
\Bigr)\end{multlined}
\end{equation*}
\end{document}