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.

Apologies for the cryptic title, but I was not sure how best to phrase the question in one sentence. I am essentially trying the create a vector symbol with \rightharpoonup as the top instead of the arrow.

The output to the following code will feature an overset harpoon over x, next to a simple \bar{x}. Observe that on the left, the top symbol is significantly higher and bigger than on the right one.

\documentclass{article}

\usepackage{amsmath,amsfonts,amsthm,amssymb}

\newcommand{\vect}[1]{\overset{\rightharpoonup}{#1}}

\begin{document}
$$
\vect{x} \quad \bar{x}
$$
\end{document}

I would like to create something that looks in every way like the right hand symbol, except using something that looks like \rightharpoonup at the top.

If this command sequence already exists in LaTeX, please use that as an answer, because I have searched for and failed to find it so far.

share|improve this question

1 Answer 1

up vote 12 down vote accepted

This is a clear case for \accentset from the accents package:

output

\documentclass{article}
\usepackage{accents}
\newcommand{\vect}[1]{\accentset{\rightharpoonup}{#1}}
\begin{document}
$\vect{x}$
\end{document}
share|improve this answer
    
I have no idea how I would have discovered that package without prior knowledge, but this definitely solves the problem! –  merlin2011 Jan 31 '13 at 9:38

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.