2

I am not sure if my following example is good for creating equations with notes of current mathematical operations:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
    \begin{align*}
    x \cdot 5 &= 5 && \lvert \; \div 5 \\
    x         &= 1
    \end{align*}
\end{document}

Is this the correct way to define these type of equations? Is there any other package which does the same in a better way? How would you create this equation?

2
  • Side note: align* is already an outer mathmode environment, you should remove \[ .. \].
    – AboAmmar
    Oct 12, 2020 at 14:25
  • Ahh, you're right. I always forget that. I changed it, thank you.
    – Doesbaddel
    Oct 12, 2020 at 14:27

2 Answers 2

5

I suggest witharrows:

\documentclass{article}
\usepackage{witharrows}
\usepackage{amsmath}
\begin{document}
\begin{DispWithArrows*}
x \cdot 5 &= 5 \Arrow{division by 5}\\
x     &= 1
\end{DispWithArrows*}
\end{document}

enter image description here

1
  • 1
    Wow, looks very nice. Thank you for your contribution.
    – Doesbaddel
    Oct 12, 2020 at 18:50
3

You can use a short macro to make this easier:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    
  \newcommand{\eqnote}[1]{&\small\text{\llap{#1}}}

  \begin{align*}
    x \cdot 5 &= 5  \eqnote{$\lvert \; \div 5$} \\
    x         &= 1  \eqnote{This equals one} \\
  \end{align*}
    
\end{document}

enter image description here

Also, you can use a \tag*:

  \begin{align*}
    x \cdot 5 &= 5  \tag*{\small $\lvert \; \div 5$} \\
    x         &= 1  \tag*{\small This equals one} \\
  \end{align*}

enter image description here

1
  • Thank you for your answer. I never heard about the tag command, I will try it out.
    – Doesbaddel
    Oct 12, 2020 at 17:55

You must log in to answer this question.

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