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 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.

share|improve this question
2  
Here is a useful summary of what packages should be used to typeset units. –  Peter Grill Jul 2 '11 at 19:53

2 Answers 2

up vote 23 down vote accepted

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 = \:}
share|improve this answer
    
OK, looks like I need to transition to siunitx. What does the Note no '\usk' here comment referring to? –  Peter Grill Jun 30 '11 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 Jun 30 '11 at 5:51
    
Anything that helps with the transition would be helpful as long as it is not too much work... –  Peter Grill Jun 30 '11 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 Jun 30 '11 at 7:49

siunitx is written by Joseph Wright who did, for a time, maintain SIunits (if, I'm not mistaken? Joseph is a contributor here so he'll correct me if I'm wrong.) siunitx replaces SIunits and another package called something like 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.

share|improve this answer
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 Jun 29 '11 at 21:07
    
@Joseph I thought so: I read your recent TUGboat article about it... –  Seamus Jun 30 '11 at 10:13

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.