Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 9 down vote accepted

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.

share|improve this answer
1  
They are already provided by mathtools ;-) –  daleif Feb 4 '13 at 9:21
add comment
\stackrel{\mathrm{DFT}}{\longleftrightarrow}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.