23

There are a few articles on how to do this for left arrow or right arrow but the method doesn't work for \leftrightarrow.

What I want is to write a \longleftrightarrow with “DFT” above it.

I've tried:

\longleftrightarrow{\text{DFT}}
\longleftrightarrow^{DFT}
\xlongleftrightarrow{\text{DFT}}
\longleftrightarrow\limits^{DFT}

None has worked.

0

4 Answers 4

18

You can define an extensible "leftright arrow" by the method explained in Section 38 in Mathmode.pdf by Herber Voß. You can read it with texdoc mathmode on your machine or via this link.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand\xleftrightarrow[2][]{%
  \ext@arrow 9999{\longleftrightarrowfill@}{#1}{#2}}
\newcommand\longleftrightarrowfill@{%
  \arrowfill@\leftarrow\relbar\rightarrow}
\makeatother

\begin{document}

$F \xleftrightarrow{\text{DFT}} G$

$F \xleftrightarrow{\text{overlong text}} G$

\end{document}

enter image description here

The optional argument to \xleftrightarrow is for a "under label", so \xleftrightarrow[xyz]{} will have xyz under the arrow, while \xleftrightarrow[xyz]{abc} will have abc over and xyz under the arrow.

1
  • 7
    They are already provided by mathtools ;-)
    – daleif
    Feb 4, 2013 at 9:21
22
\stackrel{\mathrm{DFT}}{\longleftrightarrow}
0
7
\documentclass{article}
\usepackage{mathtools} 
\usepackage{extarrows} 

\begin{document}
    $$\xleftrightarrow{DFT}$$ % mathtools
    $$\xlongleftrightarrow{DFT}$$ % extarrows
\end{document}

enter image description here

1

I think a good way to do it is with the function \overset:

\documentclass{article}
\usepackage{mathtools} 
\usepackage{extarrows} 

\begin{document}
    $$\overset{DFT}{\longleftrightarrow}$$
\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 .