3

How can I add such descriptions next to the successive aligned equations using LaTeX?

enter image description here

1
  • 2
    Welcome to TeX:SE! What you tray?
    – Zarko
    May 16, 2023 at 18:17

4 Answers 4

10

I think it's better to use an alignat or alignat* environment rather than an array environment to display several rows of equations, for two reasons. First, the rows are spaced slightly farther apart than if an array environment is used. Second, the material is typeset in display-style math mode by default -- which is appropriate for displayed equations.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'alignat*' env.
\usepackage{newtxtext,newtxmath} % Times Roman text and math fonts

\begin{document}

\begin{alignat*}{2}
A+(B+C) 
  &= [a_{ij}]+[b_{ij}+c_{ij}] &\qquad& \text{by Definition 1.29} \\
  &= [a_{ij}+(b_{ij}+c_{ij})] && \text{by Definition 1.29} \\
  &= [(a_{ij}+b_{ij})+c_{ij}] && \text{since addition in $\mathbf{R}$ is associative} \\
  &= [a_{ij}+b_{ij}]+[c_{ij}] && \text{by Definition 1.29} \\
  &= (A+B)+C
\end{alignat*}

\end{document}
4

With {WithArrows} of the package witharrows.

\documentclass{article}
\usepackage{mathtools} % for \MoveEqLeft
\usepackage{witharrows}

\begin{document}
The following equalities establish the associative property for addition.

$\begin{WithArrows}
    \MoveEqLeft{A+(B+C)} \Arrow{By definition 1.29} \\
           &=\left[a_{ij}\right]+\left[b_{ij}+c_{ij}\right] \Arrow{By definition 1.29}\\
           &=\left[a_{ij}+\left(b_{ij}+c_{ij}\right)\right] \Arrow{since addition in $\mathbf R$ is associative}\\
           &=\left[\left(a_{ij}+b_{ij}\right)+c_{ij}\right] \Arrow{By definition 1.29}\\
           &=\left[a_{ij}+b_{ij}\right]+\left[c_{ij}\right] \Arrow{By definition 1.29} \\
           &=(A+B)+C
\end{WithArrows}$
\end{document}

Output of the above code

4

Here's a possibility:

\documentclass{article}
\usepackage{array}
\begin{document}
The following equalities establish the associative property for addition.
\[\begin{array}{r @{} >{{}}c<{{}} @{} ll}
    A+(B+C)&=&[a_{ij}]+[b_{ij}+c_{ij}]&\mbox{By definition 1.29}\\
           &=&[a_{ij}+(b_{ij}+c_{ij})]&\mbox{By definition 1.29}\\
           &=&[(a_{ij}+b_{ij})+c_{ij}]&\mbox{since addition in $\mathbf R$ is associative}\\
           &=&[a_{ij}+b_{ij}]+[c_{ij}]&\mbox{By definition 1.29}\\
           &=&(A+B)+C&\mbox{By definition 1.29}
  \end{array}\]
\end{document}

enter image description here

0
3

As starting point is considered @José Carlos Santos answer (+1):

\documentclass{article}
\usepackage{array}

\begin{document}
The following equalities establish the associative property for addition.
\[\renewcommand\arraystretch{1.2}
    \begin{array}{r@{\,}c@{\,}l >{\qquad$}l<{$}}
A+(B+C) &=& [a_{ij}] + [b_{ij} + c_{ij}]    & by definition 1.29    \\
        &=& [a_{ij}+ (b_{ij} + c_{ij})]     & by definition 1.29    \\
        &=& [(a_{ij}+b_{ij}) + c_{ij}]      & since addition in $\mathbf{R}$ is associative\\
        &=& [a_{ij}+b_{ij}]  + [c_{ij}]     & by definition 1.29    \\
        &=& (A+B)+C                         & by definition 1.29 
  \end{array}
\]
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .