2

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!enter image description here

3

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} 

enter image description here

1

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

enter image description here

although I expect the accents package is more robust.

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

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.