[Tex/LaTex] Two lines above & below arrow

arrows

क्रोष्टान् + स् $\xrightarrow[\stackrel{\normalsize\text{}}{\shortstack[c]{{\textcolor{blue}{\text{\scriptsize{\nameref{8.2.7}}}}}\ \textcolor{blue}{\text{\scriptsize{नकार gets लोप}}}}}]{\stackrel{\normalsize\text{}}{\shortstack[c]{{\textcolor{black}{\text{\scriptsize{\nameref{6.1.68}}}}}\ \text{\scriptsize{सकार gets लोप \&}}}}}$
alt text

I am not sure if this is the best way to work with. It worked so I adopted it. But now my document is getting really big and I am worried if it would cause any sort of problems later.

Also can I create a command where I can use text to the left and right of the arrow and all four lines above & below the arrow as arguments. So far I was getting by with copy paste and changing the text as needed. Just to give an idea in my 200 page document this thing came so far around 300 times.

thanks for your comments

PS: The font is unicode Devanagari(Sanskrit2003)

Best Answer

I am just putting the code that you gave inside a \newcommand. Is it what was needed?

\newcommand{\TwoSidedTextArrow}[6]{
  \ensuremath{%
    \xrightarrow[%
    \stackrel{\normalsize\text{}}{%
      \shortstack[c]{%
        {\textcolor{blue}{\text{\scriptsize{\nameref{#1}}}}}\ %
        \textcolor{blue}{\text{\scriptsize{#2 gets #3}}}%
      }}]{%
    \stackrel{\normalsize\text{}}{%
      \shortstack[c]{%
        {\textcolor{black}{\text{\scriptsize{\nameref{#4}}}}}\ %
        \text{\scriptsize{#5 gets #6 \&}}}%
    }}%
  }%
}

Your example then becomes

क्रोष्टान् + स् \TwoSidedTextArrow{8.2.7}{नकार}{लोप}{6.1.68}{सकार}{लोप}