Math & ScienceLarge Arrow on top of Symbol

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
marcdein
Posts: 40
Joined: Sat Dec 19, 2009 2:11 pm

Large Arrow on top of Symbol

Post by marcdein »

How can I display a large arrow on top of a symbol? I need something like \vec, but with a longer arrow which extends over a longer symbol. For example, $\vec X_+$ only displays the arrow on top of the X, but I need it to extend over the whole symbol $X_+$.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Large Arrow on top of Symbol

Post by Frits »

Try the following:

Code: Select all

\documentclass{article}
\renewcommand{\vec}[1]{\overrightarrow{#1}}
\begin{document}
$\vec{xy}$
\end{document}
For the standard LaTeX font (Computer Modern), this solution isn't very neat (as shown in this post).
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
marcdein
Posts: 40
Joined: Sat Dec 19, 2009 2:11 pm

Re: Large Arrow on top of Symbol

Post by marcdein »

Thanks, but isn't there a way to display an arrow that looks more like the one you get with \vec?
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Large Arrow on top of Symbol

Post by Frits »

As far as I know, there is no symbol like that. Also note that the arrow over symbols is used mainly for handwritten vectors. In literature, you mostly find vectors to be bold. Consider this then:

Code: Select all

\renewcommand{\vec}[1]{\ensuremath{\boldsymbol{#1}}}
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
maxmax
Posts: 29
Joined: Sat Sep 03, 2011 11:19 am

Large Arrow on top of Symbol

Post by maxmax »

I've had the same problem some time ago.

Code: Select all

\vec{e_x}
looks bad because the arrow is too small. Now i use

Code: Select all

\vec{e}_x
which looks much better.

But clearly this isn't suitable if the arrow has to be extended over the whole term.
Post Reply