7

Usually, if I have a very long formula, I will use two lines in the align environment and \qquad to space things out nicely. For example,

\begin{align*}
% First line
\rho\left(\frac{\partial u_{r}}{\partial t}+u_{r}\frac{\partial u_{r}}{\partialr}+\frac{u_{\phi}}{r}\frac{\partial u_{r}}{\partial\phi}+u_{z}\frac{\partial u_{r}}{\partial z}-\frac{u_{\phi}^{2}}{r}\right) & =-\frac{\partial p}{\partial r}+\mu\Biggl[\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial u_{r}}{\partial r}\right)+\frac{1}{r^{2}}\frac{\partial^{2}u_{r}}{\partial\phi^{2}}
\\
% Second line
& \qquad\qquad\qquad\qquad
+\frac{\partial^{2}u_{r}}{\partial z^{2}}-\frac{u_{r}}{r^{2}}-\frac{2}{r^{2}}\frac{\partial u_{\phi}}{\partial\phi}\Biggr]+\rho g_{r}
\end{align*}

produces

offset-aligned formula

However, this method of alignment is tedious, and not offsetting the second line usually results in something that looks poor. Is there an environment which facilitates this automatically?

  • And why do you use qquad in the first place? Why not to put the ampersand (&) where you want to align the second line directly? – Bichoy Sep 21 '13 at 18:38
  • That will not give the desired effect. – parsiad Sep 21 '13 at 18:42
  • 2
    I'd suggest to use multline* instead of align* in these cases... – karlkoeller Sep 21 '13 at 18:43
  • Ah, this is exactly what I needed. Did not know of it. Thanks. – parsiad Sep 21 '13 at 18:45
9

I think using multline* instead of align* is the right way to go in these cases:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
\rho\left(\frac{\partial u_{r}}{\partial t}+u_{r}\frac{\partial u_{r}}{\partial r}+
\frac{u_{\phi}}{r}\frac{\partial u_{r}}{\partial\phi}+u_{z}\frac{\partial u_{r}}{\partial z}-
\frac{u_{\phi}^{2}}{r}\right)=\\
-\frac{\partial p}{\partial r}+
\mu\Biggl[\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial u_{r}}{\partial r} \right)+
\frac{1}{r^{2}}\frac{\partial^{2}u_{r}}{\partial\phi^{2}}+
\frac{\partial^{2}u_{r}}{\partial z^{2}}-\frac{u_{r}}{r^{2}}-
\frac{2}{r^{2}}\frac{\partial u_{\phi}}{\partial\phi}\Biggr]+\rho g_{r}
\end{multline*}
\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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