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.

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?

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted
\documentclass{article}
\usepackage{mathtools}
\def\Overrightarrow#1{\mathrlap{\overrightarrow{\phantom{#1\mkern11mu}}}%
  \overrightarrow{#1}}

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

enter image description here

share|improve this answer
    
This works great, and the \mathrlap is a keeper! –  parzan Sep 19 '11 at 14:48
add comment

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} 

enter image description here

share|improve this answer
1  
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
1  
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
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.