# Does \Twoheadleftrightarrow exist? How to write my own?

I'm a LaTeX newbie. I am writing a document in which I need to have a two-headed bidirectional arrow. Two-headed like \twoheadleftarrow, bidirectional like \leftrightarrow.

Is there any package that offers something like this? If not, how do I "roll my own"?

Thank you a lot!

\twoheadleftarrow and \twoheadrightarrow can be combined to \twoheadleftrightarrow:

\documentclass{article}
\usepackage{amssymb}

\mathrel{\mkern-15mu}%
}

\begin{document}
$\twoheadleftrightarrow \scriptstyle \twoheadleftrightarrow \scriptscriptstyle \twoheadleftrightarrow$
\end{document}


The symbols can also be combined using \joinrel, which is some negative space that should counteract the side bearings. However, I could see a small gap in \scriptscriptstyle with class option 10pt, thus I have removed another -0.5mu. And the new \longtwoheadleftrightarrow has an optional argument, which allows further adjustment if necessary.

\documentclass{article}
\usepackage{amssymb}

\joinrel
\mathrel{\mkern-#1mu}%
}

\begin{document}
$\longtwoheadleftrightarrow \scriptstyle \longtwoheadleftrightarrow \scriptscriptstyle \longtwoheadleftrightarrow$
\end{document}


An even longer version can be composed with \relbar in the middle.

Also an expandable version can be constructed similar to \xrightarrow:

\documentclass{article}
\usepackage{amsmath,amssymb}

\makeatletter
}
$\xtwoheadleftrightarrow[\text{under}]{\text{over}}$

• @tobiatesan Look into Herbert Voß's “Math Mode” (texdoc mathmode); in section 38 it is explained how to define \xleftrightarrow and it should suffice to adapt the definition in order to use the double head arrows. Jul 22, 2014 at 18:02
• The strange behavior of \joinrel is also visible when you try \longrightarrow in scriptscript style: see i.stack.imgur.com/wgVZb.png Jul 22, 2014 at 20:31
• @egreg: \joinrel assumes that 1.5mu is equal or larger than the symbol's side bearing, but the amount of the side bearings depend on the font and might not follow and scale with a specific mu value. Jul 22, 2014 at 22:03
• @HeikoOberdiek I know; I was just surprised that this happened with CM fonts, when I discovered it some time ago. I guess that Knuth has never used \longrightarrow in scriptscript style, which I'm not really surprised of. ;-) Jul 22, 2014 at 22:08