[Tex/LaTex] Overarrow in latex

amsmatharrows

Hello I'm have created some Latex Matrix equations.
But for remembering how it works i wanna create a matrix dimensions workflow like:

\begin{align}
    &\hphantom{(2\times 3)( }%
        \overbrace{\hphantom{1 \times 3) = 2 \times 1} } \nonumber \\[-07pt]%
    &( \underbrace{ 2\times 
        \underbrace{
            3) ( 1 \times 3
            }%
        ) = ( 2 } %
    \times 1) \nonumber
\end{align}

The result is enter image description here
As you can see i have now used \overbrace to create the braces over my workflow.
What i want is the same result but without \overbrace and (two sided) arrows instead

I hope anyone can help me

Thanks Jan-Bert

Best Answer

Use \overleftrightarrow and \underleftrightarrow.

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}    
\begin{align}
    &\hphantom{(2\times 3)( }%
        \overleftrightarrow{\hphantom{1 \times 3) = (2 \times 1} } \nonumber \\[-07pt]% 
    &( \underleftrightarrow{ 2\times
        \underleftrightarrow{
            3) ( 1 \times 3
            }% 
        ) = ( 2 } %
    \times 1) \nonumber
\end{align}
\end{document}

arrows