4

I have equations in two different align environments. How do I align them equally in such a way that the = sign is in the exact position following the sequence.

The MWE:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
B &= \mu.H \\
  &= \mu_0.H + \mu_0.M
\end{align}
As $\mu = \mu_0.\mu_r$,
\begin{align}
B &= \mu_0.\mu_r.H \\
  &= \mu_0(H + M)
\end{align}
\end{document}

enter image description here

1 Answer 1

9

Use just one align environment and \intertext (from the amsmath package) or \shortintertext (from the mathtools package) for the text:

\documentclass[12pt]{article}
\usepackage{mathtools}

\begin{document}

\begin{align}
B &= \mu.H \\
  &= \mu_0.H + \mu_0.M
\intertext{As $\mu = \mu_0.\mu_r$,}
B &= \mu_0.\mu_r.H \\
  &= \mu_0(H + M)
\end{align}

\begin{align}
B &= \mu.H \\
  &= \mu_0.H + \mu_0.M
\shortintertext{As $\mu = \mu_0.\mu_r$,}
B &= \mu_0.\mu_r.H \\
  &= \mu_0(H + M)
\end{align}

\end{document}

enter image description here

1
  • @subhamsoni Yes, if amsmath is loaded. Commented May 19, 2014 at 15:50

You must log in to answer this question.

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