[Tex/LaTex] Right align text in align environment, while keeping maths centered

alignflalign

I use text at some lines of an align environment to justify how we go from one line to another.
I would like to keep the maths centered, and text to be aligned to the right, but I did not succeed:

  \begin{align}
    a &= bbbbbb &\nonumber \\
    cccc  & =  dd & \text{(using Eq. 1)} & \nonumber \\
    e &= f & \text{(using Thm. 2)} 
  \end{align}

gives
enter image description here
which is OK for the maths, but not for the text as it is not completely at the end of the lign.

Using the flalign environement instead aligns the math equations to the left, while I'd like to keep them centered.

What is the cleanest way to achieve this ?

Best Answer

I propose one of these two dolutions, both based on the flalign environment:

\documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}
\usepackage[showframe]{geometry}

\begin{document}

  \begin{flalign}
  & & a &= bbbbbb &\nonumber \\
 & & cccc & = dd & \text{(using Eq. 1)} & \nonumber \\
 & & e &= f & \text{(using Thm. 2)}
  \end{flalign}

  \begin{flalign}
  & & a &= bbbbbb \nonumber \\
 & & cccc & = dd & \eqparbox{C}{(using Eq. 1)} & \nonumber \\
 & & e &= f & \eqparbox{C}{(using Thm. 2)}
 \end{flalign}

\end{document} 

enter image description here

Related Question