# How to write physical units

Units have to be written in an upright font. One normally does it this way:

$1.2 \times 10^3\,\mathrm{\frac{J}{mol}}$

$1.2 \times 10^3\,\mathrm{\frac{J}{mol}}$

Is there another way, with less typing?

• Can we please not promote display-style fractions (\frac{}{}) for units? It is really bad style, not recommended by most scientific style guides…
– F'x
Aug 9, 2016 at 21:52
• @F'x The display-style fractions “$\displaystyle C_{\mathrm m,p} = 33.58\ \mathrm{\frac{J}{K \cdot mol}}$” are actually in accordance with the SI as well as ISO 80000. However, you are right that the relevant style guides stipulate that, where it is necessary to include fractions in the body text, they shall be reduced to a single level by using a solidus (/) or, where applicable, the negative index: “$C_{\mathrm m,p} = 33.58\ \mathrm{J/(K \cdot mol)}$” or “$C_{\mathrm m,p} = 33.58\ \mathrm{J\cdot K^{-1} \cdot mol^{-1}}$”.
– user7951
Aug 9, 2016 at 22:13
• Anyway, the small inline style of MathJax “$C_{\mathrm m,p} = 33.58\ \mathrm{\frac{J}{K \cdot mol}}$” is only a makeshift solution and not proper typography.
– user7951
Aug 9, 2016 at 22:13
• Furthermore, there is no reference for the use of a small space \, for units in the SI guidelines, ISO and other standards, and IUPAC recommendations. They only stipulate the use of "a space".
– user7951
Aug 9, 2016 at 22:16
• Interesting point. For decades, quantity and and have been separated by \, in LaTeX, going back to Knuth and explained in countless books. tex.stackexchange.com/a/128053/73371 states that ISO and SI only talk about spaces in general, but not their width and only an unofficial translation of the SI standard lead to the indirect interpretation to have a normal space between quantity and unit. siunitxchanged to a normal space in 2014. Aug 10, 2016 at 4:57

Instead of \mathrm many people misused \ce, because it was shorter to type. Seeing this, the author of \ce added a little goodie into the mhchem extension. You can type

$\pu{1.2E3 J//mol}$

$\pu{1.2E3 J//mol}$

From the documentation:

Multiplication

\pu{123 J s} $\pu{123 J s}$

\pu{123 J*s} $\pu{123 J*s}$

Division

$\pu{123 kJ/mol}$ $\pu{123 kJ/mol}$

$\pu{123 kJ//mol}$ $\pu{123 kJ//mol}$

$\pu{123 kJ mol-1}$ $\pu{123 kJ mol-1}$
(mol-1 = mol^{-1} = mol^-1)

$\pu{123 kJ*mol-1}$ $\pu{123 kJ*mol-1}$

$\pu{123 cm3}$ $\pu{123 m3}$
(cm3 = cm^{3} = cm^3)

Scientific Notation

$\pu{1.2e3 kJ}$ $\pu{1.2e3 kJ}$

$\pu{1.2E3 kJ}$ $\pu{1.2E3 kJ}$

• This is very convenient! However, the current Stack Exchange Android App (Version 1.0.89) does not render \pu, but casts an error: Undefined control sequence \pu. Tested on a Fire 7 tablet with FireOS 5.3.2.o with added Google Play Store. Nov 19, 2016 at 6:08
• Could you add in the next version that \circ will be automatically raised, or some kind of shortcut for degree? That would be grand :D May 23, 2017 at 10:13
• @Martin-マーチン $\pu{15 ^\circ C}$ and $\pu{15 ^oC}$ work. Or do you mean geometrical degrees? They are not included yet (and strictly speaking, they are no physical unit). May 23, 2017 at 15:04