Units in LaTeX are easiest with the siunitx package: \qty{9.81}{\metre\per\second\squared} typesets a number and its unit with upright letters and correct spacing, \unit{\kilo\gram} prints a unit alone, and \num{6.022e23} formats a number. Without siunitx, set units upright by hand, as in 9.81\,\mathrm{m/s^2}, with a thin space \, between number and unit. The degree symbol is ^\circ in math or \qty{20}{\degreeCelsius} with siunitx, and the angstrom is \AA. The table lists the unit commands people use most, with the package each one needs; the full list follows below.
| Symbol | Command | Use | Package | Copy |
|---|---|---|---|---|
\qty{9.81}{\metre\per\second\squared} | Quantity with a unit | siunitx | ||
\unit{\kilo\gram} | Unit on its own | siunitx | ||
\num{6.022e23} | Formatted number | siunitx | ||
\qty{20}{\degreeCelsius} | Degrees Celsius | siunitx | ||
\ang{45} | Angle in degrees | siunitx | ||
\qty{10}{\micro\metre} | SI prefix (micrometre) | siunitx | ||
\qty{5}{\kilo\ohm} | Kiloohm | siunitx | ||
9.81\,\mathrm{m/s^2} | Units by hand, no package | built in | ||
^\circ | Degree sign in math mode | built in | ||
\AA | Angstrom (text mode) | built in | ||
\textdegree | Degree sign in text mode | built in | ||
\hbar | Reduced Planck constant | built in |
\usepackage{siunitx}
The sample was heated to \qty{350}{\kelvin} at \qty{2.5}{\kilo\pascal}.^{\circ}\text{\AA}\mu\Omega\hbar^{\circ}\text{C}^{\circ}\text{F}\text{K}\text{m}\text{kg}\text{s}\text{A}\text{V}\text{W}\text{J}\text{N}\text{Pa}\text{Hz}/^2^3