Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
\begin{equation}
\num{1}\si{\becquerel} = \num{2.703d11}\si{\curie} \\
\end{equation}

% spaces before units
\begin{equation}
\num{1}\si{ \becquerel} = \num{2.703d11}\si{ \curie} \\
\end{equation}

% spaces after number
\begin{equation}
\num{1} \si{\becquerel} = \num{2.703d11} \si{\curie} \\
\end{equation}

\end{document}
share|improve this question

2 Answers 2

up vote 10 down vote accepted

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.

share|improve this answer

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

\documentclass{article}

\usepackage{siunitx}

\begin{document}

\begin{equation}
  \SI{1.234}{\m\per\square\s}
\end{equation}

\end{document}

output

Another possibility (but not a recommended one) is

\documentclass{article}

\usepackage{siunitx}

\begin{document}

\begin{equation}
  \num{1.234}\,\si{\m\per\square\s}
\end{equation}

\end{document}

output

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.