# Vectors with Arrow Under Symbol

My professor uses arrows below the symbol to denote vectors (example below), and I couldn't figure out how to do this in LaTeX. I tried

\renewcommand{\vec}[1]{\underset{\rightarrow}{#1}}


but it takes up too much space below the symbol. Is there a way to typeset this, similar to the undertilde package?

Thanks!

You can do that with the accents package:

\documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage{accents}
\newcommand\undervec[1]{\underaccent{\vec}{#1}}

\begin{document}

${\undervec{ω}}_{21}= \undervec{\mathcal F}_2^{T}{ω_{21}}$%

\end{document}


You can also do this without any extra packages just by fiddling with boxes.

\documentclass{article}
\mathchardef\arr="017E % character 7E from textfont 1 is the vector arrow
\renewcommand\vec[1]{\setbox0=\hbox{$#1$}\lower2ex\hbox to 0pt{\hbox to \wd0{\hss$\arr\;$\hss}\hss}\box0}
\begin{document}
$\vec\omega_{21} = \vec{\mathcal F}_2^T \omega_{21}= \vec i$
\end{document}


to produce

although I expect the accents package is more robust.

• please don't give bad examples using $$…$$ :o; in LaTeX documents. Sep 28 '14 at 22:10
• was it just the  or is the rest bad too? Sep 29 '14 at 7:25
• It was just that, the rest is fine. Sep 29 '14 at 8:05