I would like to have two displayed equations, broken by a short paragraph, but with aligned equal signs (as if using the align
environment). Is there some way to "break" the align
environment temporarily?
4 Answers
An alternative which requires less vertical spacing than \intertext
is \shortintertext
, provided by the mathtools
package:
\documentclass{article}
\usepackage{mathtools}% automatically loads amsmath
\begin{document}
\begin{align}
ax + b &= 0 \\
\shortintertext{and}
ab &= x
\end{align}
in comparison with
\begin{align}
ax + b &= 0 \\
\intertext{and}
ab &= x
\end{align}
\end{document}
\intertext
and \shortintertext
are the correct solution if you are able to place all the content within one align
environment. If for some reason you need to have alignment across two different align
type environments, you can use
\makebox[<length>][<l|r|c>]{<text>}
to place the <text>
in a box of width <length>
and placed within that box with l
, r
, or c
alignment. The appropriate <length>
can be determined via \widthof
from the the calc
package.
Below I have defined \WidestLeftHandSide
and \WidestRightHandSide
, and applied r
alignment to the left hand side of the first equation in the second align
, and an l
alignment to the right hand side. This adjustment only needs to be applied once to both side. This yields:
Code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{calc}
\newcommand*{\WidestLeftHandSide}{\tan^2 \theta + \sin^2 \theta + \cos^2 \theta}%
\newcommand*{\WidestRightHandSide}{1 + \tan^2 \theta}%
\begin{document}
\begin{align*}
\tan^2 \theta + \sin^2 \theta + \cos^2 \theta &= 1 + \tan^2 \theta\\
\implies \cos^2 \theta &= 1 - \sin^2 \theta
\end{align*}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris diam quam, cursus vel porttitor eget, posuere non mauris. Suspendisse potenti. Sed in vestibulum augue. Nullam eu est ante.
\begin{align*}
\makebox[\widthof{$\WidestLeftHandSide$}][r]{$E$} &= \makebox[\widthof{$\WidestRightHandSide$}][l]{$mc^2$}\\
F &= ma
\end{align*}
\end{document}