3

In the example given below, I would like the first and third equations to be aligned at the = sign, while the second equation should be centered, like in the gather environment. Using gathered inside align environment doesn't help.

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}    % for \because

\title{Title}
\author{Author}
\date{Date}

\begin{document}
\begin{align}
    \nabla \times[\nabla \times A]_{\varphi} &=\frac{-4 \pi G \rho}{c^2} \\
    \begin{gathered}
        \because \quad \nabla \times v=\left[\frac{1}{s} \frac{\partial v_z}{\partial \phi}-\frac{\partial v_\phi}{\partial z}\right]
    \end{gathered} \\
    \nabla \times A &=\frac{\partial A_\phi}{\partial z} \hat{R}+\frac{1}{R}\left[\frac{\partial}{\partial R}\left(R A_\phi\right)\right] \hat{z}
\end{align}

\end{document}

enter image description here

2
  • The second equation shown here is not its actual long form. And it actually defines a general relation. I need it centered, since if u try to align it at = sign, it would mess up everything. I have tried using intertext, but doesn't it produce more vertical space, then the space between two lines of equations in align environment? Commented Mar 18 at 15:57
  • It looks weird because i have cut down the second equation to two terms, when in reality, it takes up the whole line. So, it makes more sense to center it Commented Mar 18 at 16:11

1 Answer 1

5

You can center the second equation with respect to & of the align environment with \mathclap from the mathtools package. \mathclap puts its argument to in a zero width box and centers it.

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}    % for \because
\usepackage{mathtools}  % for \mathclap

\title{Title}
\author{Author}
\date{Date}

\begin{document}

\begin{align}
    \nabla \times[\nabla \times A]_{\varphi} & =\frac{-4 \pi G \rho}{c^2} \\
    & \mathclap{\because \quad \nabla \times v=\left[\frac{1}{s} \frac{\partial v_z}{\partial \phi}-\frac{\partial v_\phi}{\partial z}\right]}\\
    \nabla \times A                          & =\frac{\partial A_\phi}{\partial z} \hat{R}+\frac{1}{R}\left[\frac{\partial}{\partial R}\left(R A_\phi\right)\right] \hat{z}
\end{align}

\end{document}

second equation centered

Anyway, as said by David Carlisle, the simplest and the clearest is to align all equal signs.

\begin{align}
    \nabla \times[\nabla \times A]_{\varphi} & =\frac{-4 \pi G \rho}{c^2}                                                      \\
    \because \quad \nabla \times v           &=\left[\frac{1}{s} \frac{\partial v_z}{\partial \phi}-\frac{\partial v_\phi}{\partial z}\right] \\
    \nabla \times A                          & =\frac{\partial A_\phi}{\partial z} \hat{R}+\frac{1}{R}\left[\frac{\partial}{\partial R}\left(R A_\phi\right)\right] \hat{z}
\end{align}

all with align

1
  • That worked like a charm. You sir, are a genius. Commented Mar 18 at 16:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .