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

share|improve this question

1 Answer 1

up vote 9 down vote accepted

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

share|improve this answer
    
@subhamsoni Yes, if amsmath is loaded. –  Gonzalo Medina May 19 at 15:50

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.