I normally write my solutions to mathematics problems in Latex using the begin/end{align*} feature.
How does one highlight an equation, or answer in my case, when the code is in begin/end{align*} ?
See my code below:
\begin{align*}
%--
i^7 &= 1 \times i^3 \\[5mm]
%--
i^7 &= i^3 \\[5mm]
%--
i^7 &= i^2 \times i \\[5mm]
%--
i^7 &= -1 \times i \\[5mm]
%--
i^7 &= -i \\[5mm]
%--
i^7 &= -i
\end{align*}
So I would like to highlight the last line BUT maintain the alignment
Thanks
Best Answer
This problem can be concluded as colorbox inside align, so we can use
This genius idea is borrowed from here.
This method calculates the length before the aligned mark
&
into variable\dlf
. Then\hspace
is used to left shift the colorbox. Now the alignment is achieved.