4
\$\begingroup\$

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.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ Is this what you mean: \$\mathrm{m.s^{-2}}\$ \$\mathrm{m.s^{-2}}\$ \$\endgroup\$
    – jippie
    Commented Oct 28, 2013 at 6:16
  • \$\begingroup\$ @jippie: Yes, that does the trick. D'oh. \$\endgroup\$ Commented Oct 28, 2013 at 8:26
  • \$\begingroup\$ related: chemistry.meta.stackexchange.com/questions/3286/… \$\endgroup\$
    – user107801
    Commented May 23, 2017 at 17:34

1 Answer 1

2
\$\begingroup\$

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.

Fonts
Use \mathrm for roman font

\$\endgroup\$

You must log in to answer this question.

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