[Tex/LaTex] Using \xrightarrow and \downarrow

arrows

I am trying to denote a set of conversions using arrows. The following doesn't compile when \downarrow and \xrightarrow is used in the same line. Could someone help?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\overset{\downarrow}{b}$ \quad
$\overset{\overset{\text{text}}{\downarrow}}{b}$
\[ 
A\xrightarrow{\text{a}}\overset{\downarrow}{B}\xrightarrow{\text{a}}C 
\]
\end{document}

Best Answer

enter image description here

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}
\begin{document}
I do not get an error:\\
$\overset{\downarrow}{b}$ \quad
$\overset{\overset{\text{text}}{\downarrow}}{b}$
\[ 
A\xrightarrow{\text{a}}\overset{\downarrow}{B}\xrightarrow{\text{a}}C 
\]
But I am wondering if you are secretly looking for a commutative diagram.
\[
\begin{tikzcd}[row sep=0.4cm,column sep=0.4cm]
\arrow[d] &  & \text{text}\arrow[d] \\
b  & D\arrow[d,"\text{text}"] & b \\
A \arrow[r,"a"]& B \arrow[r,"a"] & C
\end{tikzcd}
\]
I understand that this may not be the diagram you want, but if you let me know
how it should look like I'll be happy to adjust.
\end{document}