amsmath

https://michael-prokop.at/latextug/amsldoc.pdf

Table of Contents

Add line by line comments to math proofs howto

\begin{align*}
  3+x &=4 && \text{we are trying to solve for } x\\
  x &=4-3 && \text{Subtract 3 from both sides}\\
  x &=1   && x \text{ must be one}
\end{align*}
\[\begin{align*} 3+x &=4 && \text{we are trying to solve for } x\\ x &=4-3 && \text{Subtract 3 from both sides}\\ x &=1 && x \text{ must be one} \end{align*} \]

\begin{equation} vs \begin{equation*} discussion

Each environment has both starred and unstarred forms, where the unstarred forms have automatic numbering using LATEX’s equation counter. You can suppress the number on any particular line by putting \notag before the \\

What does a double ampersand (&&) mean? discussion

An align is a table-like structure, and & is a column separator. The thing is that the columns in an align are rlrlrlrlrl..., that is, every other column is right aligned and left aligned.

\begin{align}
a &= b
a &= b & text
a &= b && text
\end{align}
\[\begin{align} a &= b\\ a &= b & text\\ a &= b && text \end{align} \]