# Is it possible to have a two head arrow as a decorator?

I would like to have the analogue of \overrightarrow{x} but with a two headed arrow (as in \twoheadrightarrow, but above the variable). Is this possible?

-

\documentclass{article}
\usepackage{mathtools}
\def\Overrightarrow#1{\mathrlap{\overrightarrow{\phantom{#1\mkern11mu}}}%
\overrightarrow{#1}}

\begin{document}
$\Overrightarrow{x}$
\end{document}


-
This works great, and the \mathrlap is a keeper! – parzan Sep 19 '11 at 14:48

In the MWE below, the user command to create double-right-pointing arrow accents is \overdoublerightarrow. Its definition uses the LaTeX commands \overset and \DeclareMathSymbol and relies on the fact that the double-right arrow resides in slot "10 of the AMSa symbols. (The precise definitions may be found in the file amssymb.sty.) Finally, I use the command \textstyle because the default style of accent symbols is \scriptstyle, which looks much too skinny.

\documentclass{article}
\usepackage{amsmath,amssymb}
\DeclareMathSymbol{\Doublerightarrow}{\mathalpha}{AMSa}{"10}
\newcommand\overdoublerightarrow[1]{%
\overset{\textstyle\Doublerightarrow}{#1}}
\begin{document}
$\overrightarrow{z}$ $\overrightarrow{A}$

$\overdoublerightarrow{z}$ $\overdoublerightarrow{A}$
\end{document}


-
Thanks for the answer! However it does not help me - I am looking for the analogue of \twoheadrightarrow (two arrowheads on the right) and not of \leftrightarrow (one arrowhead on each side). – parzan Sep 19 '11 at 9:16
Oops, I misunderstood what you meant to say by "twoheaded" arrows. (I thought you wanted one arrowhead each going in two directions, rather than two arrowheads pointing in the same direction.) Let me change my answer. – Mico Sep 19 '11 at 9:22
I've now succeeded in redoing my answer. Sorry for the delay -- my ISP's service was down for several hours. :-( – Mico Sep 19 '11 at 11:53
This works great - many thanks! – parzan Sep 19 '11 at 14:47
Glad you like it! Just remember: if you want to make the arrows just a bit smaller than they appear in the answer above, just remove the \textstyle instruction; if you want to make them a lot smaller, replace \textstyle with scriptscriptstyle. Happy TeXing! – Mico Sep 19 '11 at 17:36