Unit & Pengukuran

Darjah, unit SI, pemalar fizikal, dan simbol pengukuran.

Units in LaTeX: siunitx, degree symbol and SI units

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.

Quick reference: units with and without siunitx

SymbolCommandUsePackageCopy
9.81 m s−29.81\,\mathrm{m\,s^{-2}}
\qty{9.81}{\metre\per\second\squared}Quantity with a unitsiunitx
kg\mathrm{kg}
\unit{\kilo\gram}Unit on its ownsiunitx
6.022×10236.022 \times 10^{23}
\num{6.022e23}Formatted numbersiunitx
20 ∘C20\,{}^{\circ}\mathrm{C}
\qty{20}{\degreeCelsius}Degrees Celsiussiunitx
45∘45^{\circ}
\ang{45}Angle in degreessiunitx
10 µm10\,\text{µm}
\qty{10}{\micro\metre}SI prefix (micrometre)siunitx
5 kΩ5\,\mathrm{k}\Omega
\qty{5}{\kilo\ohm}Kiloohmsiunitx
9.81 m/s29.81\,\mathrm{m/s^2}
9.81\,\mathrm{m/s^2}Units by hand, no packagebuilt in
90∘90^\circ
^\circDegree sign in math modebuilt in
A˚\text{\AA}
\AAAngstrom (text mode)built in
°\text{°}
\textdegreeDegree sign in text modebuilt in
ℏ\hbar
\hbarReduced Planck constantbuilt in
\usepackage{siunitx}

The sample was heated to \qty{350}{\kelvin} at \qty{2.5}{\kilo\pascal}.

Frequently asked questions about units in LaTeX

How do I write units in LaTeX?
Load \usepackage{siunitx} and write \qty{3.0}{\metre\per\second} for a value with a unit, \unit{\kilo\gram} for a unit alone and \num{1.5e-3} for a number. siunitx version 3 uses \qty and \unit; the older \SI and \si still work. Without the package, write 3.0\,\mathrm{m/s}.
How do I write the degree symbol in LaTeX?
In math mode use a superscript circle: $90^\circ$, or $20^\circ\mathrm{C}$ for temperature. In text, \textdegree prints °. With siunitx, \ang{90} and \qty{20}{\degreeCelsius} give consistent spacing everywhere.
Does siunitx conflict with the physics package?
Both packages define a \qty command, so loading them together leads to a clash. If you need physics, use the older siunitx form \SI{9.81}{\metre\per\second\squared}, which siunitx version 3 still supports, for quantities with units.
∘^{\circ}

Degree

^{\circ}
A˚\text{\AA}

Angstrom

\text{\AA}
μ\mu
Ω\Omega

Ohm

\Omega
ℏ\hbar
∘C^{\circ}\text{C}

Celsius

^{\circ}\text{C}
∘F^{\circ}\text{F}

Fahrenheit

^{\circ}\text{F}
K\text{K}

Kelvin

\text{K}
m\text{m}

Meter

\text{m}
kg\text{kg}

Kilogram

\text{kg}
s\text{s}

Second

\text{s}
A\text{A}

Ampere

\text{A}
V\text{V}

Volt

\text{V}
W\text{W}

Watt

\text{W}
J\text{J}

Joule

\text{J}
N\text{N}

Newton

\text{N}
Pa\text{Pa}

Pascal

\text{Pa}
Hz\text{Hz}

Hertz

\text{Hz}
//
2^2
3^3