I recently begun to worry about using \vec
on numbers. The arrow is both off-center and slanted, which only works for italics. Is there a simple command to typeset number vectors properly?
$\vec{x}$ % ok
$\vec{0}$ % not ok
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI recently begun to worry about using \vec
on numbers. The arrow is both off-center and slanted, which only works for italics. Is there a simple command to typeset number vectors properly?
$\vec{x}$ % ok
$\vec{0}$ % not ok
If you are prepared to compile with lualatex then you can use the unicode-math
package:
\documentclass{article}
\usepackage{unicode-math}
\begin{document}
\( \vec x \)
\( \vec 0 \)
\end{document}
Depending on your text font, in pdflatex
you could use the package MnSymbol
, this fits with Minion Pro and related fonts.
Using the package esvect
, you get the new command \vv{}
, which not only solves your problem of slanted arrow, but can also be used for vectors above multiple letters. The package takes a letter (from a to h) as an option to customize the arrow type.
\documentclass{article}
\usepackage[b]{esvect}
\begin{document}
$\vv{0}$
\end{document}