# Unit spacing with siunitx in an equation

I'm just starting to get to grips with the siunitx package, but I've noticed that there seems to be some issues with regards to unit notation spacing in an equation. With siunitx it is possible to put a space between the numerical value and the unit by leaving a space after the number of before the unit (e.g., \num{3.7d10} \si{\becquerel} or \num{3.7d10}\si{ \becquerel}).

However, when I do this in equation mode there doesn't seem to be a way to create a space between the number and the unit. Am I missing something, or is this an inherent fault/problem?

\documentclass[12pt,a4paper]{report}
% International language package - allows use of special characters
\usepackage[utf8]{inputenc}
% Line spacing package - allows user to set line spacing
\usepackage{amsmath}
% Graphics package - allows document to include various graphics files
\usepackage{chemformula}
% SI Unit package - allows for standard unit notation
\usepackage{siunitx}
\DeclareSIUnit\curie{Ci}

\begin{document}

% no spaces
\num{3.7d10}\si{\becquerel} \\

% space before unit
\num{3.7d10}\si{ \becquerel} \\

% space after number
\num{3.7d10} \si{\becquerel} \\

% no spaces
$$\num{1}\si{\becquerel} = \num{2.703d11}\si{\curie} \\$$

% spaces before units
$$\num{1}\si{ \becquerel} = \num{2.703d11}\si{ \curie} \\$$

% spaces after number
$$\num{1} \si{\becquerel} = \num{2.703d11} \si{\curie} \\$$

\end{document}

-

When you're typesetting a numerical quantity with units, you're supposed to use the \SI macro:

\SI{3.7d10}{\becquerel}


That effectively formats the first argument using \num, the second using \si, and inserts the proper spacing between them, even when typesetting an equation (i.e. when in math mode).

Normally spaces are ignored in math mode, so that you can write e.g. 3\times 10 or 3 \times 10 and the result will be the same.

-

Unless I'm missing something obvious, you can just use

\documentclass{article}

\usepackage{siunitx}

\begin{document}

$$\SI{1.234}{\m\per\square\s}$$

\end{document}


Another possibility (but not a recommended one) is

\documentclass{article}

\usepackage{siunitx}

\begin{document}

$$\num{1.234}\,\si{\m\per\square\s}$$

\end{document}


The second approach should only be used if you want to alignment points at both the numbers and the units, as shown here.

-