How does one go about rendering units properly in MathJaX?

For example,

$$ 100 N.m,\ \ 3 \times 10^8 m.s^{-1} $$

It's conventional to typeset units in upright (non-italic) font, as in:

$$ 100 \textrm{ N.m},\ \ 3 \times 10^8 \textrm{m}.\textrm{s}^{-1} $$

In LaTeX, you might import units siunits or siunitx for this, but those packages don't exit in MathJax.

You can kind-of do it using \textrm{} but this doesn't play nice with superscripts. For example 9.81 \textrm{m.s^{-2}} comes out as

$$ 9.81 \textrm{m.s^{-2}} $$

which is not quite as desired.


1 Answer 1


I can never remember the URL for MathJax basic tutorial and quick reference so I google for "mathjax stackexchange".

I should maybe add a bookmark.

Use \mathrm for roman font


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .