Questions tagged [siunitx]

{siunitx} is a package that provides consistent typesetting of physical quantities, allowing application of various typographic conventions with the same input syntax. This package replaces the deprecated {siunits} package.

siunitx is a package that provides consistent typesetting of physical quantities (in SI units and their derivatives). Adjusting the package options allows following a specific non-standard set of typographic requirements with the same input syntax.

The package processes numbers and units automatically, and provides a column format for aligning numbers and units in a table.

The package is a successor to , which now has few uses and is widely considered to be obsolete.

Basic usage

The package provides the following typesetting macros:

  • \num[<options>]{<number>} for numbers,
  • \ang[<options>]{<angle>} for angles,
  • \si[<options>]{<unit>} for units,
  • \SI[<options>]{<number>}[<pre-unit>]{<unit>} for the combination of numbers and units,
  • various …list and …range variants.

The macro \sisetup can be used to change settings globally.

For tables exist the column specifications

  • S[<options>] for numbers, and
  • s[<options>] for units, and also
  • a \tablenum[<options>][<number>] macro that mimics the functions of the S column.

Resources

The siunitx package is hosted by CTAN as package http://ctan.org/pkg/siunitx and is developed by Joseph Wright, who provides news about the packages plans and progress at his weblog.

1615 questions
38
votes
2 answers

Why do the standard siunitx settings not detect font weight?

Using KOMA-script I got a bold font for chapter/section titles. I had a unit, \SI{1}{\something}, in one of them which was not set in bold font. Giving siunitx the following options detect-weight=true, detect-family=true helped. Probably there are…
Somebody
  • 1,217
37
votes
1 answer

Defining new unit (year, century) in siunitx

I'm having a hard time figuring out the LaTeX commands to define new units of year and century in siunitx. I'd like to write \SI{3}{\cm\per\year} and have it show: 3 cm yr-1, or \SI{42}{\micro\meter\per\century} become 4.2E-5 m/century
mankoff
  • 2,756
37
votes
2 answers

Differences between SIunits and siunitx packages

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…
Peter Grill
  • 223,288
36
votes
1 answer

How to set the precision in numbers

I include the number as \num{0.12368455}. I need to print '0.1237'. How to do this...
sandu
  • 7,950
28
votes
2 answers

Preserving thousands separator with siunitx

I'm writing a paper and my advisor is requiring that all large numbers have a comma as a thousands separator. I've read this question which asks about how to make siunitx not throw errors when there is a comma in the input, but how can I force a…
tpg2114
  • 1,403
26
votes
2 answers

How to format SI units?

I get 1.0 Nm. But how to get 1.0 N.m \documentclass{article} \usepackage{siunitx} \begin{document} \SI{1.0}{\newton\meter}\\ 1.0~N$\cdot$m \end{document}
sandu
  • 7,950
21
votes
1 answer

siunitx 3 "quotient-mode" has been removed in this release

With the upgrade to version 3.0.0 of siunitx it is no longer possible to use fractions in units. Consider this minimal example: \documentclass{article} \usepackage{siunitx} \sisetup{ quotient-mode = fraction, } \begin{document} \num{7 /…
Claudio
  • 2,007
21
votes
1 answer

How can I typeset Greek letters in siunitx?

I want to use a Greek letter as the variable with the unit, and I am using siunitx to do it. The code below cannot be successfully compiled in…
Ice0cean
  • 1,646
21
votes
3 answers

How to use SIrange in math mode

I cannot figure out which of the siunitx font options is the correct to typset the rangephrase when using SIrange in math mode the same way as in text mode. See the MWE \documentclass{book} \usepackage{siunitx} \sisetup{mode=text} % does NOT have…
21
votes
1 answer

Print \frac{4}{3} m/s using the SI unit package

How do I print \frac{4}{3} m/s using the siunitx package? $\SI{\frac{4}{3}}{m/s}$ gives an error.
21
votes
1 answer

"Pretty-printing" numbers redux: engineering notation

Awhile ago I discovered the siunitx package as an answer to this question and it kind of blew my mind. For instance, if I'm using fp to compute a numerical result (in, say, a homework solution), then I can do the…
20
votes
2 answers

Expressing capital M for molar in siunitx package

The following code isn't valid but conveys my intention: \SI{}{\micro\molar} as in micro followed by a big M. I don't want to use the explicit form of micro moles per L raised to the negative one in this case.
ptrcao
  • 6,603
19
votes
1 answer

Why has m/s changed in siunitx package?

I would have expected \meter\per\second to generate an output m/s. But when using the package siunitx the output is similar to ms^-1. I referred the documentation for the package and there too the latter is presented. What may be the reason for…
Shashank Sawant
  • 6,557
  • 11
  • 37
  • 49
19
votes
1 answer

Print "< .001" in table with siunitx

I have a table where one column are p values. p values should be formatted without leading zero, and if they are smaller than .001, they should be reported as "< .001". Numbers should be aligned at the decimal point. A similar question is here:…
Felix S
  • 323
  • 1
  • 6
18
votes
1 answer

The siunitx package messes with manually input thousand-separators

Recently I found the very useful siunitx package, and immediately looked to use it for some tables. Unfortunately, I already have all my numbers typeset with , thousand separator and . decimal separator. If I try something like: …
badroit
  • 7,557
1
2 3
27 28