Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use a align* environment and on one line I have a very long equation which does not contain into a line. Thus for this line I would like to have the same behavior as a multline environment, that is after the break line I would like the end of the equation to be right aligned.

Here I add a \hspace command to do that but I think that something should exist ...

\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 \epsO r}\Psi(x,\theta) \\
\end{align*}

enter image description here

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

The following example uses aligned to align the second and right line to the right side.

\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}

Result

share|improve this answer
add comment

Rather than forcing a tiny bit of the full expression of the second full line to dangle by itself on the far right of the third line, I recommend you take a bit more of that line and place it (together with a the "tiny bit") on the third line, only moderately indented. I also suggest you employ an \hphantom to indent the start of the second line a bit so that its start lines up vertically with the material in the preceding line.

enter image description here

\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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.