Code: Select all
\documentclass[11pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
3+x &=4 && \text{comment}\\
x &=4-3 && \text{another comment}\\
x &=1 && \text{yet another comment}\\
\end{align*}
\end{document}
Code: Select all
\documentclass[11pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
3+x &=4 && \text{comment}\\
x &=4-3 && \text{another comment}\\
x &=1 && \text{yet another comment}\\
\end{align*}
\end{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.
Code: Select all
\documentclass[11pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
3+x &=4 && \hspace{-2.7cm}\text{comment}\\
x &=4-3 && \hspace{-2.7cm}\text{another comment}\\
x &=1 && \hspace{-2.7cm}\text{yet another comment}\\
\end{align*}
\end{document}
alignat*
environment to have more control about the horizontal space.
Code: Select all
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools} % loads »amsmath«
\begin{document}
\begin{alignat*}{2}
3+x &=4 & \quad & \text{comment} \\
x &=4-3 & & \text{another comment} \\
x &=1 & & \text{yet another comment}
\end{alignat*}
\end{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.