37

I was reviewing What packages do people load by default in LaTeX?, and noticed that the siunitx package was recommended. I have been using \usepackage[mediumspace,mediumqspace,squaren,binary]{SIunits}.

So, what are the differences between these two packages? Has the SIUnits been deprecated? Are there anything to watch out for when switching from SIUnits to siunitx?

Ideally I would like to use a package that takes care of non-SI units as well, such as miles, lbs, Fahrenheit temperature, etc.

1

2 Answers 2

39

To add to Seamus's answer, siunitx combines the functionality of SIstyle and SIunits, hence having a new name. As a result, both SIstyle and SIunits now have 'bug-fix only' status.

siunitx can operate in two ways. The recommended way is to require that units are used within the arguments to macros \SI and \si:

\SI{10}{\metre}
\si{\kilogram\metre\per\second} % Note no `\usk' here

It is possible to load the package such that 'free-standing' units are defined (\usepackage[free-standing-units]{siunitx}), but this can lead to some macro-naming awkwardness and also makes some functions less reliable.

The package defines a number of units 'out of the box', but these are all SI units. For the next release (v2.3), I will be adding abbreviated units to the set that are defined automatically (currently these are a load-time option):

\SI{13.4}{\kg\per\V}

Binary units are available as a load-time option. (I may make these automatic for v2.3: I have not yet decided.) New units can be defined in the preamble

\DeclareSIUnit\lb{lb}
...
\SI{100}{\lb}

or you can include units without any definition

\SI{60}{mph}
\SI{100}{\SIUnitSymbolDegree F}
\si{psi}

Settings in siunitx are controlled by the \sisetup macro. For the spacing you load with SIunits, the options needed are

\sisetup{number-unit-product = \:, inter-unit-product = \:}
4
  • OK, looks like I need to transition to siunitx. What does the Note no '\usk' here comment referring to? Commented Jun 30, 2011 at 0:26
  • @Peter: It is possible to define a relatively short 'translation' layer - I can add that to the answer if you like. The \usk macro is required in SIunits where there is a product of units, but siunitx does not require such a macro.
    – Joseph Wright
    Commented Jun 30, 2011 at 5:51
  • Anything that helps with the transition would be helpful as long as it is not too much work... Commented Jun 30, 2011 at 7:10
  • @Peter: Looking back through my notes, I remember now that this is not so straight-forward. Perhaps you might post a follow-up question, showing how you use SIunits, and I can answer the more limited 'how are these particular things done' question.
    – Joseph Wright
    Commented Jun 30, 2011 at 7:49
12

siunitx is written by Joseph Wright who did, for a time, maintain SIunits. siunitx replaces SIunits and another package called SIstyle. It is a complete reimplementation of the basic idea.

It can handle non-SI units with ease. The documentation has the details of how to define new units.

2
  • 1
    Indeed, I still am (in a formal sense) the maintainer of SIunits, which I took over around the time siunitx development started.
    – Joseph Wright
    Commented Jun 29, 2011 at 21:07
  • @Joseph I thought so: I read your recent TUGboat article about it...
    – Seamus
    Commented Jun 30, 2011 at 10:13

You must log in to answer this question.

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