Graphics, Figures & TablesError using siunitx

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
luis
Posts: 14
Joined: Wed Dec 30, 2009 9:03 pm

Error using siunitx

Post by luis »

Dear all,

I'm trying to align numbers in a table using siunitx. With this small example:

Code: Select all

\documentclass{article}

\usepackage{siunitx}

\begin{document}
\begin{tabular}{S[table-format=3.2]}% syntax for siunitx v2; for v1 use "tabformat"
555 \\
7.77 \\
99.9
\end{tabular}

\end{document}
I'm getting this output:

Code: Select all

$ pdflatex numbers.tex 
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
 restricted \write18 enabled.
entering extended mode
(./numbers.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (./siunitx.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/share/texmf/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/share/texmf/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/share/texmf/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex))))
(./numbers.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd)

! Package siunitx Error: Unknown option `table-format'.

See the siunitx package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.7 5
     55 \\
? 
I have also tried with tabformat in place of table-format, but the result is the same.

Am I missing something? Beyond siunitx, is there any other package that does the same?

Thank you.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Error using siunitx

Post by cgnieder »

The example works fine as you can verify yourself by clicking on the OPEN IN WRITELATEX button right above your MWE.

You're probably using an out of date version of siunitx which is too old and hence doesn't recognize the option. If you add \listfiles to the preamble the version that is used will be written to the log file. On my system the relevant line is

Code: Select all

siunitx.sty    2013/07/31 v2.5s A comprehensive (SI) units package
Regards
site moderator & package author
luis
Posts: 14
Joined: Wed Dec 30, 2009 9:03 pm

Re: Error using siunitx

Post by luis »

Thanks cgnieder, indeed I was using Tex Live 2009, an outdated version that is still bundled with Ubuntu 12.04.
Post Reply