我使用align*
环境,在一行中我有一个很长的方程式,它不包含在一行中。因此,对于这一行,我希望具有与multline
环境相同的行为,即在换行后,我希望方程式的末尾右对齐。
在这里我添加了一个\hspace
命令来执行此操作,但我认为应该存在一些东西......
\begin{align*}
\hat{H} \Psi(r,\theta) & = \left\lbrace\frac{-\hbar^2}{2m_er^2} \left[
\frac{\partial}{\partial r} \left(r^2\frac{\partial }{\partial r}\right)
+ \frac{1}{\sin\theta}\frac{\partial}{\partial \theta}
\left(\sin\theta\frac{\partial}{\partial\theta}\right)
+ \frac{1}{\sin^2\theta}\frac{\partial^2}{\partial\varphi^2}\right]
- \frac{e^2}{4\pi \epsO r} \right\rbrace \Psi(x,\theta) \\
& = \frac{-\hbar^2}{2m_er^2} \left[
\frac{\partial}{\partial r} \left(r^2\frac{\partial }{\partial r}\right)\Psi(x,\theta)
+ \frac{1}{\sin\theta}\frac{\partial}{\partial \theta}
\left(\sin\theta\frac{\partial}{\partial\theta}\right)\Psi(x,\theta)
+ \frac{1}{\sin^2\theta}\frac{\partial^2}{\partial\varphi^2}\Psi(x,\theta)\right] \\
& \hspace{12cm} - \frac{e^2}{4\pi \varepsilon_0 r}\Psi(x,\theta)
\end{align*}
答案1
下面的示例使用aligned
将第二行和右行与右侧对齐。
\documentclass{article}
\usepackage{amsmath}
\newcommand*{\epsO}{\epsilon_0}
\begin{document}
\begin{align*}
\hat{H} \Psi(r,\theta) & = \left\lbrace\frac{-\hbar^2}{2m_er^2} \left[
\frac{\partial}{\partial r} \left(r^2\frac{\partial }{\partial r}\right)
+ \frac{1}{\sin\theta}\frac{\partial}{\partial \theta}
\left(\sin\theta\frac{\partial}{\partial\theta}\right)
+ \frac{1}{\sin^2\theta}\frac{\partial^2}{\partial\varphi^2}\right]
- \frac{e^2}{4\pi \epsO r} \right\rbrace \Psi(x,\theta) \\
&
\begin{aligned}
{}= \frac{-\hbar^2}{2m_er^2} \left[
\frac{\partial}{\partial r} \left(r^2\frac{\partial }{\partial r}\right)\Psi(x,\theta)
+ \frac{1}{\sin\theta}\frac{\partial}{\partial \theta}
\left(\sin\theta\frac{\partial}{\partial\theta}\right)\Psi(x,\theta)
+ \frac{1}{\sin^2\theta}\frac{\partial^2}{\partial\varphi^2}\Psi(x,\theta)\right]\\
- \frac{e^2}{4\pi \epsO r}\Psi(x,\theta)
\end{aligned} \\
\end{align*}
\end{document}
答案2
我建议你不要强行将第二行完整表达的一小部分悬垂在第三行的最右侧,而是将这一行的更多部分(连同“一小部分”)放在第三行,只进行适度缩进。我还建议你使用将\hphantom
第二行的开头稍微缩进一点,以便其开头与前一行的内容垂直对齐。
\documentclass{article}
\newcommand\eps\varepsilon
\usepackage{amsmath}
\begin{document}
\begin{align*}
\hat{H} \Psi(r,\theta)
&= \left\lbrace\frac{-\hbar^2}{2m_er^2}
\left[
\frac{\partial}{\partial r} \left(r^2\frac{\partial }{\partial r}\right)
+ \frac{1}{\sin\theta}\frac{\partial}{\partial \theta}
\left(\sin\theta\frac{\partial}{\partial\theta}\right)
+ \frac{1}{\sin^2\theta}\frac{\partial^2}{\partial\varphi^2}\right]
- \frac{e^2}{4\pi \eps_0 r} \right\rbrace \Psi(x,\theta) \\
&= \hphantom{\bigg\lbrace} \frac{-\hbar^2}{2m_er^2}
\left[
\frac{\partial}{\partial r} \left(r^2\frac{\partial }{\partial r}\right)\Psi(x,\theta)
+ \frac{1}{\sin\theta}\frac{\partial}{\partial \theta}
\left(\sin\theta\frac{\partial}{\partial\theta}\right)\Psi(x,\theta)\right.\\
&\qquad\qquad+ \frac{1}{\sin^2\theta}\frac{\partial^2}{\partial\varphi^2}\Psi(x,\theta)\biggr]
- \frac{e^2}{4\pi \eps_0 r}\Psi(x,\theta)
\end{align*}
\end{document}