18

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.

22

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}
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.