# Rendering units in MathJaX

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.

• Is this what you mean: $\mathrm{m.s^{-2}}$ $\mathrm{m.s^{-2}}$ – jippie Oct 28 '13 at 6:16
• @jippie: Yes, that does the trick. D'oh. – Li-aung Yip Oct 28 '13 at 8:26
• – Always Confused May 23 '17 at 17:34

Use \mathrm for roman font