LaTeX \rm vs. \mathrm: tilde instead of vector arrow when using \vec

I encountered an issue which seemed to be weird at first:

When trying to draw a vector arrow over a character, pdflatex got me a tilde instead.

\vec F=\frac{\rm{d}(m\vec{v})}{\rm{d}t}

\displaystyle{\vec F=\frac{\rm{d}(m\vec{v})}{\rm{d}t}}

Suspected problem: in a rm/mathrm/mathbf typeface style environment, the \vec command doesn’t appear to work correctly.

Real problem: Scope!

Be aware of  the differences in usage between \mathrm and \rm
Note that the following syntax sets text in an roman typeface:

  • \mathrm{ text }    or     {\rm text }


  • \rm{ text }

sets text *and* all the following characters in a roman typeface, until the next closing curved brace is reached!


Set correct scope for typeface style
\vec F=\frac{{\rm d}(m\vec{v})}{\rm{d}t}

\displaystyle{\vec F=\frac{{\rm d}(m\vec{v})}{\rm{d}t}}

Or with \mathrm instead of \rm
\vec F=\frac{\mathrm{d}(m\vec{v})}{\mathrm{d}t}

\displaystyle{\vec F=\frac{\mathrm{d}(m\vec{v})}{\mathrm{d}t}}



  1. Tr

    Thank you!
    resolved my issue.
    also extra “{}” can be used

  2. August

    ah! so \rm usage is different

  3. s1eg3

    I’d suggest using \operatorname{} instead — besides the fact, that you match syntax and semantics, it is typeset better.
    Requires amsmath afaik.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: