5

I find it is necessary to add some explanation in a series of equations. Ideally, I would like to get something like the following picture (Resnick 1999). As you can see, the equations are still aligned but with extra comments added. Could anyone tell me how to do this in LaTeX, please? Can I achieve this using align environment, please? Thank you!

enter image description here

Here is an example. Note that I want my comments to align with the main text.

\documentclass{article}

\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{manfnt}

\begin{document}

\noindent I want the comments to align with the main text.

\begin{align*}
\mathbb E X &= \int x F(dx) \\
comments \\
&= \mu.
\end{align*}

\end{document}

enter image description here

LaTeXFan
  • 1,573

1 Answers1

8

You want \intertext.

\documentclass{article}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{manfnt}

\begin{document}

\noindent I want the comments to align with the main text.

\begin{align*}
\mathbb E X &= \int x F(dx) \\
    \intertext{comments that align with the main text}
&= \mu.
\end{align*}

\end{document}

It's documented in the AMS Math User Guide available from AMS via the link, or texdoc amsldoc from your command line if you have Tex Live installed. And see this answer about how to control the vertical spacing.

Thruston
  • 42,268