17
$\begingroup$

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}}$

(see Hidden points of editing you probably didn't know)

Is there another way, with less typing?

$\endgroup$
5
  • 1
    $\begingroup$ Can we please not promote display-style fractions (\frac{}{}) for units? It is really bad style, not recommended by most scientific style guides… $\endgroup$
    – F'x
    Commented Aug 9, 2016 at 21:52
  • 2
    $\begingroup$ @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}}$”. $\endgroup$
    – user7951
    Commented Aug 9, 2016 at 22:13
  • 1
    $\begingroup$ 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. $\endgroup$
    – user7951
    Commented Aug 9, 2016 at 22:13
  • 1
    $\begingroup$ 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". $\endgroup$
    – user7951
    Commented Aug 9, 2016 at 22:16
  • 2
    $\begingroup$ 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. $\endgroup$
    – mhchem
    Commented Aug 10, 2016 at 4:57

1 Answer 1

19
$\begingroup$

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}$

$\endgroup$
3
  • 6
    $\begingroup$ 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. $\endgroup$ Commented Nov 19, 2016 at 6:08
  • 2
    $\begingroup$ 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 $\endgroup$ Commented May 23, 2017 at 10:13
  • 2
    $\begingroup$ @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). $\endgroup$
    – mhchem
    Commented May 23, 2017 at 15:04

You must log in to answer this question.

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