2

I have an equation that is split into 4 lines using amsmath's split environment. How can I annotate individual lines with a text comment such that the comments are themselves left-justified and aligned? So what I want is (without the equation number):

  lhs = some term         (comment1)
      + another term
      + yet another term  (comment2)
      + final term        (comment3)

In principle, left-justified and aligned comments can be obtained with the alignat environment, of course. However, while I can select which of the lines get numbered using \notag so I get a single equation number, the number won't be vertically centered (because I have an even number of lines).

I've searched for solutions for a while but have come up empty. The following MWE is incomplete because it does not contain the left-justified and aligned comments:

\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{split}
  \alpha & = \alpha_0 \\
         & + \beta^2 (H-\sqrt{f/g})
\end{split}
\end{equation}
\end{document}

Thanks for any help.

4

You can use aligned or alignedat{2}, and take into account or not the widths of the comments:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  \begin{aligned}
    α& = \alpha₀ & & \text{\footnotesize(a first comment)} \\
           & + \beta² (H-√{f/g}) & & \text{\footnotesize(another comment)}
  \end{aligned}
\end{equation}
\vskip 0.5cm
\begin{equation}
  \begin{alignedat}{2}
    α& = \alpha₀ &\qquad & \rlap{\footnotesize(a first comment)}\\
    & + \beta² (H-√{f/g}) & & \rlap{\footnotesize(another comment)}
  \end{alignedat}
\end{equation}
\vskip 0.5cm
\begin{equation}
  \begin{alignedat}{2}
    α& = \alpha₀ &\qquad & \text{\footnotesize(a first comment)}\\
    & + \beta² (H-√{f/g}) & & \text{\footnotesize(another comment)}
  \end{alignedat}
\end{equation}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.