8

I'm trying to acquire something to this effect.

enter image description here

Using

\xrightarrow 

I have been able to do this roughly, but I'd like the double headed version.

2 Answers 2

8

The extensible arrows \xleftarrow and \xrightarrow are defined by amsmath. Its extension mathtools defines also the double-headed version \xleftrightarrow.

\documentclass{article}

\usepackage{mathtools}

\begin{document}
\[
A \xleftrightarrow{\text{loooong stuff}} B
\]
\end{document}

enter image description here

4

Here's a version without mathtools.

\documentclass{article}
\usepackage{amsmath}
\newcommand\xleftrightarrow[1]{%
  \mathbin{\ooalign{$\,\xrightarrow{#1}$\cr$\xleftarrow{\hphantom{#1}}\,$}}
}
\begin{document}
\[
A \xrightarrow{\varphi} B \xrightarrow{\text{PDQ Bach}} C
\]
\[
A \xleftrightarrow{\varphi} B \xleftrightarrow{\text{PDQ Bach}} C
\]
\end{document}

enter image description here

If you need it in \scriptstyle:

\documentclass{article}
\usepackage{amsmath,scalerel}
\newcommand\xleftrightarrow[1]{\ThisStyle{%
  \mathbin{\ooalign{$\SavedStyle\,\xrightarrow{#1}$\cr
                    $\SavedStyle\xleftarrow{\hphantom{#1}}\,$}}
}}
\begin{document}
\[
A \xrightarrow{\varphi} B \xrightarrow{\text{PDQ Bach}} C
\]
\[
A \xleftrightarrow{\varphi} B \xleftrightarrow{\text{PDQ Bach}} C
\]
\[\scriptstyle
A \xleftrightarrow{\varphi} B \xleftrightarrow{\text{PDQ Bach}} C
\]
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .