[Tex/LaTex] Aligning text to the right of matrices in math mode

alignequationsmath-mode

I wonder how I could make LaTeX align to the right some specific descriptions I wrote about the operations I apply to matrices. For example, here is a screenshot of what I have right now but I want it done better:

enter image description here

The code I used was:

\documentclass[11pt,a4paper,openany]{report}
\usepackage[utf8]{inputenc}
\usepackage{amssymb, mathrsfs}
\usepackage[dutch]{babel}
\usepackage{systeme, mathtools}
\usepackage[amsmath, thref, hyperref, thmmarks]{ntheorem}
\begin{document}

\begin{align*} 
\det \begin{pmatrix} 4 & 3 & 2 \\ 3 & -2 & 5 \\ 2 & 4 & 6 \end{pmatrix} 
&= 2 \det \begin{pmatrix} 4 & 3 & 2 \\ 3 & -2 & 5 \\ 1 & 2 & 3 \end{pmatrix} 
  \tag*{propositie 4.3.7 (toegepast op onderste rij)} \\ 
&= -2 \det \begin{pmatrix} 1 & 2 & 3 \\ 3 & -2 & 5 \\ 4 & 3 & 2 \end{pmatrix} 
  \tag*{propositie 4.3.5 ($R_1 \leftrightarrow R_3$)} \\ 
&= -2 \det \begin{pmatrix} 1 & 2 & 3 \\ 0 & -8 & -4 \\ 4 & 3 & 2 \end{pmatrix} 
  \tag*{propositie 4.3.8 ($R_2 \rightarrow R_2 - R_1$)} \\ 
&= -2 \det \begin{pmatrix} 1 & 2 & 3 \\ 0 & -8 & -4 \\ 0 & -5 & -10 \end{pmatrix} 
  \tag*{($R_3 \rightarrow R_3 - 4R_1$)}
\end{align*}

\end{document}

I want the descriptions right aligned, prefered with first the statement 'proposition', and underneath in brackets the operation which I applied, and all of this next to the corresponding matrix (to the right). How can this be done?

Best Answer

Don't abuse \tag; there's no need for the explanation to be flush with the right margin; also, the explanations should be left aligned with each other.

Since it's impossible to accommodate those explanations in one line, I use a tabular for splitting them across two lines.

Don't forget loading fontenc with the T1 option.

\documentclass[11pt,a4paper,openany]{report}
\usepackage[T1]{fontenc} % <---- don't forget
\usepackage[utf8]{inputenc}
\usepackage{amssymb, mathrsfs}
\usepackage[dutch]{babel}
\usepackage{systeme, mathtools}
\usepackage[amsmath, thref, hyperref, thmmarks]{ntheorem}

\newcommand{\explain}[1]{&&\begin{tabular}{@{}l@{}}#1\end{tabular}}

\begin{document}

\begin{align*}
\det \begin{pmatrix} 4 & 3 & 2 \\ 3 & -2 & 5 \\ 2 & 4 & 6 \end{pmatrix}
&= 2 \det \begin{pmatrix} 4 & 3 & 2 \\ 3 & -2 & 5 \\ 1 & 2 & 3 \end{pmatrix}
  \explain{propositie 4.3.7 \\ (toegepast op onderste rij)} \\
&= -2 \det \begin{pmatrix} 1 & 2 & 3 \\ 3 & -2 & 5 \\ 4 & 3 & 2 \end{pmatrix}
  \explain{propositie 4.3.5 \\ ($R_1 \leftrightarrow R_3$)} \\
&= -2 \det \begin{pmatrix} 1 & 2 & 3 \\ 0 & -8 & -4 \\ 4 & 3 & 2 \end{pmatrix}
  \explain{propositie 4.3.8 \\ ($R_2 \rightarrow R_2 - R_1$)} \\
&= -2 \det \begin{pmatrix} 1 & 2 & 3 \\ 0 & -8 & -4 \\ 0 & -5 & -10 \end{pmatrix}
  \explain{($R_3 \rightarrow R_3 - 4R_1$)}
\end{align*}

\end{document}

enter image description here

Should you insist to abuse \tag*, just change the definition of \explain into

\newcommand{\explain}[1]{\tag*{\begin{tabular}{@{}l@{}}#1\end{tabular}}}