我有一个分成两行的方程式,我想对齐这些项,以便指数和 + 号彼此重叠。我像往常一样尝试了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}