for a thesis I am currently writing on, I would like to highlight and explain some mathematical transformations inside the equations (to explain why the transformation holds). Of course, I could "interrupt" the mathematical proof and explain the transformation in a new line, but I think it is nicer if the annotations are written directly next to the lines they are related to. I already thought about creating a table or two minipages, but I wasn't sure if there is a nicer way to do it.
Attached you will find a simple example (the actual equation is more complicated), just in order to get an idea what I am thinking of. The arrows are not mandatory, but it would be nice if the annotation is written between the mathematical lines (but the spacing of the equation should not change because of the annotation). Thank you for your help!
\documentclass{scrartcl}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\begin{split}
\textrm{OPT} & = \textrm{OPTL} + \textrm{OPTR} \\
& = (x+y) + (y+z) \\
& \leq 2* (y+z) \\
& = \textrm{OPTR} + \textrm{OPTR}
\end{split}
\end{equation*}
\end{document}




See picture: https://imgur.com/a2cbJqH
– Unicorn Jun 02 '18 at 19:08witharrows(version 1.9, 2018/08/18), there is a optionwrap-linesfor the environmentsDispWithArrowswhich breaks lines automatically. – F. Pantigny Aug 18 '18 at 09:58