In the following example, I want to make \rightarrow be the same length as the \xrightarrow, while aligning the two.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{split}
A &\xrightarrow{\mathrm{closed\, loop}} B \\
C &\rightarrow D
\end{split}
\end{equation}
\end{document}
I have found that I can change the length of \rightarrow, using calc's \widthof to get the length right:
\documentclass{article}
\usepackage{amsmath}
\usepackage{calc}
\begin{document}
\begin{equation}
\begin{split}
A &\xrightarrow{\mathrm{closed\, loop}} B \\
C &\parbox{\widthof{$\xrightarrow{\mathrm{closed\, loop}}$}}{\rightarrowfill} D
\end{split}
\end{equation}
\end{document}
But I then lose the alignment of the two arrows (and I am not happy about using $...$ while already in an equation. Is there a way to align these two arrows? Is there a better way to get two arrows of the same length?


\xrightarrownot print out the text for the second line, which is why I started messing with\rightarrow. Thank you! – LSchoon Jun 13 '20 at 10:13