% \iffalse meta-comment % % Copyright (C) 2008 by % Joseph Wright % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either % version 1.3c of this license or (at your option) any later % version. The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions of % LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. % % The current maintainer of this work is Joseph Wright. % % This work consists of the source file siunitx.dtx % and the derived files siunitx.ins, % siunitx.sty, % jawltxdoc.sty, % si-bug.ltx, % si-SIunits.cfg, % si-sistyle.cfg, % si-unitsdef.cfg, % si-units.cfg, % si-hepunits.cfg, % si-fancynum.cfg, % si-fancyunits.cfg, % si-prefix.cfg, % si-named.cfg, % si-prefixed.cfg, % si-addn.cfg, % si-accepted.cfg, % si-physical.cfg, % si-abbr.cfg, % si-synchem.cfg, % si-hep.cfg, % si-astro.cfg, % si-binary.cfg, % si-UK.cfg, % si-USA.cfg, % si-DE.cfg, % si-ZA.cfg, % siunitx.bib and % siunitx.pdf % % TDS-ready files: % The compressed file siunitx.tds.zip contains an unpacked version % of all of the files included here, and pre-compiled % documentation in PDF format. Simply decompress siunitx.tds.dtx % in your local TeX directory, run your hash program (texhash, % initexmf --update-fndb, etc.) and everything will be ready to % go. % % Unpacking: % (a) If siunitx.ins is present: % tex siunitx.ins % (b) Without siunitx.ins: % tex siunitx.dtx % (c) If you use LaTeX to generate files: % latex \let\install=y\input{siunitx.dtx} % % Documentation: % (a) Without write18 enabled: % pdflatex siunitx.dtx % bibtex8 --wolfgang siunitx % makeindex -s gind.ist siunitx.idx % makeindex -s gglo.ist -o siunitx.gls siunitx.glo % pdflatex siunitx.dtx % pdflatex siunitx.dtx % (b) With write18 enabled: % pdflatex siunitx.dtx % pdflatex siunitx.dtx % pdflatex siunitx.dtx % % Installation: % Copy siunitx.sty and the various .cfg files to a location % searched by TeX, and if required by your TeX installation, % run the appropriate command to build a hash of files % (texhash, initexmf --update-fndb, etc.) % % Note: % The jawltxdoc.sty file is not needed for installation, % only for building the documentation; it may be deleted % after producing the documentation (if necessary). % %<*ignore> % This is all taken verbatim from Heiko Oberdiek's packages \begingroup \def\x{LaTeX2e}% \expandafter\endgroup \ifcase 0\ifx\install y1\fi\expandafter \ifx\csname processbatchFile\endcsname\relax\else1\fi \ifx\fmtname\x\else 1\fi\relax \else\csname fi\endcsname % %<*install> \input docstrip.tex \keepsilent \askforoverwritefalse \preamble ---------------------------------------------------------------- The siunitx package --- A comprehensive (SI) units package Maintained by Joseph Wright E-mail: joseph.wright@morningstar2.co.uk Released under the LaTeX Project Public License v1.3c or later See http://www.latex-project.org/lppl.txt ---------------------------------------------------------------- \endpreamble \Msg{Generating siunitx files:} \generate{\file{jawltxdoc.sty}{\from{\jobname.dtx}{jawltxdoc}} } \usedir{tex/latex/siunitx} \generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}} } \usedir{source/latex/siunitx} \generate{\file{\jobname.ins}{\from{\jobname.dtx}{install}} } \usedir{doc/latex/siunitx} \generate{\file{si-bug.ltx}{\from{\jobname.dtx}{bug}} } \usedir{tex/latex/siunitx/config} \generate{\file{si-SIunits.cfg}{\from{\jobname.dtx}{SIunits}} \file{si-sistyle.cfg}{\from{\jobname.dtx}{sistyle}} \file{si-unitsdef.cfg}{\from{\jobname.dtx}{unitsdef}} \file{si-units.cfg}{\from{\jobname.dtx}{units}} \file{si-hepunits.cfg}{\from{\jobname.dtx}{hepunits}} \file{si-fancynum.cfg}{\from{\jobname.dtx}{fancynum}} \file{si-fancyunits.cfg}{\from{\jobname.dtx}{fancyunits}} } \generate{\file{si-prefix.cfg}{\from{\jobname.dtx}{prefix}} \file{si-named.cfg}{\from{\jobname.dtx}{named}} \file{si-prefixed.cfg}{\from{\jobname.dtx}{prefixed}} \file{si-addn.cfg}{\from{\jobname.dtx}{addn}} \file{si-accepted.cfg}{\from{\jobname.dtx}{accepted}} \file{si-physical.cfg}{\from{\jobname.dtx}{physical}} \file{si-abbr.cfg}{\from{\jobname.dtx}{abbr}} } \generate{\file{si-synchem.cfg}{\from{\jobname.dtx}{synchem}} \file{si-hep.cfg}{\from{\jobname.dtx}{hep}} \file{si-astro.cfg}{\from{\jobname.dtx}{astro}} \file{si-binary.cfg}{\from{\jobname.dtx}{binary}} } \generate{\file{si-UK.cfg}{\from{\jobname.dtx}{UK}} \file{si-USA.cfg}{\from{\jobname.dtx}{USA}} \file{si-DE.cfg}{\from{\jobname.dtx}{DE}} \file{si-ZA.cfg}{\from{\jobname.dtx}{ZA}} } \nopreamble\nopostamble \usedir{doc/latex/siunitx} \generate{\file{README.txt}{\from{\jobname.dtx}{readme}} \file{\jobname.bib}{\from{\jobname.dtx}{refs}} } \endbatchfile % %<*readme> ---------------------------------------------------------------- The siunitx package --- A comprehensive (SI) units package Maintained by Joseph Wright E-mail: joseph.wright@morningstar2.co.uk Released under the LaTeX Project Public License v1.3c or later See http://www.latex-project.org/lppl.txt ---------------------------------------------------------------- Typesetting values with units requires care to ensure that the combined mathematical meaning of the value plus unit combination is clear. In particular, the SI units system lays down a consistent set of units with rules on how these are to be used. However, different countries and publishers have differing conventions on the exact appearance of numbers (and units). The siunitx provides a set of tools for authors to typeset numbers and units in a consistent way. The package has an extended set of configuration options which make it possible to follow varying typographic conventions with the same input syntax. The package includes automated processing of numbers and units, and the ability to control tabular alignment of numbers. A number of LaTeX packages have been developed in the past for formatting units: SIunits, sistyle, unitsdef, unitspkg, fancyunits and fancynum. Support for users of all of these packages is available as emulation modules in siunitx. In addition, siunitx can carry out many of the functions of the dcolumn, rccol and numprint packages. % %<*ignore> \fi % Will Robertson's trick \immediate\write18{bibtex8 --wolfgang \jobname} \immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx} \immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo} % %<*driver> \PassOptionsToClass{a4paper}{article} \documentclass[german,english,UKenglish]{ltxdoc} \EnableCrossrefs \CodelineIndex \RecordChanges %\OnlyDescription % Various adjustments are needed to the packages loaded. xfrac is % only loaded if it is available. \usepackage[final]{graphicx} % Currently, xfrac is not working with expl3! %\IfFileExists{xfrac.sty} % {\usepackage{xfrac}} % {} \usepackage{jawltxdoc} \usepackage{textcomp,tikz,pgfplots,tocloft,datatool} \usepackage[latin1]{inputenc} \sisetup{ eVcorra=0.1ex, unitsep=cdot, alsoload={synchem,hep,binary,astro}, loctolang={UK:UKenglish,DE:german}} \setlength{\cftsubsecnumwidth}{2.5em} \begin{document} \DocInput{\jobname.dtx} \end{document} % % \fi % %\CheckSum{10226} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % %\GetFileInfo{\jobname.sty} % %\DoNotIndex{\@car,\@eha,\@ehc,\@empty,\@firstofone,\@firstoftwo} %\DoNotIndex{\@for,\@gobble,\@gobbletwo,\@ifl@aded,\@ifnextchar} %\DoNotIndex{\@ifpackagelater,\@ifpackageloaded,\@ifstar} %\DoNotIndex{\@ifundefined,\@makeother,\@namedef,\@nameuse,\@ne} %\DoNotIndex{\@nil,\@secondoftwo,\@temptokena,\@undefined,\AA} %\DoNotIndex{\active,\addto,\addtolength,\advance,\afterassignment} %\DoNotIndex{\aftergroup,\AtBeginDocument,\AtEndOfPackage} %\DoNotIndex{\begingroup,\bfseries,\bgroup,\boldmath,\box} %\DoNotIndex{\capitalring,\catcode,\cdot,\chardef,\check@mathfonts} %\DoNotIndex{\circ,\csname,\DeclareFontEncoding,\DeclareFontFamily} %\DoNotIndex{\DeclareFontShape,\DeclareFontSubstitution} %\DoNotIndex{\DeclareMathSymbol,\DeclareRobustCommand} %\DoNotIndex{\DeclareSymbolFont,\DeclareTextSymbol} %\DoNotIndex{\DeclareTextSymbolDefault,\def,\define@boolkey} %\DoNotIndex{\define@choicekey,\define@cmdkey,\define@cmdkeys} %\DoNotIndex{\define@key,\displaystyle,\displaywidth,\divide,\do} %\DoNotIndex{\edef,\egroup,\else,\encodingdefault,\end,\endcsname} %\DoNotIndex{\endgroup,\endinput,\endtabular,\ensuremath} %\DoNotIndex{\expandafter,\f@family,\f@series,\fam,\fi,\font} %\DoNotIndex{\fontsize,\frac,\gdef,\global,\hbox,\hfil,\hfill,\hskip} %\DoNotIndex{\hspace,\hss,\ifcsname,\ifdim,\iffalse,\IfFileExists} %\DoNotIndex{\ifmmode,\ifnum,\ifx,\ignorespaces,\inputencodingname} %\DoNotIndex{\InputIfFileExists,\key@ifundefine,\let,\long,\m@ne} %\DoNotIndex{\makeatletter,\math@version,\mathchoice,\mathnormal} %\DoNotIndex{\mathord,\mathrm,\mathsf,\mathtt,\mdseries} %\DoNotIndex{\MessageBreak,\mkern,\mp,\NC@find,\NeedsTeXFormat} %\DoNotIndex{\newbox,\newcolumntype,\newcommand,\newcount,\newdimen} %\DoNotIndex{\newif,\newlength,\newtoks,\nobreak,\noexpand,\p@} %\DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\phantom} %\DoNotIndex{\ProcessOptionsX,\protect,\protected@edef,\ProvidesFile} %\DoNotIndex{\ProvidesPackage,\Q,\raisebox,\relax,\renewcommand} %\DoNotIndex{\RequirePackage,\rlap,\sbox,\scantokens} %\DoNotIndex{\scriptscriptstyle,\scriptstyle,\selectfont,\setbox} %\DoNotIndex{\setkeys,\setlength,\settoheight,\sf@size,\sfdefault} %\DoNotIndex{\sfrac,\skewchar,\sp,\space,\string,\strip@pt} %\DoNotIndex{\tabularnewline,\text,\textdegree,\textmu,\textohm} %\DoNotIndex{\textsc,\textstyle,\textsuperscript,\the,\thr@@,\times} %\DoNotIndex{\ttdefault,\uccode,\unboldmath,\unhbox,\upmu,\Upomega} %\DoNotIndex{\uppercase,\upshape,\wd,\xdef,\xspace,\z@} % %\DoNotIndex{\if,\lowercase,\+,\,,\-,\.,\:,\;,\@argdef,\@cdr} %\DoNotIndex{\@ifdefinable,\@testopt,\@yargdef,\color,\endlinechar} %\DoNotIndex{\key@ifundefined,\newrobustcmd,\protected,\scriptspace} %\DoNotIndex{\usebox,\tw@,\ifinner,\usepackage,\texttt,\textsf} %\DoNotIndex{\NC@do,\loop,\l@ngrel@x,\g@addto@macro,\documentclass} %\DoNotIndex{\document\,\begin,\=,\@ehb,\\,\listfiles,\nullfont} %\DoNotIndex{\normalsize,\futurelet} % %\DoNotIndex{\pascalsecond,\amperemetresecond,\ohmmetre} %\DoNotIndex{\newtonmetre,\newtonmetrenp} %\DoNotIndex{\kilogramsquaremetre,\kilogramsquaremetrenp} % %\changes{v1.0}{2008/06/12}{First official release} % %\setkeys{lst}{language=[LaTeX]{TeX},moretexcs={sisetup,num,ang,SI, % si,newunit,newpower,newprefix,metre,candela,kelvin,ampere,eV, % second,mole,per,kilogram,Square,squared,cubed,cubic,kilo,centi, % gram,tothe,toprule,midrule,bottomrule,newton,micro,joule,mega, % raiseto,deci,mathnormal,numprint,electronvolt,selectlanguage, % kibi,byte,molar,Molar,mmHg,mebi,torr,parsec,lightyear,clight, % eVperc,addplot,color,milli,cm,Hz,kg,DeclareRobustCommand, % pascal,dalton,addtolocale,DTLnewdb,DTLnewrow,DTLnewdbentry, % DTLforeach,DTLiffirstrow,DTLmul,newqualifier,hour,renewunit, % degree}} % %\title{\currpkg\ --- A comprehensive (SI) units package^^A % \thanks{This file describes version \fileversion, last revised % \filedate.}} %\author{Joseph Wright^^A % \thanks{E-mail: joseph.wright@morningstar2.co.uk}} %\date{Released \filedate} % %\maketitle % %\newcommand*{\SIunits}{\pkg{SIunits}\xspace} %\newcommand*{\SIstyle}{\pkg{SIstyle}\xspace} %\newcommand*{\unitsdef}{\pkg{unitsdef}\xspace} %\newcommand*{\units}{\pkg{units}\xspace} %\newcommand*{\numprint}{\pkg{numprint}\xspace} %\begin{abstract} % Typesetting values with units requires care to ensure that the % combined mathematical meaning of the value plus unit combination is % clear. In particular, the SI units system lays down a consistent % set of units with rules on how these are to be used. However, % different countries and publishers have differing conventions on % the exact appearance of numbers (and units). % % The \currpkg provides a set of tools for authors to typeset numbers % and units in a consistent way. The package has an extended set of % configuration options which make it possible to follow varying % typographic conventions with the same input syntax. The package % includes automated processing of numbers and units, and the ability % to control tabular alignment of numbers. % % A number of \LaTeX\ packages have been developed in the past for % formatting units: \SIunits, \SIstyle, \unitsdef, \units, % \pkg{fancyunits} and \pkg{fancynum}. Support for users of all of % these packages is available as emulation modules in \currpkg. % In addition, \currpkg can carry out many of the functions of the % \pkg{dcolumn}, \pkg{rccol} and \numprint packages. %\end{abstract} % %\begin{multicols}{2} % \tableofcontents %\end{multicols} % %\clearpage %\part{Introduction} % The correct application of units of measurement is very important % in technical applications. For this reason, carefully-crafted % definitions of a coherent units system have been laid down by the % \latin{Conf\'erence G\'en\'erale des Poids et % Mesures}\footnote{General Conference on Weights and Measures.} % (CGPM): this has resulted in the \latin{Syst\`eme International % d'Unit\'es}\footnote{International System of Units.} (SI). At the % same time, typographic conventions for correctly displaying both % numbers and units exist to ensure that no loss of meaning occurs in % printed matter. % % \currpkg aims to provide a unified method for \LaTeX\ users to % typeset units and values correctly and easily. The design % philosophy of \currpkg is to follow the agreed rules by default, % but to allow variation through option settings. In this way, % users can use \currpkg to follow the requirements of publishers, % co-authors, universities, \etc without needing to alter the input % at all. % % \currpkg is intended as a complete replacement for \SIunits, % \SIstyle, \unitsdef, \units, \pkg{fancyunits} and % \pkg{fancynum}. As such, emulation modes are provided for all of % these packages. Where possible, conventions from the existing % solutions have been used here. For example, the macros \cs{num}, % \cs{ang} and \cs{SI} act in a very similar fashion to those in % existing packages. % %\clearpage %\part{Using the \currpkg package} % %\section{For the impatient} % \currpkg provides the user macros: %\begin{itemize} % \item \cs{SI}\oarg{options}\marg{value}\oarg{pre-unit}\marg{unit} % \item \cs{si}\oarg{options}\marg{unit} % \item \cs{num}\oarg{options}\marg{number} % \item \cs{ang}\oarg{options}\marg{angle} % \item \cs{sisetup}\marg{options} %\end{itemize} % plus the |S| and |s| column types for decimal alignments and units % in tables. These macros are designed for typesetting units and % values with control of appearance and with intelligent processing. % % By default, all text is typeset in the current upright, serif maths % font. This can be changed by setting the appropriate package % options: \opt{obeyall} will use the current font for typesetting. % % The package includes a ``unit processor'', which allows the use of % named units or literal values. Named units are processed to % correctly include powers. %\begin{LaTeXexample} % \SI{10}{\gram}\\ % \SI{23.4}{g.cm^3}\\ % \num{1e34}\\ % \ang{1;2;3}\\ % \emph{\SI{16,7}{\metre\per\second}}\\ % \textbf{\SI{30e3}{\Hz}}\\ % \SI{1.2 x 3.56 x 9.2}{\milli\metre}\\ % \sisetup{obeyall} % \textbf{\SI{-4.5}{\cm}}\\ % \si{\joule\per\mole\per\kelvin}\\ % \si[per=frac]{\joule\per\mole\per\kelvin}\\ % \num[dp=4]{1.23456}\\ % \num[dp=4]{9.8}\\ % \begin{tabular}{S[tabformat=3.2]} % \toprule % {Heading}\\ % \midrule % 1.3 \\ % 134.2 \\ % 3.56 \\ % 74,7 \\ % \bottomrule % \end{tabular} %\end{LaTeXexample} % %\section{Requirements} % \currpkg requires a reasonably up to date \TeX\ system. The % package requires \eTeX-extensions, which should be available on % most systems.\footnote{If you have an old \LaTeX\, try % ``\texttt{elatex}'' rather than ``\texttt{latex}''.} The following % packages are also needed: %\begin{itemize} % \item \pkg{array} and \pkg{xspace}: from the \pkg{tools} bundle, % which should be available to everyone; % \item \pkg{xkeyval}: this processes the option handling, and needs % to be at least v2.5; % \item \pkg{amstext}: from the \AMS\TeX\ support bundle (the % \AMS\ fonts are also needed to provide the default upright % \si{\micro}). %\end{itemize} % Hopefully most people using the package will have access to all of % those items. % % To use the \opt{fraction=sfrac} option, the \pkg{xfrac} package is % needed. This needs various experimental \LaTeX3 packages. As a % result, \currpkg does not load \pkg{xfrac}. If you want to use % \opt{fraction=sfrac}, \emph{you} need to load \pkg{xfrac} in your % preamble before \currpkg.\footnote{This document has been compiled % in this way. You have to load \pkg{xfrac} first as otherwise very % nasty things happen with \pkg{xkeyval}. MiK\TeX\ users should note % that the packaged versions of \pkg{expl3}, \pkg{template} and % \pkg{xparse} will not work with \pkg{xfrac}: download copies from % \textsc{ctan}!} If the package is not loaded, \opt{fraction=sfrac} % falls back on a \pkg{nicefrac}-like method. The interested user % should look at the \pkg{xfrac} documentation for reasons this might % not be ideal.\footnote{On the other hand, some fractional units % will look really bad with \cs{sfrac}. Use this option with % caution.} % %\section{Loading the package} % \currpkg is loaded by the usual \LaTeX\ method. %\begin{LaTeXexample}[noexample] % \usepackage[]{siunitx} %\end{LaTeXexample} % As is shown in the example, the package can be loaded with one or % more options, using the key--value system. The full range of % package options are described in Section~\ref{sec:options}; some % options are described in the along with the appropriate user % macros. Most of the user macros accept the same key--value % settings as an optional argument. % %\section{Numbers} %\DescribeMacro{\num} % Numbers are automatically formatted by the \cs{num} macro. This % takes one optional and one mandatory argument: % \cs{num}\oarg{options}\marg{number}. The contents of \meta{number} % are automatically formatted, in a similar method to that used by % \numprint. The formatter removes ``hard'' spaces (\cs{,} and |~|), % automatically identifies exponents (by default marked using |e| or % |d|) and adds the appropriate spacing of large numbers. A leading % zero is added before a decimal marker, if needed: both ``|.|'' and % ``|,|'' are recognised as decimal marker. %\begin{LaTeXexample} % \num{1} \num{123} \num{1234} \num{12345}\\ % \num{0.1} \num{0.123} \num{0,1234} \num{.12345}\\ % \num{1e10} \num{3.45d-4} \num{-e10} %\end{LaTeXexample} % Various error-checking systems are built into the package, so that % if \meta{number} does not contain any numeric characters, a warning % is issued. Isolated signs are also detected. The package % recognises |(| and |)| as ``extra'' characters, which can be used % to indicate the error in a number.\footnote{This is common in % chemical crystallography, for example.} The \opt{seperr} causes % this data to be given as a separate error value. If the number % also contains an exponent, then brackets are re-added after the % separation to ensure that meaning is not lost. %\begin{LaTeXexample} % $\num{1.234(5)} = \num[seperr]{1.234(5)}$\\ % $\num{1.234(5)e6} = \num[seperr]{1.234(5)e6}$ %\end{LaTeXexample} % The same applies to the unit and value macro \cs{SI}, described % later, for example the rest mass of an electron \cite{IUPAC}: %\begin{LaTeXexample} % $ m_{\mathrm{e}} % = \SI{9.1093897(54)e-31}{\kg} $\\ % $ m_{\mathrm{e}} % = \SI[seperr]{9.1093897(54)e-31}{\kg} $ %\end{LaTeXexample} % % A number of effects are available as options. These are fully % explained in Section~\ref{sec:options}. Some of the more useful % options are illustrated here. By default, the output of the % package is typeset in maths mode. However, the use of the current % text font can be forced.\footnote{This document is typeset using % lowercase numbers in text mode, which emphasises the effect here.} %\begin{LaTeXexample} % \num{1234567890} \num[mode=text]{1234567890} %\end{LaTeXexample} % \currpkg can automatically add zeros and signs to numbers. This % can be altered as desired. %\begin{LaTeXexample} % \num{1.} \num[padnumber=all]{1.}\\ % \num{2} \num[addsign=all]{2}\\ % \num{3e4} \num[addsign=mant]{3e4} \num[addsign=all]{3e4}\\ % \num{.5} \num[padnumber=none]{.5} %\end{LaTeXexample} % The separation of digits can be turned on and off, and the output % changed. %\begin{LaTeXexample} % \num{1234} \num[sepfour=true]{1234}\\ % \num{12345} \num[digitsep=comma]{12345}\\ % \num[digitsep=none]{12345} %\end{LaTeXexample} % The formatting of exponents is also customisable. %\begin{LaTeXexample} % \num{1e10} \num[expproduct=cdot]{1e10}\\ % \num{2e20} \num[expbase=5]{2e20}\\ % \num{3e30} \num[expproduct=tighttimes]{3e30} %\end{LaTeXexample} % % \currpkg can automatically add colour to negative numbers, which is % often useful for highlighting purposes. This is turned on with the % \opt{colourneg} option; the colour used is set by \opt{negcolour}. % Both of these are available with the US spellings: \opt{colorneg} % and \opt{negcolor}. %\begin{LaTeXexample} % \num{-1}\\ % \sisetup{colourneg} \num{-2}\\ % \num{3e-3}\\ % \num[negcolour=blue]{-4} %\end{LaTeXexample} % % \currpkg can automatically zero-fill and round to a fixed number of % decimal places. This is controlled by two options \opt{fixdp} and % \opt{dp}. The later is an integer which specifies how many places % to fix to; setting this option automatically sets \opt{fixdp} to % \opt{true}. The place-fixing system will only alter pure numbers: for % example, any error component will result in the input being left % unchanged. %\begin{LaTeXexample} % \num{1.23456}\\ % \sisetup{dp=2} % \num{1.23456}\\ % \num{9.8}\\ % \num{-10.432}\\ % \num{44.3221(2)} %\end{LaTeXexample} % %\section{Tabular material} %\subsection{Aligning numbers} % Centring numbers in tabular content is handled by a new column % type, the |S| column. This is based closely on the \pkg{dcolumn} % method for centring numbers in columns, but adds the functionality % of the \cs{num} macro.\footnote{The approach used is actually a % combination of \pkg{dcolumn} for centring the material and % \numprint for processing it. It will therefore give rather % different results than the \texttt{n} and \texttt{N} column types % in \numprint.} % % By default, the decimal marker of the number is placed at the % centre of the column, which then resizes to accommodate the width % of the contents (\ref{tab:default}). This behaviour is set by the % \opt{tabnumalign=centredecimal} option. By setting the % \opt{tabnumalign} option to \opt{centre}, the centre of the space % reserved for the number is placed at the centre of the column. The % space reserved is stored in \opt{tabformat}, which is of the form % \texttt{\meta{before}\meta{dec}\meta{after}}, where \meta{before} % is the number of characters before the decimal marker and % \meta{after} is the number after. Thus in the example, % \opt{tabformat=2.4} provides space for two digits before the % decimal marker and four after. \opt{tabnumalign} can also be set % to \opt{left} and \opt{right}, with the expected results. %\begin{LaTeXexample}[float] % \begin{table} % \caption{Behaviour of \texttt{S} column type} % \label{tab:default} % \centering % \begin{tabular}{% % S% % S[tabnumalign=centre,tabformat=2.4]% % S[tabnumalign=right,tabformat=2.4]% % S[tabnumalign=centre,tabformat=2.4,decimalsymbol=comma]} % \toprule % {Some Values} & {Some Values} & {Some Values} & {Some Values} \\ % \midrule % 2.3456 & 2.3456 & 2.3456 & 2.3456 \\ % 34.2345 & 34.2345 & 34.2345 & 34.2345 \\ % 56.7835 & 56.7835 & 56.7835 & 56.7835 \\ % 90.473 & 90.473 & 90.473 & 90.473 \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % The \opt{tabformat} setting can also be used to reserve space for % numbers containing exponents. This is given in the same format as % above, but with a mantissa and exponent part (\ref{tab:exptab}). % Notice that this is designed to expect that numbers will contain a % mantissa. Exponents can either be aligned so that the ``$\times$'' % symbols match up vertically, or the exponent part can be allowed to % move across as needed. Space for signs is added by using any sign % in the \opt{tabformat}, so for example \opt{tabformat=+2.2} and % \opt{tabformat=-2.2} have exactly the same effect. Setting % \opt{tabformat} will automatically switch \opt{tabnumalign} from % \opt{centredecimal} to \opt{centre}, if the former is % currently set. In other cases, the current alignment option is % retained. %\begin{LaTeXexample}[float] % \begin{table} % \caption{Exponents in tables} % \label{tab:exptab} % \centering % \begin{tabular}{% % S[tabnumalign=right,tabformat=2.2e2]% % S[tabnumalign=centre,tabformat=2.2e1.1]% % S[tabnumalign=centre,tabformat=2.2e1.1,tabalignexp=false]% % S[tabnumalign=centre,tabformat=+2.2]} % \toprule % {Longer values} % & {Longer values} % & {Longer values} % & {Values} \\ % \midrule % 2.3e1 & 2.34e1 & 2.34e1 & +2.31 \\ % 34.23e45 & 34.23e45 & 34.23e45 & 34.23 \\ % 56.78 & 56.78 & 56.78 & -56.78 \\ % 1.0e34 & 1.0e34 & 1.0e34 & +-1.0 \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % % Data not to be processed as a number should be protected by % wrapping it in braces: this is most likely to be true for column % headers (again as illustrated). By default, the contents of % non-numeric cells are centred. This can be altered by setting % \opt{tabtextalign}, which can be set to \opt{left}, \opt{right} or % \opt{centre}. The use of digit separators in table columns is % accounted for: extra space is reserved if digit separators will be % added. % %\subsection{Columns of units} % As a complement to the |S| column, \currpkg also provides a second % column type, |s|. This is intended for producing columns of units. % The letters chosen are intended to be similar to \cs{SI} and % \cs{si}, respectively. The alignment of material in |s| columns is % governed by the \opt{tabunitalign} option. %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{Number and units in tables} % \label{tab:num-unit} % \begin{tabular}{% % S[tabformat=1.2e-1,tabnumalign=centre]% % s[tabunitalign=left]} % \toprule % {Value} & \multicolumn{1}{c}{Unit} \\ % \midrule % 2.16e-5 & \metre\squared\per\second \\ % 2.83e-6 & \metre\squared\per\second \\ % 7.39e3 & \pascal\cubic\metre\per\mole \\ % 1.0e5 & \pascal \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % % As the \cs{si} macro can take literal or macro input, the |s| % column cannot validate the input. \emph{Everything} in an |s| % column is therefore passed to the \cs{si} macro for processing. To % prevent this, you have to use \cs{multicolumn}, as is shown in % \ref{tab:s-limits}. Notice that the braces do not prevent % processing and colouring of the cell contents. %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{The \texttt{s} column processes everything} % \label{tab:s-limits} % \begin{tabular}{% % s[colourall,colour=orange]% % s[colourall,colour=orange]} % \toprule % {Unit} & \multicolumn{1}{c}{Unit}\\ % \midrule % {m^3} & \multicolumn{1}{c}{\si{m^3}} \\ % \kilogram & \kilogram \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % %\section{Angles} %\DescribeMacro{\ang} % Angles can be typeset using the \cs{ang} command. This takes two % arguments, \cs{ang}\oarg{options}\marg{angle}, where \meta{options} % can be any of the package options to apply only to this value. % \meta{angle} can be given either as a decimal number or as a % semi-colon separated list of degrees, minutes and seconds, \ie\ % \cs{ang}\marg{decimal angle} or % \cs{ang}|{|\meta{degrees}|;|\meta{minutes}|;|\meta{seconds}|}|. By % default, no space is introduced between angles and the degrees, % minutes and seconds markers. %\begin{LaTeXexample} % \ang{10} \ang{12.3} \ang{4,5}\\ % \ang{1;2;3} \ang{;;1}\\ % \ang{+10;;} \ang{-0;1;} %\end{LaTeXexample} % % By default, angles with no degrees (or minutes) are zero-filled; % angles with degrees but no minutes or seconds are not filled. This % behaviour can be altered using the package options. %\begin{LaTeXexample} % \ang{;;1} \ang[padangle=none]{;;1}\\ % \ang{2;;} \ang[padangle=all]{2;;}\\ % \sisetup{padangle=all} \ang{;3;} \ang{4;;} \ang{;;5} %\end{LaTeXexample} % The \cs{num} macro is used to typeset each number of the angle, so % the options for \cs{num} also apply here. The \opt{anglesep} value % can be used to separate degrees, minutes and seconds. %\begin{LaTeXexample} % \ang{1.05} \ang[decimalsymbol=comma]{1.05}\\ % \ang{3.67890} \ang[digitsep=comma]{3.67890}\\ % \ang{9;8;7} \ang[anglesep=thin]{9;8;7} %\end{LaTeXexample} % The degrees, minutes and seconds signs can be placed over the % decimal sign using the \opt{astroang} option. This is designed on % the assumption that only the last number given has a decimal % part. %\begin{LaTeXexample} % \ang{1.2} \ang[astroang]{1.2}\\ % \ang{1;2.3;} \ang[astroang]{1;2.3;}\\ % \ang{1;2;3.4} \ang[astroang]{1;2;3.4} %\end{LaTeXexample} % %\section{Units and values} %\DescribeMacro{\SI} % The core aim of \currpkg is correctly typesetting values which have % units. The main output macro here is \cs{SI}, which has the same % syntax as the macros with the same name in \SIstyle and \unitsdef % packages. The \cs{SI} macro takes two mandatory arguments, in % addition to the optional set up argument, and a second optional % argument: % \cs{SI}\oarg{options}\marg{number}\oarg{preunit}\marg{unit}. The % \meta{number} argument operates in exactly the same manner as the % equivalent argument of the \cs{num} macro. \meta{unit} will be % typeset with a non-breakable space between it and the preceding % number, with font control as outlined earlier. Finally, % \meta{preunit} is a unit to be typeset \emph{before} the numerical % value (most likely to be a currency). Some examples illustrate the % general power of the macro. %\begin{LaTeXexample} % \SI[mode=text]{1.23}{J.mol^{-1}.K^{-1}}\\ % \SI{.23e7}{\candela}\\ % \SI[per=slash]{1.99}[\pounds]{\per\kilogram}\\ % \SI{70}{\metre\per\second}\\ % \SI[per=frac,fraction=nice]{1,345}{\ampere\per\mole} %\end{LaTeXexample} % The use of unit macros outside of the \cs{SI} macro is described % later. % %\subsection{Literal units} %\changes{v1.1}{2008/07/23}{Unit processor extended to interpret % \texttt{\textunderscore} correctly} % Units can be input in two ways, inspired by \SIstyle and \SIunits. % The \SIstyle-like method uses literal input. Five characters have % a special meaning: %\begin{itemize} % \item ``|^|'' and ``|_|'' The superscript and subscript % characters can be used without the usual % need for surrounding maths characters (|$|);^^A$ % \item ``|.|'' and ``|,|'': the full stop (point) symbol and comma % are made active, and produce the current contents of the % \opt{unitsep} option; % \item ``|~|'' The contents of the \opt{unitspace} option are typeset % by a tilde. %\end{itemize} % This allows ready input of units. %\begin{LaTeXexample} % \SI{10}{kg.m.s^{-2}}\\ % \SI{1.453}{g/cm^3}\\ % \SI{6.345}{kg_{pol}.mmol_{cat}^{-1}}\\ % \SI{33.562}{cd~s}\\ % \SI[unitsep=medium]{100}{m.s^{-2}} %\end{LaTeXexample} % The literal unit system will correctly typeset input containing the % symbols \si{\micro} (micro), \si{\degree} (degree) and % \si{\angstrom} (ring-A).\footnote{Currently this works with \XeTeX\ % and \pkg{inputenc} using the \texttt{latin1}, \texttt{latin5} and % \texttt{latin9} encodings.} % \begingroup\makeatletter\si@unt@nonlatin %\begin{LaTeXexample} % \SI{10}{µm}\\ % \SI{20}{°C}\\ % \SI{30}{Å} %\end{LaTeXexample} %\endgroup % %\subsection{The unit interpreter} % The second operation mode for the \cs{SI} macro is based on the % behaviour of \SIunits. Here, each unit, SI multiple prefix and % power is given a macro name. These are entered in a method very % similar to the reading of the unit name in English. %\begin{LaTeXexample} % \SI{10}{\kilo\gram\metre\per\second\squared}\\ % \SI{1.453}{\gram\per\cubic\centi\metre}\\ % \SI{33.562}{\candela\second}\\ % \SI[unitsep=medium]{100}{\metre\per\Square\second}\\ % \SI[prefixsymbolic=false]{4.56}{\kilo\metre\per\second} %\end{LaTeXexample} % On its own, this is very similar to \SIunits, and is less % convenient than the direct input method.\footnote{Users of \SIunits % should note the lack of need for a \cs{usk}-type macro.} However, % the package allows you to define new unit macros; a large number of % pre-defined abbreviations are also supplied. More importantly, by % defining macros for units, instead of literal values, new % functionality is made available. Units may be re-defined to give % different output, and handling of reciprocal values can be altered. %\begin{LaTeXexample} % \SI[per=frac,fraction=frac]{10}{\gram\metre\per\second\squared}\\ % \SI[per=slash]{1.453}{\gram\per\cubic\centi\metre}\\ % \SI{33.562}{\candela\second}\\ % \SI[per=frac,fraction=nice]{100}{\metre\per\Square\second} %\end{LaTeXexample} % The unit processor will trap \emph{some} errors in the input and % give the ``best guess'' result. However, it is down to the user to % check the output. % %\subsection{Powers of units} %\DescribeMacro{\Square} %\DescribeMacro{\ssquare} %\DescribeMacro{\squared} %\DescribeMacro{\cubic} %\DescribeMacro{\cubed} % Including powers in units is handled using a ``natural language'' % method. Thus preceding a unit by \cs{Square} or \cs{cubic} which % raise the unit to the appropriate power, while \cs{squared} or % \cs{cubed} follow the unit they apply to. The \cs{Square} macro is % capitalised to avoid a name clash with \pkg{pstricks}; the % alternative \cs{ssquare} is also provided. %\begin{LaTeXexample} % \SI{10}{\metre\squared}\\ % \SI{20}{\Square\metre}\\ % \SI{30}{\metre\cubed}\\ % \SI{40}{\cubic\metre} %\end{LaTeXexample} % %\DescribeMacro{\per} % The \cs{per} macro intelligently creates reciprocal powers, and % also adds the power $-1$ when appropriate. %\begin{LaTeXexample} % \SI{10}{\per\second\squared}\\ % \SI{20}{\per\Square\second}\\ % \SI[per=frac,fraction=nice]{30}{\per\second\cubed}\\ % \SI[per=slash]{40}{\per\cubic\second}\\ % \SI{50}{\per\second}\\ % \SI{60}{\per\metre\Square\candela} %\end{LaTeXexample} % %\DescribeMacro{\tothe} %\DescribeMacro{\raiseto} % For powers not defined above or with \cs{newpower}, the \cs{tothe} % macro can be used ``in line'' to produce a power. As follows from % standard English usage, this comes after the unit. \cs{raiseto} % achieves the same, but is used \emph{before} a unit to add a power % \emph{after}.\footnote{\cs{raiseto} acts in the same way as % \cs{tothe} when used in a literal context: the power will be % produced where the macro is, rather than moving after the next % item.} %\begin{LaTeXexample} % \SI{16.86}{\metre\tothe{4}}\\ % \SI{7.895}{\raiseto{-6}\newton}\\ % \SI{1.34}{\per\kelvin\tothe{7}} %\end{LaTeXexample} % %\subsection{Units with no values} %\DescribeMacro{\si} % For typesetting the symbol for a unit on its own, with the full % font control and without extra spaces, the \cs{si} macro is % provided.\footnote{The same effect can be achieved using the % \cs{SI} macro with an empty numerical argument.} The macro name % avoids a clash with the functionality of the earlier packages, but % is similar to \cs{ilu} from the \unitsdef package. %\begin{LaTeXexample} % \SI{}{kg.m/s^2}\\ % \si{kg.m/s^2}\\ % \si[mode=text,unitsep=thin]{\mole\per\cubic\deci\metre} %\end{LaTeXexample} % %\subsection{Free-standing units} % Users of the \unitsdef package will be accustomed to using unit % macros on their own (following a value) or with an optional % argument containing a number. In both cases, only a single unit % macro could be used. \currpkg supports both operation modes, with % the limitation that units trailing values loose font control of the % value. When used in this way, the units \emph{do not} take an % optional \pkg{keyval} argument. %\begin{LaTeXexample} % \sisetup{prespace,allowoptarg} % 123\metre\\ % \kelvin[123]\\ % \sisetup{mode=text} \ampere[234]\\ % 6\second %\end{LaTeXexample} % %\subsection{Pre-defined units, prefixes and powers} %\newcommand*{\csindex}[1]{^^A % \cs{#1}^^A % \expandafter\SpecialUsageIndex\csname#1\endcsname} %\newcommand*{\unitinfo}[1]{^^A % #1 & \csindex{#1} & % \expandafter\si\expandafter{\csname#1\endcsname}} %\begin{table} % \caption{The seven base SI units} % \label{tab:baseunits} % \centering % \begin{tabular}{lll} % \toprule % \multicolumn{1}{c}{Unit} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Symbol} \\ % \midrule % \unitinfo{kilogram}\\ % \unitinfo{metre}\\ % \unitinfo{second}\\ % \unitinfo{mole}\\ % \unitinfo{kelvin}\\ % \unitinfo{ampere}\\ % \unitinfo{candela}\\ % \bottomrule % \end{tabular} %\end{table} %\DescribeMacro{\metre} %\DescribeMacro{\meter} % The package always defines the seven base SI units, irrespective of % any package options given (\ref{tab:baseunits}). The kilogram is % notable as by default it is a \emph{base} unit with a prefix. Thus, % when the package is loaded with the option \opt{load=\{\}}, % \cs{kilo} and \cs{gram} \emph{are not defined}. As metre is often % spelled as ``meter'' in the US, the macro \cs{meter} is provided in % addition to the \cs{metre} macro.\footnote{The official SI spelling % for the unit is ``metre''.} % % By default, a number of additional definitions are created by the % package. These are controlled by the \opt{load} and \opt{noload} % options. Unless specifically requested with the option % \opt{noload=prefix}, \currpkg defines the standard prefixes for % powers of ten (\ref{tab:prefix}). This leads to the redefinition % of \cs{kilogram} as \cs{kilo}\cs{gram}. The macro \cs{deka} is % provided, as this is used as an alias for \cs{deca} in some places. % The package also defines a number of derived SI units which have % assigned names and symbols (\ref{tab:derived}). Note that \cs{Gray} % is capitalised to avoid a name clash with the \pkg{pstricks} % package.\footnote{The macros \cs{ohm} and \cs{celsius} are not % defined by \currpkg if the \pkg{gensymb} package is loaded.} %\newcommand*{\prefixunitsym}[1]{\si[prefixsymbolic=false]{#1}} %\newcommand*{\prefixinfo}[1]{^^A % #1 & \csindex{#1} & % \expandafter\prefixunitsym\expandafter{\csname#1\endcsname} & % \expandafter\si\expandafter{\csname#1\endcsname}} %\begin{table} % \caption{The SI prefixes (\opt{load=prefix})} % \label{tab:prefix} % \centering % \begin{tabular}{lllclllc} % \toprule % \multicolumn{1}{c}{Prefix} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Power} & % Symbol & % \multicolumn{1}{c}{Prefix} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Power} & % Symbol \\ % \midrule % \prefixinfo{yocto} & % \prefixinfo{deca} \\ % \prefixinfo{zepto} & % \prefixinfo{hecto} \\ % \prefixinfo{atto} & % \prefixinfo{kilo} \\ % \prefixinfo{femto} & % \prefixinfo{mega} \\ % \prefixinfo{pico} & % \prefixinfo{giga} \\ % \prefixinfo{nano} & % \prefixinfo{tera} \\ % \prefixinfo{micro} & % \prefixinfo{peta} \\ % \prefixinfo{milli} & % \prefixinfo{exa} \\ % \prefixinfo{centi} & % \prefixinfo{zetta} \\ % \prefixinfo{deci} & % \prefixinfo{yotta} \\ % \bottomrule % \end{tabular} %\end{table} %\begin{table} % \caption{The derived SI units with defined names % (\opt{load=derived})} % \label{tab:derived} % \centering % \begin{tabular}{llllll} % \toprule % \multicolumn{1}{c}{Unit} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Symbol} & % \multicolumn{1}{c}{Unit} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Symbol} \\ % \midrule % \unitinfo{becquerel} & % \unitinfo{newton} \\ % \unitinfo{celsius} & % \unitinfo{ohm} \\ % \unitinfo{coulomb} & % \unitinfo{pascal} \\ % \unitinfo{farad} & % \unitinfo{radian} \\ % \unitinfo{Gray} & % \unitinfo{siemens} \\ % & \csindex{ggray} & \ggray & % \unitinfo{sievert} \\ % \unitinfo{hertz} & % \unitinfo{steradian} \\ % \unitinfo{henry} & % \unitinfo{tesla} \\ % \unitinfo{joule} & % \unitinfo{volt} \\ % \unitinfo{katal} & % \unitinfo{watt} \\ % \unitinfo{lumen} & % \unitinfo{weber} \\ % \unitinfo{lux} \\ % \bottomrule % \end{tabular} %\end{table} % % In addition to these units, there are three other groups of units % for use with the SI system which do not fit into the above. These % are those derived from physical measurements % (\ref{tab:experimental}), those considered ``accepted'' % (\ref{tab:accepted}), and those accepted temporarily % (\ref{tab:addn}).\footnote{These are supposed to be replaced over % time by SI units.} %\DescribeMacro{\litre} %\DescribeMacro{\liter} % The unit ``litre'' is often spelled ``liter'' in the US; both % spellings are provided by \currpkg, with \cs{liter} giving % \si{\liter} and \cs{litre} producing \si{\litre}. %\begin{table} % \caption{Units derived from experiments % (\opt{load=physical})} % \label{tab:experimental} % \centering % \begin{tabular}{lll} % \toprule % \multicolumn{1}{c}{Unit} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Symbol} \\ % \midrule % electron volt & \csindex{electronvolt} & \electronvolt \\ % unified atomic mass unit % & \csindex{atomicmassunit} & \atomicmassunit \\ % & \csindex{atomicmass} & \atomicmass \\ % \bottomrule % \end{tabular} %\end{table} %\begin{table} % \caption{Units accepted for use with SI % (\opt{load=accepted})} % \label{tab:accepted} % \centering % \begin{tabular}{lll} % \toprule % \multicolumn{1}{c}{Unit} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Symbol} \\ % \midrule % \unitinfo{bel} \\ % day & \csindex{Day} & \Day \\ % & \csindex{dday} & \dday \\ % \unitinfo{degree} \\ % \unitinfo{hour} \\ % \unitinfo{litre} \\ % & \csindex{liter} & \liter \\ % \unitinfo{minute} \\ % minute (arc) & \csindex{arcmin} & \arcmin \\ % \unitinfo{neper} \\ % \unitinfo{percent} \\ % second (arc) & \csindex{arcsec} & \arcsec \\ % \unitinfo{tonne} \\ % \bottomrule % \end{tabular} %\end{table} %\begin{table} % \centering % \caption{Additional (temporary) SI units % (\opt{load=addn})} % \label{tab:addn} % \begin{tabular}{lll} % \toprule % \multicolumn{1}{c}{Unit} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Symbol} \\ % \midrule % {\aa}ngstr{\"o}m & \csindex{angstrom} & \angstrom \\ % \unitinfo{are} \\ % \unitinfo{curie} \\ % bar & \csindex{BAR} & \BAR \\ % & \csindex{bbar} & \bbar \\ % \unitinfo{barn} \\ % \unitinfo{gal} \\ % \unitinfo{hectare} \\ % \unitinfo{millibar} \\ % \unitinfo{rad} \\ % \unitinfo{rem} \\ % \unitinfo{roentgen} \\ % \bottomrule % \end{tabular} %\end{table} % %\subsection{Prefixed and abbreviated units} % Many basic units have prefixes which are commonly used with the % unit, such as centimetre or megahertz. The package therefore % defines a number of common prefixed units (\opt{load=prefixed}). % Several of these also have obvious abbreviations (such as \cs{MHz} % for \cs{megahertz}), which are made available by \opt{load=abbr}. % In common with the units discussed above, the prefixed and % abbreviated unit definitions are loaded by default. %\newcommand*{\tablesubhead}[1]{^^A % \addlinespace \emph{#1} \\*} %\begin{longtable}{llll} % \caption{Prefixed (\opt{load=prefixed}) and abbreviated % (\opt{load=abbr}) units\label{tab:abbr}}\\ % \toprule % Unit & Macro & Symbol & Abbreviation \\ % \midrule % \endfirsthead % \toprule % Unit & Macro & Symbol & Abbreviation \\ % \midrule % \endhead % \bottomrule % \multicolumn{4}{r}{\emph{Continued on next page}} % \endfoot % \bottomrule % \endlastfoot % % \tablesubhead{Masses} % \unitinfo{kilogram} & \csindex{kg} \\ % \unitinfo{femtogram} & \csindex{fg} \\ % \unitinfo{picogram} & \csindex{pg} \\ % \unitinfo{nanogram} & \csindex{nanog} \\ % \unitinfo{microgram} & \csindex{micg} \\ % \unitinfo{milligram} & \csindex{mg} \\ % atomic mass & \csindex{atomicmass} & \amu & \csindex{amu} \\ % % \tablesubhead{Lengths} % \unitinfo{picometre} & \csindex{picom} \\ % \unitinfo{nanometre} & \csindex{nm} \\ % \unitinfo{micrometre} & \csindex{micm} \\ % \unitinfo{millimetre} & \csindex{mm} \\ % \unitinfo{centimetre} & \csindex{cm} \\ % \unitinfo{decimetre} & \csindex{dm} \\ % \unitinfo{kilometre} & \csindex{km} \\ % % \tablesubhead{Times} % \unitinfo{second} & \csindex{Sec} \\ % \unitinfo{attosecond} & \csindex{as} \\ % \unitinfo{femtosecond} & \csindex{fs} \\ % \unitinfo{picosecond} & \csindex{ps} \\ % \unitinfo{nanosecond} & \csindex{ns} \\ % \unitinfo{microsecond} & \csindex{mics} \\ % \unitinfo{millisecond} & \csindex{ms} \\ % % \tablesubhead{Moles} % \unitinfo{femtomole} & \csindex{fmol} \\ % \unitinfo{picomole} & \csindex{pmol} \\ % \unitinfo{nanomole} & \csindex{nmol} \\ % \unitinfo{micromole} & \csindex{micmol} \\ % \unitinfo{millimole} & \csindex{mmol} \\ % \unitinfo{kilomole} & \csindex{kmol} \\ % % \tablesubhead{Currents} % \unitinfo{picoampere} & \csindex{pA} \\ % \unitinfo{nanoampere} & \csindex{nA} \\ % \unitinfo{microampere} & \csindex{micA} \\ % \unitinfo{milliampere} & \csindex{mA} \\ % \unitinfo{kiloampere} & \csindex{kA} \\ % % \tablesubhead{Areas} % square centimetre & \csindex{squarecentimetre} & % \squarecentimetre & \csindex{cms} \\* % & \csindex{centimetresquared} & \centimetresquared \\ % square metre & \csindex{squaremetre} & \squaremetre \\ % square kilometre & \csindex{squarekilometre} & \squarekilometre \\ % % \tablesubhead{Volumes} %\changes{v1.1d}{2008/10/29}{New units \cs{microliter}, \cs{milliliter}, % \cs{micL} and \cs{mL}} % \unitinfo{microlitre} & \csindex{micl} \\ % \unitinfo{millilitre} & \csindex{ml} \\ % \unitinfo{microliter} & \csindex{micL} \\ % \unitinfo{milliliter} & \csindex{mL} \\ % cubic centimetre & \csindex{cubiccentimetre} & % \cubiccentimetre & \csindex{cmc} \\* % & \csindex{centimetrecubed} & \centimetrecubed \\ % cubic decimetre & \csindex{cubicdecimetre} & % \cubicdecimetre & \csindex{dmc} \\ % % \tablesubhead{Frequencies} % \unitinfo{hertz} & \csindex{Hz} \\ % \unitinfo{millihertz} & \csindex{mHz} \\ % \unitinfo{kilohertz} & \csindex{kHz} \\ % \unitinfo{megahertz} & \csindex{MHz} \\ % \unitinfo{gigahertz} & \csindex{GHz} \\ % \unitinfo{terahertz} & \csindex{THz} \\ % % \tablesubhead{Potentials} % \unitinfo{millivolt} & \csindex{mV} \\ % \unitinfo{kilovolt} & \csindex{kV} \\ % % \tablesubhead{Energies} % \unitinfo{kilojoule} & \csindex{kJ}\\ % \unitinfo{electronvolt} & \csindex{eV} \\ % \unitinfo{millielectronvolt} & \csindex{meV} \\ % \unitinfo{kiloelectronvolt} & \csindex{keV} \\ % \unitinfo{megaelectronvolt} & \csindex{MeV} \\ % \unitinfo{gigaelectronvolt} & \csindex{GeV} \\ % \unitinfo{teraelectronvolt} & \csindex{TeV} \\ % \unitinfo{kilowatthour} & \cs{kWh} \\ % % \tablesubhead{Powers} % \unitinfo{milliwatt} \\ % \unitinfo{kilowatt} \\ % \unitinfo{megawatt} \\ % % \tablesubhead{Capacitances} % \unitinfo{femtofarad} \\ % \unitinfo{picofarad} \\ % \unitinfo{nanofarad} \\ % \unitinfo{microfarad} \\ % \unitinfo{millifarad} \\ % % \tablesubhead{Resistances} % \unitinfo{kilohm} \\ % \unitinfo{megohm} \\ % \unitinfo{gigaohm} \\ % \unitinfo{millisiemens} \\ % % \tablesubhead{Forces} % \unitinfo{millinewton} \\ % \unitinfo{kilonewton} \\ % % \tablesubhead{Other units} % \unitinfo{hectopascal} \\ % \unitinfo{megabecquerel} \\ % \unitinfo{millisievert} \\ %\end{longtable} % %\subsection{Defining new units} %\DescribeMacro{\newunit} %\DescribeMacro{\renewunit} %\DescribeMacro{\provideunit} % New units are produced using the \cs{newunit} macro. This works as % might be expected: % \cs{newunit}\oarg{options}\marg{unit}\marg{symbol}, where % \meta{symbol} can contain literal values, other units, multiple % prefixes, powers and \cs{per}. The \meta{options} argument can be % any suitable options, and applies the specific unit macro only. The % most obvious example for using this macro is the \cs{degree} % unit.\footnote{Although the \cs{ang} macro is preferred for this % job.} The (first) optional argument to \cs{SI} and \cs{si} can be % used to override the settings for the unit. The \cs{renewunit} and % \cs{provideunit} macros take the same arguments. %\begin{LaTeXexample} % \SI{3.1415}{\degree}\\ % \newunit[valuesep=none]{\oddunit}{XXX} % \SI{12345}{\oddunit} % \SI[valuesep=thick]{67890}{\oddunit} %\end{LaTeXexample} % % As with the \LaTeX\ commands \cs{newcommand}, \etc, the choice of % \cs{newunit}, \cs{renewunit} or \cs{provideunit} depends on the % presence of an existing definition. While \cs{newunit} should be % used when a unit has not been previously defined, \cs{renewunit} % will issue a warning if the named unit does not already exist. % \cs{provideunit} defines the unit if it does not exist, and % otherwise does nothing at all. The same behaviour is seen with % \cs{providepower} and \cs{provideprefix} (\latin{vide infra}). % % Output that is only valid in maths mode requires \cs{ensuremath}, % text-only input requires \cs{text}. In the example below, % \cs{mathnormal} is used to force the font choice only for the % single character.\footnote{The \cs{mathrm} font used for this % document has an ``\ss'' at the $\pi$ position.} %\begin{LaTeXexample} % \newunit{\SIpi}{\ensuremath{\mathnormal{\pi}}} % \SI{10}{\metre\per\SIpi\squared} %\end{LaTeXexample} % %\DescribeMacro{\newpower} %\DescribeMacro{\renewpower} %\DescribeMacro{\providepower} % Powers are defined: % \cs{newpower}\ofixarg{post}\marg{power}\marg{num}. Here, % \meta{power} is the name of the power macro and \meta{num} is the % (positive) number it represents. The later argument is always % processed internally by \cs{num}, but \emph{must} be a number. % Giving the optional argument \opt{post} indicates to the package % that the power will come after the unit it applies to; by default % it is assumed that it will come before. %\begin{LaTeXexample} % \newpower{\quartic}{4} % \newpower[post]{\totheforth}{4}\\ % \si{\kilogram\totheforth}\\ % \si{\quartic\metre} %\end{LaTeXexample} % %\DescribeMacro{\newprefix} %\DescribeMacro{\renewprefix} %\DescribeMacro{\provideprefix} % The standard SI powers of ten are defined by the package, and are % described above. However, the user can define new prefixes with % \cs{newprefix}. This has syntax % \cs{newunit}\ofixarg{binary}\marg{prefix}\marg{symbol}\marg{powers-ten}, % where \meta{powers-ten} is the number of powers of ten the prefix % represents. When the \opt{binary} option is given, the prefix is a % power of two. For example, \cs{kilo} and \cs{kibi} are defined: %\begin{LaTeXexample}[noexample] % \newprefix{\kilo}{k}{3} % \newprefix[binary]{\kibi}{Ki}{10} %\end{LaTeXexample} % %\changes{v1.1}{2008/09/22}{Qualifiers introduced} %\DescribeMacro{\newqualifier} %\DescribeMacro{\renewqualifier} %\DescribeMacro{\providequalifier} % It is possible to create unit ``qualifiers'', which add subscript % descriptions to units. Although not encouraged, this is sometimes % necessary to make the meaning clear. No qualifiers are pre-defined % by \currpkg, and so the user needs to declare them using % \cs{newqualifier}. Currently, only subscript qualifiers can be % created; a more extended set of options is planned for the next % release of \currpkg. %\begin{LaTeXexample} % \newqualifier{\polymer}{pol} % \newqualifier{\catalyst}{cat} % \si{\kg\polymer\per\mole\catalyst\per\hour} %\end{LaTeXexample} % %\section{Specialist units} % In some subject area, there are units which are in common use even % though they are outside of the SI system. Unlike the units % discussed earlier, these specialist units are not loaded by % default. In each case, they should be requested with the option % \opt{alsoload=\meta{name}}. % %\subsection{Binary units (\opt{binary})\label{sec:binary}} %\DescribeMacro{\bit} %\DescribeMacro{\byte} % The binary prefixes, \cs{bit}, \cs{byte} (\ref{tab:binary}) are not % formally part of the SI system. They are available by giving the % \opt{alsoload=binary} option. %\begin{LaTeXexample} % \SI{100}{\mebi\byte} %\end{LaTeXexample} %\begin{table} % \caption{Binary prefixes % (\opt{alsoload=binary})} % \label{tab:binary} % \centering % \begin{tabular}{lllc} % \toprule % \multicolumn{1}{c}{Prefix} & % \multicolumn{1}{c}{Macro} & % \multicolumn{1}{c}{Power} & % Symbol \\ % \midrule % \prefixinfo{kibi} \\ % \prefixinfo{mebi} \\ % \prefixinfo{gibi} \\ % \prefixinfo{tebi} \\ % \prefixinfo{pebi} \\ % \prefixinfo{exbi} \\ % \bottomrule % \end{tabular} %\end{table} % %\subsection{Synthetic chemistry (\opt{synchem})} %\DescribeMacro{\mmHg} %\DescribeMacro{\molar} %\DescribeMacro{\Molar} %\DescribeMacro{\torr} %\DescribeMacro{\dalton} % The \opt{synchem} file adds the common chemistry units \cs{mmHg}, % \cs{molar}, \cs{Molar}, \cs{torr} and \cs{dalton} to \currpkg. The % \cs{Molar} macro is somewhat awkward, as it can be given as either % ``\textsc{m}'' or ``M''. The later is obviously easily confused % with the sign for the prefix mega. By default, \currpkg uses the % UK default of a small-caps symbol. The \cs{dalton} unit is defined % here as this name is not recognised by the various international % bodies: the symbol \si{\amu} is preferred. %\begin{LaTeXexample} % \SI{1}{\Molar} HCl\\ % \SI{760}{\torr}\\ % \SI{0.01}{\mmHg}\\ % \SI{3.0}{\molar}\\ % \SI{106.42}{\dalton} %\end{LaTeXexample} % %\subsection{High-energy physics (\opt{hep})} % In contrast to \pkg{hepunits}, \currpkg does not define a long list % of compound units for high-energy physics.\footnote{Using the % \opt{emulate=hepunits} option will load a file defining those.} % Instead, a small selection of new units are defined % (\ref{tab:hep}). The mechanisms provided by \currpkg should avoid % the need for large numbers of abbreviations. For example, the % \pkg{hepunits} \cs{MinveV} can be given as |\per\MeV| in \currpkg, % which requires only one more character. %\begin{table} % \caption{High-energy physics units (\opt{alsoload=hep})} % \label{tab:hep} % \centering % \begin{tabular}{lllc} % \toprule % Unit & Macro & Symbol & Abbreviation \\ % \midrule % \addlinespace \emph{Areas} \\ % \unitinfo{yoctobarn} & \csindex{yb} \\ % \unitinfo{zeptobarn} & \csindex{zb} \\ % \unitinfo{attobarn} & \csindex{ab} \\ % \unitinfo{femtobarn} & \csindex{fb} \\ % \unitinfo{picobarn} & \csindex{pb} \\ % \unitinfo{nanobarn} & \csindex{nb} \\ % \addlinespace \emph{Other units} \\ % \unitinfo{micron} \\ % millirad & \csindex{mrad} & \mrad \\ % \unitinfo{gauss} \\ % \bottomrule % \end{tabular} %\end{table} % %\DescribeMacro{\clight} %\DescribeMacro{\eVperc} % The \opt{hep} option defines two units which are slightly unusual. % \cs{clight} gives \clight, which is recognised as a unit when used % in the appropriate circumstances. The second unit provided is % \cs{eVperc}, which is commonly-used and clear enough for a compound % definition. Notice that the value of \opt{eVcorrb} will need to be % adjusted when using this unit. %\begin{LaTeXexample} % \SI[per=slash,eVcorrb=0.4ex]{4.657}{\mega\eVperc\squared} %\end{LaTeXexample} % %\subsection{Astronomy (\opt{astro})} %\DescribeMacro{\parsec} %\DescribeMacro{\lightyear} % For astronomers, the \cs{parsec} and \cs{lightyear} units are % available, and give the obvious results. %\begin{LaTeXexample} % \SI{12}{\parsec}\\ % \SI{1}{\lightyear} %\end{LaTeXexample} % %\section{Font control} % Following the lead of \SIstyle, \currpkg provides control over the % font used to typeset output. By default, all text is typeset using % the current upright serif maths font, whether the macros are given % in text or maths mode. Some examples will show the effect. %\begin{LaTeXexample} % \num{10} $\num{10}$\\ % \sffamily \ang{20} $\ang{20}$\\ % \textbf{\SI{30}{\kilo\gram}}\\ % \boldmath $\SI{40}{\kilo\gram}$ % \[ \num{50} \] %\end{LaTeXexample} % % In contrast, by setting \opt{obeyall}, the current font is used: % this may be maths or text, depending on the context. %\begin{LaTeXexample} % \sisetup{obeyall}\\ % \ang{1;1;1} $\ang{1;1;1}$\\ % \sffamily \ang{2;2;2} $\ang{2;2;2}$\\ % \textbf{\ang{3;3;3}} \boldmath $\ang{3;3;3}$\\ % \emph{\ang{4;4;4}} \emph{$\ang{4;4;4}$} % \[ \ang{5;5;5} \] %\end{LaTeXexample} % % Fine control of which elements of the local font are used is % available with the \opt{obeyfamily}, \opt{obeybold}, % \opt{obeyitalic} and \opt{obeymode} options. %\begin{LaTeXexample} % \sisetup{obeyfamily}\\ % \ang{1;1;1} $\ang{1;1;1}$\\ % \sffamily \ang{2;2;2} $\ang{2;2;2}$\\ % \sisetup{obeybold} % \textbf{\ang{3;3;3}} \boldmath $\ang{3;3;3}$\\ % \emph{\ang{4;4;4}} \emph{$\ang{4;4;4}$} % \[ \ang{5;5;5} \] %\end{LaTeXexample} % %\section{Package options\label{sec:options}} %\DescribeMacro{\sisetup} % The ``native'' options for the package are all given using the % key--value method. Most of the package options can be given both % when loading the package and at any point in the document. This is % achieved using the \cs{sisetup} macro. % % The package options take a number of different forms. %\begin{itemize} % \item \opt{option=\meta{bool}} Simple true/false values. These % macros all default to \opt{option=true}, meaning that giving the % option name along will set the appropriate flag. % \item \opt{option=\meta{choice}} Take a single item from a % pre-determined list. Depending on the value, one or more % internal states will be altered. Values not on the list are % ignored (with a warning). % \item \opt{option=\meta{choice,literal}} If the given value is a % \meta{choice}, then the internal settings for that choice are % used. Any other value is used directly. % \item \opt{option=\meta{literal}} The given value is used as a % literal by the package. % \item \opt{option=\meta{csname}} These options expect a command % sequence as a value. % \item \opt{option=\meta{length}} Requires a \TeX\ length, for % example \opt{0.5ex}. % \item \opt{option=\meta{list}} Takes a list of one or more items, % which are not determined in advance. % \item \opt{option=\meta{number}} Takes a number (possibly % including an exponent part). %\end{itemize} % % The package has a large range of options, to allow full control of % the various features of the package. These control differing % aspects of the package, and are given below in groups based on % function. Where the key has a default value, it is given in bold. % %\subsection{Font family and style} % The font used when typesetting material can be tightly controlled % using \currpkg. A number of options affect how the package matches % the surrounding font, and the font families used to achieve this. % The default is to use the current upright maths serif font with no % variation. % %\DescribeOption{mode} %\DescribeOption{textmode} %\DescribeOption{valuemode} %\DescribeOption{unitmode} %\DescribeOption{obeymode} % The output of \currpkg can occur using either text or maths mode. % The package option \opt{mode} determines which is used: valid % options are \defaultopt{maths} and \opt{text}.\footnote{Here and in % all other cases, either UK or US spelling may be used. Thus % \opt{mode=maths} or \opt{mode=math} have exactly the same effect.} % The shortcut \opt{textmode} is provided for setting \opt{mode=text} % quickly. Further refinement is possible using the \opt{valuemode} % and \opt{unitmode} options. These apply to numbers (the output of % \cs{num} and the first mandatory argument of \cs{SI}) and units % (all other output), respectively. By setting the \opt{obeymode} % flag, the package will use the local typesetting mode (maths or % text). % %\DescribeOption{obeyall} %\DescribeOption{obeyfamily} %\DescribeOption{obeybold} %\DescribeOption{obeyitalic} % The detection and matching of surrounding text can be controlled % using a number of Boolean package options. \opt{obeyall} turns on % all of the detection. Thus output with \opt{obeyall} in force will % always match the local text appearance. \opt{obeyfamily} instructs % the package on detecting the surrounding font family (Roman, sans % serif, fixed width), but does not detect bold or italic. % \opt{obeybold} detects the local bold setting, whilst % \opt{obeyitalic} picks up italic fonts. % % Bold detection is influenced by the value of \opt{inlinebold}, % which takes values \defaultopt{text} and \opt{maths}. The package % can detect the local value of bold for either the surrounding text, % or the surrounding inline (|$|\ldots|$|) maths. The % \opt{obeyitalic} option does \emph{not} have the same facility % (maths is italic anyway). % %\DescribeOption{mathsrm} %\DescribeOption{mathssf} %\DescribeOption{mathstt} %\SpecialOptionIndex{mathrm} %\SpecialOptionIndex{mathsf} %\SpecialOptionIndex{mathtt} %\DescribeOption{textrm} %\DescribeOption{textsf} %\DescribeOption{texttt} % The font commands used by the package to achieve the above are all % available for user modification. The options \opt{mathsrm}, % \opt{mathssf} and \opt{mathstt} hold the command sequences used in % maths mode,\footnote{These can also be set using \opt{mathrm}, % \opt{mathsf} and \opt{mathtt}} while \opt{textrm}, \opt{textsf} and % \opt{texttt} do the same for text mode. By default, these contain % the obvious command names, for example \opt{mathsrm=mathrm} and % \opt{texttt=ttfamily}. However, they can be set at will: the macro % names indicate the nature of the surrounding text detected. For % example, the value of \opt{mathssf} is used in maths mode when the % surrounding text is sans serif. % %\SpecialOptionIndex{valuemathsrm} %\SpecialOptionIndex{valuemathssf} %\SpecialOptionIndex{valuemathstt} %\SpecialOptionIndex{valuemathrm} %\SpecialOptionIndex{valuemathsf} %\SpecialOptionIndex{valuemathtt} %\SpecialOptionIndex{unitmathsrm} %\SpecialOptionIndex{unitmathssf} %\SpecialOptionIndex{unitmathstt} %\SpecialOptionIndex{valuetextrm} %\SpecialOptionIndex{valuetextsf} %\SpecialOptionIndex{valuetexttt} %\SpecialOptionIndex{valuetextrm} %\SpecialOptionIndex{valuetextsf} %\SpecialOptionIndex{valuetexttt} %\SpecialOptionIndex{unittextrm} %\SpecialOptionIndex{unittextsf} %\SpecialOptionIndex{unittexttt} % Each of the font options can be given separately for the contents % of numbers and units. The option names include \opt{value} or % \opt{unit} before the mode name. For example, the \opt{mathsrm} % option may be split into \opt{valuemathsrm} and \opt{unitmathsrm}. % %\DescribeOption{detectdisplay} % The font detection system can treat displayed mathematical content % in two ways. This is controlled by the \opt{detectdisplay} option. % When set to \defaultopt{true}, display mathematics is treated % independently from the body of the document. Thus the local % \emph{maths} font is checked for matching. In contrast, when set % to \opt{false}, display material is treated with the current % running text font. %\begin{LaTeXexample} % \sffamily % Some text % \sisetup{obeyall} % \[ x = \SI{1.2e3}{\kg\kelvin\candela} \] % More text % \sisetup{detectdisplay=false} % \[ y = \SI{3}{\metre\second\mole} \] %\end{LaTeXexample} % %\subsection{Spacing and separators} %\DescribeOption{unitsep} %\DescribeOption{valuesep} %\DescribeOption{digitsep} %\DescribeOption{anglesep} % The separators between items can all be set using options taking a % list of pre-defined items or a literal value. The ``\opt{sep}'' % options (\opt{unitsep}, \opt{valuesep}, \opt{digitsep} and % \opt{anglesep}) all recognise \opt{thin}, \opt{medium}, \opt{med}, % \opt{thick}, \opt{space}, \opt{cdot}, \opt{times}, \opt{tightcdot}, % \opt{tighttimes}, \opt{fullstop}, \opt{stop}, \opt{period} and % \opt{none}. The named spaces are the normal maths separations, % with \opt{space} representing a full (non-breakable text) space, % and with the obvious meanings for \opt{cdot} and \opt{times}. The % \opt{tight} variants reduce the spacing available. Three possible % values are provided for ``|.|'', and \opt{none} yields no space at % all. In all cases, other values are treated literally and are % typeset in maths mode. The default value is \defaultopt{thin} for % all separations except \opt{anglesep}, which is set to % \defaultopt{none}. % %\DescribeOption{unitspace} %\DescribeOption{errspace} % The \opt{unitspace} and \opt{errspace} options again take a list % or literal value, but only the ``real'' spaces \opt{thin}, % \opt{medium}, \opt{med}, \opt{thick}, \opt{space} and \opt{none} % are recognised in the list. The \opt{unitspace} option controls the % output generated by an explicit space (|~|) inside a unit macro, % while \opt{errspace} is used to separate a bracketed error from the % main number. % %\subsection{Number formatting} %\DescribeOption{numdigits} %\DescribeOption{numdecimal} %\DescribeOption{numdiv} %\DescribeOption{numexp} %\DescribeOption{numsign} %\DescribeOption{numaddn} %\DescribeOption{numgobble} % There are two groups of options for formatting numbers. The first % group all begin with ``\opt{num}'', and take literal values used by % the package to parse numbers. \opt{numdigits} contains the valid % number symbols (\defaultopt{0123456789}), with \opt{numdecimal} % containing the decimal markers (\defaultopt{.,}). As in the % \numprint package, \opt{numexp} (the list of exponent markers) % recognises \defaultopt{deDE} as valid by default. \opt{numsign} % contains the sign markers for numbers % (\defaultopt{+-\cs{pm}\cs{mp}}). \opt{numdiv} holds the division % marker in numbers (\defaultopt{/}). \opt{numaddn} and \opt{numgobble} % both control which other characters do not give an error when present % in a number. \opt{numaddn} contains valid characters which should be % included in the final output ``as is'', whereas \opt{numgobble} lists % the characters that are completely ignored. In all cases, the % content of the options is a simple string, for example % \opt{numdigits=1234567890}. % %\DescribeOption{decimalsymbol} %\DescribeOption{digitsep} %\DescribeOption{sepfour} % The second group of number options control the output of numbers % after parsing. The symbol used by \currpkg as a decimal marker is % set by the \opt{decimalsymbol} option, which can take a list of % choices or a literal. The valid choices here are % \defaultopt{fullstop}, \opt{comma}, \opt{cdot} and % \opt{tightcdot}.\footnote{\opt{fullstop} also has aliases % \opt{stop} and \opt{period}.} Notice that this does not have to % agree with the input marker. The other separator for numerical % output is the division of digits into groups of three. The result % is dependent on two options. The previously-described % \opt{digitsep} option controls the spacing added between groups of % three numbers. For numbers consisting of exactly four digits, the % \opt{sepfour} Boolean option controls whether separation occurs in % these cases. The default is \defaultopt{false}. %\begin{LaTeXexample} % \num{1234}\\ % \num[sepfour]{1234} %\end{LaTeXexample} % %\DescribeOption{seperr} %\DescribeOption{numopenerr} %\DescribeOption{numcloseerr} % For numbers given with an error [\eg \num{1.23(4)}], the package % can separate out the error part, to give for example % \num[seperr]{1.23(4)}. This behaviour is activated by the % \opt{seperr} option, and requires that \opt{numopenerr} and % \opt{numcloseerr} contain the left- and right-hand delimiters for % the error [defaults \opt{numopenerr=(} and \opt{numcloseerr=)}]. %\begin{LaTeXexample} % \sisetup{seperr}\\ % \num{1.234(5)}\\ % \num{1.234(5)e6} %\end{LaTeXexample} %\DescribeOption{trapambigerr} %\DescribeOption{openerr} %\DescribeOption{closeerr} %\DescribeOption{tightpm} % If the number has an exponent, or if units are not repeated, then % the result can be considered ambiguous. By default, the package % adds the markers stored in \opt{openerr} and \opt{closeerr} to % remove the ambiguity; the options have the same default values as % the input error markers. Detection of a potentially-ambiguous % error is controlled by the \opt{trapambigerr} option, although for % numbers with units the \opt{repeatunits} option is also important. % The spacing around the $\pm$ sign is normally set by \TeX. However, % using the \opt{tightpm} option will cause this to be reduced to a % minimum. %\begin{LaTeXexample} % \sisetup{seperr}\\ % \num[trapambigerr=false]{1.234(5)e6}\\ % \SI{1.234(5)}{\metre}\\ % \sisetup{repeatunits=false} % \SI{1.234(5)}{\metre}\\ % \SI[trapambigerr=false]{1.234(5)}{\metre}\\ % \num[tightpm]{1.234(5)} %\end{LaTeXexample} % %\DescribeOption{numprod} %\DescribeOption{repeatunits} % The number processor can recognise products in the numerical input; % the symbols used for products are stored in \opt{numprod}, with the % default value of ``\opt{x}''. By default, the \cs{SI} macro will % repeat the units for a number given in this way. This behaviour is % altered by the \opt{repeatunits} option, which takes the values % \defaultopt{true}, \opt{false} and \opt{power}. The later applies % only when providing multiplied numbers with units, and converts the % unit to the appropriate power rather than repeating the % units.\footnote{This is a very simply option: do not expect it to % work with anything except areas and volumes.} Notice that when % applied to errors, \opt{repeatunits} takes priority over % \opt{trapambigerr}. %\begin{LaTeXexample} % \num{1 x 2 x 3}\\ % \SI{4 x 5 x 6}{\metre}\\ % \sisetup{repeatunits=false} % \SI{1.2 x 3.4 x 5.6}{\milli\metre\cubed}\\ % \SI[seperr]{1.234(5)}{\metre}\\ % \SI[seperr, % trapambigerr=false] % {9.1093897(54)e-31}{\kilo\gram}\\ % \SI[seperr,repeatunits, % trapambigerr=false] % {9.1093897(54)e-31}{\kilo\gram}\\ % \SI[repeatunits=power]{1 x 2 x 3}{\metre} %\end{LaTeXexample} % %\DescribeOption{expproduct} %\DescribeOption{expbase} %\DescribeOption{allowzeroexp} % The formatting of exponents is controlled by \opt{expproduct} and % \opt{expbase}. \opt{expproduct} sets the symbol used to indicate a % product for exponents (\eg the $\times$ in \num{2e2}), while the % value of \opt{expbase} sets the power used (the \num{10} in the % example). Both options accept a very short list of options: % \defaultopt{times}, \opt{tighttimes}, \opt{cdot} and % \opt{tightcdot} for the product, and \defaultopt{ten} and \opt{two} % for the power.\footnote{The \opt{tighttimes} and \opt{tightcdot} % options give the rather questionable results: % \num[expproduct=tighttimes]{1e2} and % \num[expproduct=tightcdot]{1e2}, as opposed to \num{1e2} and % \num[expproduct=cdot]{1e2}.} Other choices are used literally. Also % relevant to exponent processing is the \opt{allowzeroexp} option. % By default, the package will suppress a zero exponent, but setting % the flag will allow the output of \num[allowzeroexp]{e0}. % %\DescribeOption{addsign} %\DescribeOption{sign} %\DescribeOption{retainplus} % Additions to the input can take the form of implicit signs and % padded zeros. The \opt{addsign} option takes a list of potential % sites to add a sign: \defaultopt{none}, \opt{mantissa}, % \opt{exponent} and \opt{both}.\footnote{Aliases are provided: % \opt{mant} = \opt{mantissa}, \opt{exp} = \opt{exponent}, \opt{all} % = \opt{true} = \opt{both}, \opt{false} = \opt{none}.} If no sign % is given in the input, the setting here determines if one is added. % The sign to add is stored in \opt{sign}, which takes the list of % choices \defaultopt{plus}, \opt{minus}, \opt{pm} and \opt{mp}, or % uses the input literally (in maths mode). For positive numbers, % the \opt{retainplus} option causes a $+$ sign explicitly in the % input to be retained. By default, the package will remove such % signs. % %\DescribeOption{padnumber} % The \opt{padnumber} option controls the addition of zeros to the % input, to ``pad'' the result. The option takes a list of choices: % \defaultopt{leading}, \opt{trailing}, \opt{both} and % \opt{none}.\footnote{Aliases: \opt{all} = \opt{true} = \opt{both}, % \opt{false} = \opt{none}.} No additional precision is added by % this option; integer input will not add a decimal point. %\begin{LaTeXexample} % \num[padnumber=leading]{.1}\\ % \num[padnumber=leading]{2.}\\ % \num[padnumber=trailing]{3.}\\ % \num[padnumber=both]{4.}\\ % \num[padnumber=both]{.5}\\ % \num[padnumber=both]{6}\\ % \num[padnumber=none]{7.}\\ % \num[padnumber=none]{.8} %\end{LaTeXexample} % %\DescribeOption{fixdp} %\DescribeOption{dp} % In contrast to the \opt{padnumber} option, the package can alter % the precision of the input number if the \opt{fixdp} option is set. % The \opt{fixdp} option will fix the decimal places of the output to % the number stored in the \opt{dp} option. The later should be a % positive integer or zero. %\begin{LaTeXexample} % \sisetup{fixdp,dp=3} % \num{1}\\ % \num{53.9}\\ % \num{4.56783}\\ % \num{-1.2942}\\ % \num{-1.2959}\\ % \num{9.9999}\\ % \num{2.1264e90}\\ % \num[dp=0]{12.345} %\end{LaTeXexample} % %\DescribeOption{fixsf} %\changes{v1.1}{2008/08/22}{New \opt{fixsf} option} %\DescribeOption{sf} %\changes{v1.1}{2008/08/22}{New \opt{sf} option} % In contrast to the \opt{dp} option, the \opt{fixsf} and \opt{sf} % options control the number of significant figures in the output. % This never adds extra digits to the output, as significant figures % are concerned with accuracy. %\begin{LaTeXexample} % \sisetup{fixsf,sf=3} % \num{1}\\ % \num{53.9}\\ % \num{4.56783}\\ % \num{-1.2942}\\ % \num{-1.2959}\\ % \num{9.9999}\\ % \num{2.1264e90}\\ % \num{773322} %\end{LaTeXexample} % %\subsection{Angle formatting} %\DescribeOption{padangle} %\DescribeOption{strictarc} % The angle formatter uses \cs{num} to format numbers: any options % for numbers are therefore applicable here. The \opt{padangle} % option takes choices \defaultopt{small}, \opt{large}, \opt{all} and % \opt{none}, and controls how angles are padded when given in % degrees, minutes and seconds.\footnote{Aliases: \opt{all} = % \opt{true} = \opt{both}, \opt{false} = \opt{none}.} When giving % angles as arcs (in degrees, minutes and seconds), the package can % detect if the correct number of semi-colons have been given. This % is controlled by the \opt{strictarc} option, which is a Boolean % switch with a \defaultopt{true} default. With \opt{strictarc} set % to \opt{false}, an incomplete arc is interpreted as degrees and % minute, while an over-complete one will drop excess input. %\begin{LaTeXexample} % \ang[padangle=none]{1;;}\\ % \ang[padangle=large]{2;;}\\ % \ang[padangle=small]{3;;}\\ % \ang[padangle=both]{;4;}\\ % \ang[padangle=none]{;5;5}\\ % \ang[strictarc=false]{1;2}\\ % \ang[strictarc=false]{1;2;3;4;} %\end{LaTeXexample} % %\DescribeOption{angformat} % The angle formatting system can convert between decimal angles and % those given as degrees, minutes and seconds. This is controlled by % the \opt{angformat} option, which takes choices % \defaultopt{unchanged}, \opt{decimal} and % \opt{arc}.\footnote{Aliases: \opt{decimal} = \opt{dec}, \opt{arc} = % \opt{dms}, \opt{unchanged} = \opt{none}.} When set to % \opt{unchanged}, nothing is done to the input. The conversion is % based on \TeX\ dimensions, and is therefore limited in accuracy. % For this reason, the output is automatically rounded: output as a % decimal angle is limited to three places, and that as an arc is % given to a single decimal place for the seconds component. %\begin{LaTeXexample} % $\ang{1;2;3} = \ang[angformat=dec]{1;2;3}$\\ % $\ang{4.56} = \ang[angformat=arc]{4.56}$ %\end{LaTeXexample} % %\DescribeOption{astroang} % For astronomers, the \opt{astroang} option is provided. This % moves the degrees, minutes or seconds symbol (as appropriate) % over the decimal marker rather than after the number. %\begin{LaTeXexample} % \ang{1;2;3.4}\\ % \ang[astroang]{5;6;7.8} %\end{LaTeXexample} % %\subsection{Tabular material} %\DescribeOption{tabnumalign} % Material typeset in |S| columns is processed internally by the % \cs{num} macro. Thus, as with angles, the number options also % apply here. The positioning of tabular material is controlled by % the two options \opt{tabnumalign} and \opt{tabformat}. % \opt{tabnumalign} takes values \defaultopt{centredecimal}, % \opt{centre}, \opt{left} and \opt{right}.\footnote{Aliases % \opt{centerdecimal} = \opt{centredecimal}; \opt{center} = % \opt{centre}.} When using \opt{centredecimal}, the package places % the decimal marker of the mantissa at the centre of the column, % which then grows to accommodate the widest number given. For equal % numbers of digits before and after the decimal sign, this is the % easiest option. The other choices use a fixed-width box to store % the number; the box is then aligned with the edges of the column. % %\DescribeOption{tabformat} % The \opt{tabformat} option sets the amount of space reserved by % \currpkg for the alignment box when not using the % \opt{centredecimal} setting of \opt{tabnumalign}. The numerical % parts of \opt{tabformat} are interpreted as % \texttt{\meta{pre}\meta{dec}\meta{post}}; \meta{pre} and % \meta{post} are the number of digits before and after the decimal % sign, respectively. Both signs and exponents can be included in % \opt{tabformat}, resulting in appropriate space being reserved. The % entire \opt{tabformat} input is processed using the \cs{num} macro % internally. Thus the decimal and exponent signs used in % \opt{tabformat} are checked against \opt{numdecimal} and % \opt{numexp}, respectively. % %\DescribeOption{tabalignexp} %\DescribeOption{tabexpalign} %\changes{v1.1d}{2008/10/29}{Added \opt{tabexpalign} as an alias for % \opt{tabalignexp}} % When \opt{tabformat} contains exponents, two possibilities are % available for alignment. The first method is to place the exponent % parts so that the ``$\times 10$'' parts form a column, with % whitespace after shorter mantissa components. In the second % method, no additional space is added after the mantissa, and the % exponents do no line up (\ref{tab:alignexp}). This is controlled % by the \opt{tabalignexp} option, which can be set to % \defaultopt{true} or \opt{false}. The alias \opt{tabexpalign} is % available for this option. %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{The \opt{tabalignexp} option} % \label{tab:alignexp} % \sisetup{tabformat=1.3e2,tabnumalign=centre} % \begin{tabular}{SS[tabalignexp=false]} % \toprule % {Header} & {Header} \\ % \midrule % 1.2e3 & 1.2e3 \\ % 1.234e56 & 1.234e56 \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % %\DescribeOption{tabtextalign} %\DescribeOption{tabunitalign} %\DescribeOption{tabalign} % Cells containing no numbers are handled by \currpkg in a manner % similar to \cs{multicolumn}. The setting of \opt{tabtextalign} is % taken from the list \defaultopt{centre}, \opt{right} and % \opt{left}.\footnote{Alias \opt{centre} = \opt{center}.} As would % be expected, these settings centre, right- or left-align the cell % contents. In |s| columns, all content is treated as input to the % \cs{si} macro. The alignment of the contents relative to the cell % is controlled by the \opt{tabunitalign} option, which takes options % \defaultopt{left}, \opt{right} and \opt{centre}. The settings for % \opt{tabnumalign}, \opt{tabtextalign} and \opt{tabunitalign} can be % set to the same value in one go with the \opt{tabalign} option. % %\DescribeOption{tabautofit} % The contents of table cells can automatically be rounded or % zero-filled to the number of decimal places given in % \opt{tabformat}. This is activated by the \opt{tabautofit} Boolean % option. As \opt{tabformat} does not apply to columns with alignment % \opt{centredecimal}, \opt{tabautofit} is also inactive for these % columns (\ref{tab:autofit}). %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{The \opt{tabautofit} option} % \label{tab:autofit} % \sisetup{tabformat=1.3,tabnumalign=centre} % % Notice the overfull hbox which results with % % the first column % \begin{tabular}{% % S% % S[tabautofit]% % S[tabautofit,tabnumalign=centredecimal]} % \toprule % {Header} & {Header} & {Header} \\ % \midrule % 1.2 & 1.2 & 1.2 \\ % 1.2345 & 1.2345 & 1.2345 \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % %\DescribeOption{tabparseonly} % It is possible to turn off the automatic alignment of numbers % while retaining the ability to parse the |S| column input. % Setting \opt{tabparseonly} to \opt{true} will still parse the % column contents, but will not align the decimal markers. The % alignment of the cell is governed by \opt{tabnumalign} % (\ref{tab:parse}). %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{The \opt{tabparseonly} option} % \label{tab:parse} % \begin{tabular}{% % S[tabparseonly]% % S[tabparseonly,tabnumalign=left]% % S[tabparseonly,tabnumalign=right]} % \toprule % {Header} & {Header} & {Header} \\ % \midrule % 14.2 & 14.2 & 14.2 \\ % 1.23456 & 1.23456 & 1.23456 \\ % 1.2e3 & 1.2e3 & 1.2e3 \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % %\subsection{Units} %\DescribeOption{per} % Most of the unit options are concerned with the processing of named % units. The processor for units given as macro names can be % influenced to give a variety of output formats. The \opt{per} % option defines how the keyword macro \cs{per} is handled. This % option takes a choice from the list \defaultopt{reciprocal}, % \opt{slash} and \opt{fraction}.\footnote{Aliases \opt{reciprocal} = % \opt{rp} = \opt{power}, \opt{fraction} = \opt{frac}.} The default % option uses \cs{per} to indicate reciprocal powers, whereas % \opt{slash} causes the package to use ``$/$'' to show division. % %\DescribeOption{fraction} %\DescribeOption{slash} % The \opt{fraction} option defines how \opt{per=fraction} is % interpreted. The list of applicable values here is % \defaultopt{frac}, \opt{nice}, \opt{ugly} and \opt{sfrac}. In each % case, the unit is typeset as a fraction, but the macro use to % achieve this varies. \opt{frac} uses the \TeX\ \cs{frac}, macro, % while \opt{nice} makes use of a \cs{nicefrac}-like method. The % \opt{ugly} option uses a slash in text mode and \cs{frac} in maths % mode.\footnote{Similar to the \pkg{ugly} option of the % \pkg{nicefrac} package.} Finally, the setting \opt{fraction=sfrac} % uses the \cs{sfrac} macro from the \pkg{xfrac} package, when % available.\footnote{\pkg{xfrac} is part of the experimental system % for \LaTeX3. As it requires a number of additional packages to % work, \currpkg does not load \pkg{xfrac}. If it is unavailable, the % \opt{sfrac} setting will fall back to using \cs{nicefrac}. See the % \pkg{xfrac} documentation for reasons to prefer \cs{sfrac} to % \cs{nicefrac}.} The \opt{slash} option sets the symbol used when % \opt{per=slash} is in force. This recognises the single keyword % \opt{slash}; anything else is used literally. %\begin{LaTeXexample} % \sisetup{per=fraction} % \si[fraction=frac]{\metre\per\second}\\ % \si[fraction=nice]{\metre\per\second}\\ % \si[fraction=sfrac]{\metre\per\second}\\ % \si[per=slash]{\metre\per\second} %\end{LaTeXexample} % %\DescribeOption{stickyper} % By default, \cs{per} applies only to the next unit % given.\footnote{This is the standard method of reading units in % English: for example, \si{\joule\per\mole\per\kelvin} is pronounced % ``joules per mole per kelvin''.} By setting the \opt{stickyper} % flag, this behaviour is changed so that \cs{per} applies to all % subsequent units.\footnote{This is the behaviour in \SIunits.} %\begin{LaTeXexample} % \si{\kilogram\per\metre\ampere}\\ % \si[stickyper]{\kilogram\per\metre\ampere} %\end{LaTeXexample} % %\DescribeOption{trapambigfrac} %\DescribeOption{openfrac} %\DescribeOption{closefrac} % When using \opt{per=slash}, multiple units in the denominator will % yield a potentially ambiguous result. The \opt{trapambigfrac} % determines whether the package checks for this: this takes % \defaultopt{true} and \opt{false}. When set, the contents of % \opt{openfrac} are inserted before the denominator, and % \opt{closefrac} is inserted after. %\begin{LaTeXexample} % \sisetup{trapambigfrac,openfrac=(,closefrac=),per=slash}\\ % \si{\metre\per\second\per\kilogram}\\ % \si[trapambigfrac=false]{\metre\per\second\per\kilogram} %\end{LaTeXexample} % %\DescribeOption{prefixsymbolic} %\DescribeOption{prefixbase} %\DescribeOption{prefixproduct} % The unit prefixes (\cs{kilo}, \etc) are normally given as letters. % However, the package can convert these into numerical % powers.\footnote{Provided things are not too complex!} This is % controlled by the \opt{prefixsymbolic} Boolean option, which by % default is \defaultopt{true}. If \opt{prefixsymbolic} is set to % \opt{false}, the format of the prefix is controlled by % \opt{prefixbase} and \opt{prefixproduct}, which work in the same % way as \opt{expbase} and \opt{expproduct}. % %\DescribeOption{prespace} %\DescribeOption{xspace} %\DescribeOption{allowoptarg} % By default, the single unit macros (\eg \cs{metre}) add no space % either before or after the unit. Setting the \opt{xspace} flag to % true means that the single macros are followed by the \cs{xspace} % command (when used outside of \cs{SI}/\cs{si}). For users of % \unitsdef, the \opt{prespace} macro changes the behaviour of the % unit macros, so that they can immediately follow a number. As a % result, the unit macros will \emph{always} be preceded by a fixed % space when the \opt{prespace} flag is true: this will be in % addition to any other space. Also relevant to users moving from % \unitsdef is the \opt{allowoptarg} option. This allows single unit % macros to take an optional numerical argument, in the same way that % occurs in that package. %\begin{LaTeXexample} % \metre is the symbol for metres\\ % \sisetup{xspace} % No, \metre is the correct symbol\\ % \sisetup{prespace} % 30\metre\\ % Do not use \metre in running text\\ % \sisetup{allowoptarg} % \metre[40] %\end{LaTeXexample} % %\subsection{Symbols} % User access to control the symbols used for \si{\ohm}, \si{\micro}, % \si{\degree}, \si{\arcmin}, \si{\arcsec}, \si{\angstrom} and % \si{\celsius} is provided here. These are all literal options, % which are available in text and maths mode variants. For example, % \opt{textmicro} is the code used for the \si{\micro} symbol in text % mode. The text mode macros should be safe when forced into text, % and the maths ones when forced into maths. The symbols defined in % this way are: %\newcommand*{\listsymbopt}[1]{\item \opt{#1}\SpecialOptionIndex{#1}} %\begin{itemize} % \listsymbopt{textOmega}; % \listsymbopt{mathsOmega}; % \listsymbopt{textmu}; % \listsymbopt{mathsmu}; % \listsymbopt{textdegree}; % \listsymbopt{mathsdegree}; % \listsymbopt{textminute}; % \listsymbopt{mathsminute}; % \listsymbopt{textsecond}; % \listsymbopt{mathssecond}; % \listsymbopt{textringA}; % \listsymbopt{mathsringA}; % \listsymbopt{textcelsius}; % \listsymbopt{mathscelsius}. %\end{itemize} % %\DescribeOption{redefsymbols} % When \currpkg is loaded, it can check for the presence of the % \pkg{textcomp} and \pkg{upgreek} packages, to provide better % symbols for certain items. To prevent this, set the % \opt{redefsymbols} option \opt{false} (the default is % \defaultopt{true}). % %\DescribeOption{eVcorra} %\DescribeOption{eVcorrb} % The \si{\electronvolt} symbol requires some fine-tuning, and so has % two options of its own, both \TeX\ lengths. \opt{eVcorra} is the % correction applied to the gap between ``e'' and ``V'' of the unit: % the default is \defaultopt{0.3ex}. \opt{eVcorrb} is the correction % applied to the gap between ``V'' of the unit and whatever follows; % the default is \defaultopt{0ex}. The optimal value for these % options will depend on the current font settings.\footnote{This % document uses \opt{eVcorra=0.1ex}.} %\begin{LaTeXexample} % \si[per=slash]{\electronvolt\per\metre}\\ % \si[per=slash,eVcorrb=0.7ex]{\electronvolt\per\metre} %\end{LaTeXexample} % %\subsection{Colour} %\DescribeOption{colourall} %\DescribeOption{colourunits} %\DescribeOption{colourvalues} %\SpecialOptionIndex{colorall} %\SpecialOptionIndex{colorunit} %\SpecialOptionIndex{colorvalue} % The package provides internal hooks for applying colour to part or % all of the output. This requires the user to load the \pkg{color} % or \pkg{xcolor} package to support colour in the output; \currpkg % will ignore a colour request if support is unavailable. The Boolean % options \opt{colourall}, \opt{colourunits} and \opt{colourvalues} % are used to turn application of a given colour on or off for all % output, only units and only values, respectively. All three % switches are available with US spelling, \eg \opt{colorall} and % \opt{colourall} behave in the same way. With colour turned off, no % \cs{color} command is issued internally, and output follows the % surrounding text. % %\DescribeOption{colour} %\DescribeOption{unitcolour} %\DescribeOption{valuecolour} %\SpecialOptionIndex{color} %\SpecialOptionIndex{unitcolor} %\SpecialOptionIndex{valuecolor} % The colour names to use for colouring output are set by the % \opt{colour}, \opt{unitcolour} and \opt{valuecolour} options (all % also available with US spelling). The \opt{colour} option % internally sets both \opt{unitcolour} and \opt{valuecolour}. %\begin{LaTeXexample} % {\color{brown} Text \num{50}}\\ % \sisetup{colourall,colour=green} % \SI{10}{\metre}\\ % {\color{purple} Text \num{70}}\\ % \sisetup{colourunits=true,colourvalues=false} % \SI{40}{\second} %\end{LaTeXexample} % %\DescribeOption{colourneg} %\DescribeOption{negcolour} %\SpecialOptionIndex{colorneg} %\SpecialOptionIndex{negcolor} % \currpkg can automatically add a colour to negative numbers. This % is turned on using the \opt{colourneg} switch. The colour used is % set by the \opt{negcolour} option; both options are available using % US spellings. % %\subsection{International support} %\DescribeOption{locale} % \currpkg allows the user to switch between the typographic % conventions of different (geographical) areas by using % \latin{locales}. Currently, the package is supplied with % configurations for locales \opt{UK}, \opt{USA}, \opt{DE} (Germany) % and \opt{ZA} (South Africa). The \opt{locale} option is used to % switch to a particular locale. %\begin{LaTeXexample} % \SI{1.234}{\metre}\\ % \SI[locale=DE]{6.789}{\metre} %\end{LaTeXexample} % %\DescribeOption{loctolang} % Locales are distinct from \pkg{babel} languages, as typographic % conventions are not tightly integrated with language. However, it % is useful to be able to associate a particular locale with a % \pkg{babel} language. The option \opt{loctolang} handles this, and % expects pairs of values: % \opt{loctolang=\meta{locale}:\meta{language}}. %\begin{LaTeXexample} % \sisetup{loctolang={UK:UKenglish,DE:german}}\\ % \SI{6.022e23}{\per\mole}\\ % \selectlanguage{german}\\ % \SI{6.022e23}{\per\mole} %\end{LaTeXexample} % %\subsection{Package control} %\DescribeOption{load} %\DescribeOption{noload} %\DescribeOption{alsoload} % The package keeps most of the unit and abbreviations definitions in % files separate from \file{siunitx.sty}. To control what is loaded, % three complementary options are provided, all of which take a list % of one or more choices. \opt{load} and \opt{alsoload} define which % support configuration files are loaded. The list in \opt{load} % recognises the value \opt{default}, which is expanded to the normal % list before loading. The difference between \opt{load} and % \opt{alsoload} is that \opt{load} specifies the \emph{complete} % list of files to load, whereas \opt{alsoload} adds to the existing % list. To use the \opt{load} option successfully requires knowing % everything that is needed. The \opt{noload} option can be used to % delete one or more items from the \opt{load} list, without needing % to know what is on it.\footnote{\opt{noload} does not prevent the % loading of a file needed by one which is loaded. Thus the package % may internally override a \opt{noload} value if needed.} % %\DescribeOption{log} %\DescribeOption{debug} % To control data written to the \ext{log} file, the \opt{log} option % is provided. This takes a value from the list \defaultopt{normal}, % \opt{none}, \opt{minimal}, \opt{errors} and \opt{debug}. As would % be expected, these indicate the amount of detail written to the log % file. As a shortcut to \opt{log=debug}, the package also recognises % the \opt{debug} option directly. % %\DescribeOption{strict} % Some users will want to stick closely to the official rules for % typesetting units. This could be made complicated if the options % for non-standards behaviour could not be turned off. The load-time % option \opt{strict} resets package behaviour to follow the rules % closely, and disables options which deviate from this. If the % package is loaded with the \opt{strict} option, all output is made % in maths mode using the upright serif font. % %\subsection{Back-compatibility options} %\DescribeOption{emulate} % The package can emulate \SIunits, \SIstyle, \unitsdef, \units, % \pkg{hepunits}, \pkg{fancyunits} and \pkg{fancynum}. Giving the % \opt{emulate=\meta{package}} option will give the desired % emulation, and combinations which would be possible with the real % packages will also work here. The package will recognise the % options of the emulated packages. This will automatically cause % emulation to be switched on. % %\subsection{Summary of all options} % \ref{tab:allopt} lists a summary of the package options (excluding % those for backward-compatibility). A reminder or the input format % is also provided. %\begin{longtable}{>{\ttfamily}lll} % \caption{All package options\label{tab:allopt}}\\ % \toprule % Option & Type & Description \\ % \midrule % \endfirsthead % \toprule % Option & Type & Description \\ % \midrule % \endhead % \bottomrule % \multicolumn{3}{r}{\emph{Continued on next page}} % \endfoot % \bottomrule % \endlastfoot % addsign & List & Add sign to number \\ % allowzeroexp & Boolean & Allow \num[allowzeroexp]{e0} \\ % angformat & List & Conversion of angle format \\ % anglesep & List or literal & Space between angle components \\ % astroang & Boolean & Astronomy-style angles \\ % closeerr & Literal & Closes potential-ambiguous error \\ % closefrac & Literal & Closes potential-ambiguous fraction \\ % color & Literal & Colour used for units and values \\ % colour & Literal & Colour used for units and values \\ % colorall & Boolean & Switch for colouring all output \\ % colourall & Boolean & Switch for colouring all output \\ % colorneg & Boolean & Colour negative numbers \\ % colourneg & Boolean & Colour negative numbers \\ % colorunits & Boolean & Switch for colouring units \\ % colourunits & Boolean & Switch for colouring units \\ % colorvalues & Boolean & Switch for colouring values \\ % colourvalues & Boolean & Switch for colouring values \\ % decimalsymbol & List or literal & Decimal symbol \\ % debug & Boolean & Write debugging data to log \\ % detectdisplay & Boolean & Treat display maths separately \\ % digitsep & List & Separation of digits in large numbers \\ % dp & Integer & Number of decimal places to \\ % & & output numbers to \\ % emulate & Modules & Emulation modules to load \\ % errspace & List & Spacing of bracketed error \\ % eVcorra & Length & Spacing correction in \eV \\ % eVcorrb & Length & Spacing correction after \eV \\ % expbase & List or literal & Base used for exponents \\ % expproduct & List or literal & Product sign for exponents \\ % fixdp & Boolean & Switch for fixing decimal \\ % & & places of numbers \\ % fixsf & Boolean & Switch for fixing significant \\ % & & figures of numbers \\ % fraction & List & Method used when setting \opt{per=frac} \\ % inlinebold & List & Select how inline bold is tested \\ % load & Modules & Modules to load \\ % locale & Modules & Locale to follow \\ % loctolang & Special & Associate locale with \pkg{babel} % language \\ % log & List & Amount of data added to log \\ % mathOmega & Literal & ``$\makeatletter\si@mathsOmega\makeatother$'' % symbol in maths mode \\ % mathcelsius & Literal & ``$\makeatletter\si@mathscelsius\makeatother$'' % symbol in maths mode \\ % mathdegree & Literal & ``$\makeatletter\si@mathsdegree\makeatother$'' % symbol in maths mode \\ % mathminute & Literal & ``$\makeatletter\si@mathsminute\makeatother$'' % symbol in maths mode \\ % mathmu & Literal & ``$\makeatletter\si@mathsmu\makeatother$'' % symbol in maths mode \\ % mathringA & Literal & ``$\makeatletter\si@mathsringA\makeatother$'' % symbol in maths mode \\ % mathrm & Csname & Roman maths font \\ % mathsOmega & Literal & ``$\makeatletter\si@mathsOmega\makeatother$'' % symbol in maths mode \\ % mathscelsius & Literal & ``$\makeatletter\si@mathscelsius\makeatother$'' % symbol in maths mode \\ % mathsdegree & Literal & ``$\makeatletter\si@mathsdegree\makeatother$'' % symbol in maths mode \\ % mathsecond & Literal & ``$\makeatletter\si@mathssecond\makeatother$'' % symbol in maths mode \\ % mathsf & Csname & Sans serif maths font \\ % mathsminute & Literal & ``$\makeatletter\si@mathsminute\makeatother$'' % symbol in maths mode \\ % mathsmu & Literal & ``$\makeatletter\si@mathsmu\makeatother$'' % symbol in maths mode \\ % mathsringA & Literal & ``$\makeatletter\si@mathsringA\makeatother$'' % symbol in maths mode \\ % mathsrm & Csname & Roman maths font \\ % mathssecond & Literal & ``$\makeatletter\si@mathssecond\makeatother$'' % symbol in maths mode \\ % mathssf & Csname & Sans serif maths font \\ % mathstt & Csname & Fixed-width maths font \\ % mathtt & Csname & Fixed-width maths font \\ % mode & List & Use text or maths mode for \\ % & & typesetting \\ % negcolor & Literal & Colour used for negative numbers \\ % negcolour & Literal & Colour used for negative numbers \\ % noload & Modules & Modules not to load \\ % numaddn & Literal & Additional input allowed in numbers \\ % numcloseerr & Literal & Character indicating end of \\ % & & numerical error\\ % numdecimal & Literal & Decimal symbols in numbers \\ % numdigits & Literal & Digit characters in numbers \\ % numdiv & Literal & Division characters in numbers \\ % numexp & Literal & Exponent characters in numbers \\ % numgobble & Literal & Characters to ignore in numbers \\ % numopenerr & Literal & Character indicating start of \\ % & & numerical error\\ % numprod & Literal & Characters used for a product \\ % numsign & Literal & Sign characters in numbers \\ % obeyall & Boolean & Combination of \opt{obeybold}, \\ % & & \opt{obeyitalic} and \opt{obeymode} \\ % obeybold & Boolean & Check local bold setting \\ % obeyitalic & Boolean & Check local italic setting \\ % obeymode & Boolean & Check local mode (text/maths) \\ % openerr & Literal & Opens potentially-ambiguous error \\ % openfrac & Literal & Opens potentially-ambiguous fraction \\ % padangle & List & Add zeros to blank parts of angles \\ % padnumber & List & Add zeros to blank parts of numbers \\ % per & List & Behaviour of \cs{per} \\ % prefixbase & List or literal & Base used when making prefixes \\ % & & numerical \\ % prefixproduct & List or literal & Product sign for prefixes \\ % prefixsymbolic & Boolean & Behaviour of unit prefixes\\ % prespace & Boolean & Add space before units \\ % redefsymbols & Boolean & Use better symbols if available \\ % repeatunits & List & Repeat units with separated errors \\ % & & and products \\ % retainplus & Boolean & Retain explicit plus sign\\ % seperr & Boolean & Separate number and error \\ % sepfour & Boolean & Separate four-digit numbers \\ % sf & Integer & Number of significant figures \\ % & & to output numbers to \\ % sign & List or literal & Sign to add to numbers \\ % slash & List or literal & Symbol used for ``/'' \\ % stickyper & Boolean & Require \cs{per} only once \\ % strict & Boolean & Obey the rules strictly \\ % strictarc & Boolean & Require exactly zero or \\ % & & two semi-colons \\ % tabalign & List & Positioning of all column data \\ % tabalignexp & Boolean & Alignment of exponents in tables \\ % tabautofit & Boolean & Switch for rounding numbers to \\ % & & length given by \opt{tabformat} \\ % tabformat & Number & Space reserved in table for numbers \\ % tabnumalign & List & Alignment of |S| column numbers \\ % tabparseonly & Boolean & Do not align |S| columns \\ % & & on decimal marker \\ % tabtextalign & List & Positioning of text in |S| columns \\ % tabunitalign & List & Positioning of units in |s| columns \\ % textcelsius & Literal & ``$^{\circ}$C'' symbol in text mode \\ % textdegree & Literal & ``${\circ}$'' symbol in text mode \\ % textminute & Literal & ``$'$'' symbol in text mode \\ % textmu & Literal & ``$\upmu$'' symbol in text mode \\ % textomega & Literal & ``$\Omega$'' symbol in text mode \\ % textringa & Literal & ``\AA'' symbol in maths mode \\ % textrm & Csname & Roman text font \\ % textsecond & Literal & ``$''$'' symbol in text mode \\ % textsf & Csname & Sans serif text font \\ % texttt & Csname & Fixed-width text font \\ % tightpm & Boolean & Reduce space around $\pm$ \\ % trapambigerr & Boolean & Check for ambiguous errors \\ % trapambigfrac & Boolean & Check for ambiguous fractions \\ % unitcolor & Literal & Switch for colouring units \\ % unitcolour & Literal & Switch for colouring units \\ % unitmathrm & Csname & Roman maths font for units \\ % unitmathsf & Csname & Sans serif maths font for units \\ % unitmathsrm & Csname & Roman maths font for units \\ % unitmathssf & Csname & Sans serif maths font for units \\ % unitmathstt & Csname & Fixed-width maths font for units \\ % unitmathtt & Csname & Fixed-width maths font for units \\ % unitmode & List & As \opt{mode}, for units only \\ % unitsep & List or literal & Separator for units \\ % unitspace & List or literal & Space used for ``|~|'' in units \\ % valuecolor & Literal & Switch for colouring value \\ % valuecolour & Literal & Switch for colouring value \\ % valuemathrm & Csname & Roman maths font for values \\ % valuemathsf & Csname & Sans serif maths font for values \\ % valuemathsrm & Csname & Roman maths font for values \\ % valuemathssf & Csname & Sans serif maths font for values \\ % valuemathstt & Csname & Fixed-width maths font for values \\ % valuemathtt & Csname & Fixed-width maths font for values \\ % valuemode & List & As \opt{mode}, for values only \\ % valuesep & List or literal & Separator between value and unit \\ % xspace & Boolean & Use \pkg{xspace} after units \\ %\end{longtable} % %\section{Emulation of other packages} % \currpkg has been designed as a replacement for \SIunits, \SIstyle, % \unitsdef, \units, \pkg{hepunits}, \pkg{fancyunits} and % \pkg{fancynum}. It therefore provides options reproduce the % functions of all of these packages. In this way, \currpkg should % be usable as a straight replacement for the older % packages.\footnote{User macros means that they are described in the % package documentation; simply not containing an \texttt{@} does not % mean they will have been emulated.} This means for example that % the \cs{num} macro takes an optional star when emulating \SIstyle. % However, there are some points that should be remembered. In % particular, \currpkg validates numerical input, meaning that places % where a number is expected in the older packages \emph{require} a % number when emulated by \currpkg. % % The \numprint package has provided many useful ideas for the code % used here for number formatting. The basic use of the \cs{numprint} % (or \cs{np}) macro can be reproduced using \currpkg. However, % \numprint is large and complex, with its own backward-compatibility % options. As a result, emulation of \numprint is not provided here. % To use a \numprint document with \currpkg, the \cs{numprint} macro % could be provided using the following code. %^^A Need to deal with \cs{numprint} being defined. %\let\numprint\relax %\begin{LaTeXexample} % \newcommand*{\numprint}[2][]{\SI[obeymode]{#2}{#1}}\\ % \numprint{-123456} \\ % \numprint[N/mm^2]{-123456} %\end{LaTeXexample} %^^A Back to the normal - with \cs{newcommand} %\newcommand*{\numprint}{\pkg{numprint}\xspace} % % \currpkg can be used more-or-less directly to replace both % \pkg{dcolumn} and \pkg{rccol}. As is explained in the code % section, much of the column-alignment system here is taken from % \pkg{dcolumn}, while \pkg{rccol} provided a model for a % customisable system. However, neither package has been directly % emulated here. The |S| column type can be used to replace both |D| % and |R| columns by setting the appropriate package options. % %\section{Configuration files} % \currpkg is a modular package. The unit definitions, abbreviations % and locales are all stored in configuration files. These all take % names of the form \file{si-\meta{name}.cfg}, where \meta{name} is % the part of the filename used as an option in \cs{sisetup} or when % loading \currpkg. Producing new configuration files therefore % consists of making a suitably-named file and adding it to the path % searched by \TeX. The files should normally consist of settings % (in \cs{sisetup}) and unit definitions, \etc. % %\DescribeMacro{\addtolocale} % To allow arbitrary macros to be stored in locales, the % \cs{addtolocale} macro is provided. This ensures that arbitrary % text is only executed when using a locale, not when loading it. The % macro takes two arguments, \marg{locale} and \marg{code}. %\begin{LaTeXexample} % \addtolocale{DE}{TEST} % Some text as filler \\ % \sisetup{locale=DE} % This example is rather trivial! %\end{LaTeXexample} % %\DescribeMacro{\requiresiconfigs} % To load one or more configuration files from inside another % configuration file, the \cs{requiresiconfigs} macro is provided. % This accepts a comma-separated list of configuration names, in the % same way as \opt{load} or \opt{noload}. % % In addition to the various configuration files provided with the % package, a local file \file{siunitx.cfg} may be provided. This is % read at the end of loading \currpkg, and allows the user to include % any local definitions or settings easily. % %\section{Common questions} %\subsection{Why do I need \cs{per} more than once?} % The unit engine of \currpkg is based around the English method for % reading units out loud. Thus \si{\joule\per\mole\per\kelvin} is % pronounced ``joules per mole per kelvin''. Hence by default you % need to put \cs{per} before each item in the denominator of a unit. % The behaviour can be altered by setting the \opt{stickyper} option. % %\subsection{Why is the order of my units changed?} % Then using \opt{per=reciprocal}, the units are typeset as given. % However, when using \opt{per=slash} or \opt{per=fraction}, the % package needs to find which ones are in the denominator. It then % prints the numerator and denominator separately. So if you give a % unit in the denominator \emph{before} one in the numerator, they % have to be re-ordered.\footnote{``Double division'' % (\SI{1}{s/m/kg}) is mathematically incorrect.} %\begin{LaTeXexample} % \SI{88}{\per\kilogram\metre} \\ % \SI[per=slash]{66}{\per\kilogram\metre} %\end{LaTeXexample} % %\subsection{Why are compound units not recommended outside of % \cs{SI}/\cs{si}?} % To fully process units made up of several parts, the processor has % to know where the end of the unit is. When the unit macros are % used outside of \cs{SI}/\cs{si}, this is not the case. The package % therefore does its best, but results may be sub-optimal. To get % consistent results, either define a new \emph{single} unit, or keep % compound units inside \cs{SI} and \cs{si}. %\begin{LaTeXexample} % \metre\per\micro\second \\ % \si{\metre\per\micro\second} \\ % \newunit{\myunit}{\metre\per\micro\second} % \myunit % \newunit{\myunittwo}{\kilogram\myunit} \\ % \myunittwo \\ % \kilogram\myunit %\end{LaTeXexample} % Notice the difference in behaviour of \cs{per} in the first two % lines, and the spacing error on the last line in the example. % %\subsection{How do I set superscripts to use lining numbers?} % Lowercase (``old style'') numbers are favoured by many people for % use in running text. However, this does not necessarily look good % in superscripts. The mode used to typeset data can be varied, so % that maths mode numbers are used for the unit part of the output. %\begin{LaTeXexample} % \SI[mode=text]{1234}{\metre\per\second}\\ % \SI[valuemode=text,unitmode=maths]{1234}{\metre\per\second} %\end{LaTeXexample} % %\subsection{Why do most of the examples use % \texorpdfstring{\si{\joule\per\mole\per\kelvin}}{J mol-1 K-1}?} % The package author is a chemist, and this is the unit of entropy % (disorder). It nicely demonstrates the use of the \cs{per} macro, % and so it crops up a lot. It is also in the subsection heading % here to act as a test with \pkg{hyperref} and moving arguments! % %\subsection{What can \numprint do that \currpkg cannot?} % \currpkg uses a lot of ideas from \numprint: a reasonable amount of % the number-processing code here is based on that in \numprint. % However, the two packages have somewhat different aims, and as a % result there are things that \numprint can do that \currpkg does % not implement. The main features of \numprint not available here % are: %\begin{itemize} % \item General support for numbers with base other than $10$ (see % \pkg{nbaseprt}); % \item Alignment of the decimal marker of powers in tables; % \item Alignment of numbers in running text; % \item Specific formatting commands for \TeX\ counters and lengths. %\end{itemize} % %\section{Tricks and known issues} % %\subsection{Ensuring maths mode} % Due to the possibility of output in either maths or text mode, any % input which requires a particular mode needs to be protected. You % cannot use |$|\ldots|$|, as this can get ``caught out'', but also % as it may give hard-to-follow errors. Always use \cs{ensuremath} % to force maths processing, and \cs{text} (from the \AMS\TeX\ % bundle) to ensure text mode. % %\subsection{Using \texttt{.} and fixed spaces in units} % To use a literal |.| in a unit, it has to be within an extra set of % braces. This does not need any extra protection, unlike the % situation with \SIstyle (for example, no \cs{text} macro is % needed). The fixed space (|~|) is more problematic: set % \opt{unitspace=space} to get a full space here. %\begin{LaTeXexample} % \newunit[unitspace=space]{\myunit}{V~vs{.}~NHE}% % \SI{10}{\myunit} %\end{LaTeXexample} % %\subsection{Passing unprocessed digits through an \texttt{S} % column} % The method used to detect numbers in an |S| column will pick up % material wrapped inside braces if there is more than a single % character inside the braces. If you want to pass a \emph{single} % numerical character without processing it, you need two sets of % braces (\ref{tab:S-limits}). %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{Passing single digit characters} % \label{tab:S-limits} % \begin{tabular}{S[colourall,colour=orange]} % \toprule % {Heading} \\ % \midrule % {1-2} \\ % {1} \\ % {{1}} \\ % {{-}} \\ % Using {-} gives an error! % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % %\subsection{Limitations of \cs{mathrm}} % The package uses the \cs{mathrm} font family by default to typeset % output in maths mode. This however has a few side-effects. For % example, the Greek alphabet can give odd results.\footnote{This % depends on your font setup; this document uses T1 encoding, which % shows the issue, whereas using OT1 does not.} The use of the % \cs{mathnormal} font \emph{may} get around this issue. %\begin{LaTeXexample} % \num[numaddn=\pi]{4\pi e-7}\\ % \num[numaddn=\pi,mathsrm=mathnormal]{4\pi e-7} %\end{LaTeXexample} % On the other hand, you may want to use text mode, in which case % \cs{ensuremath} is needed. Depending on the exact circumstances, % the \LaTeX\ protection mechanism (\cs{DeclareRobustCommand}) may be % sufficient; in some cases, this will fail and the \eTeX\ % \cs{protected} system may be required. There are several potential % pitfalls in this area; experimentation may well be needed. %\begin{LaTeXexample} % \DeclareRobustCommand*{\numpi}{\ensuremath{\pi}} % \num[numaddn=\numpi,mode=text]{4\numpi e-7} %\end{LaTeXexample} % %\subsection{Entire document in sans serif font} % If your entire document is not in a Roman font, using % the font detection system is not the most efficient method % for setting the \currpkg output. Instead, the \opt{mathrm} % and \opt{textrm} package options can be redefined. %\begin{LaTeXexample} % \sffamily % Some text \\ % \sisetup{obeyfamily=false,mathrm=mathsf,textrm=sffamily} % \num{1e2} \\ % \SI{3}{\newton} % \[ \SI{4e5}{\pascal} \] %\end{LaTeXexample} % %\subsection{Effects of emulation} % The package has been designed so that almost everything can be set % using the options. In the emulation code, some internal macros are % redefined. This is because the legacy packages do odd things, % which are deliberately not implemented by \currpkg. Using an % emulation file will prevent subsequent loading of the real package. % This is to prevent errors or, worse, difficult to diagnose changes % to output. % %\subsection{Centring columns on non-decimal input} % The \pkg{dcolumn} manual suggests using that package to align a % column on a $\pm$ sign. The same type of output is possible using % \currpkg, but some care is needed (\ref{tab:dcolumn}). Odd things % may happen: use with care! %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{Non-standard \texttt{S} column} % \label{tab:dcolumn} % \begin{tabular}{% % S[digitsep=none,decimalsymbol={\,\pm\,}, % numdigits={0123456789.},numdecimal=+]} % \toprule % {Some Values} \\ % \midrule % 2.3456 + 0.02 \\ % 34.2345 + 0.001 \\ % 56.7835 + 0.067 \\ % 90.473 + 0.021 \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % %\subsection{Expanding content in tables} % When processing |S| columns, \currpkg works hard to expand any % items which may give numbers. So for example you can define values % as macros (\ref{tab:vmacros}). To avoid the expansion of single % macros, you must either wrap them in two sets of braces or make % them robust (using either \cs{DeclareRobustCommand} or % \cs{protected}). %\begin{LaTeXexample}[float] % \begin{table} % \centering % \caption{Values as macros} % \label{tab:vmacros} % \newcommand*{\myvala}{1.234}% % \newcommand*{\myvalb}{20.345}% % \newcommand*{\myvalc}{0.987654}% % \DeclareRobustCommand*{\myvald}{88.88}% % \begin{tabular}{S[tabtextalign=left]} % \toprule % {Some Values} \\ % \midrule % \myvala \\ % \myvalb \\ % \myvalc \\ % {{\myvala}} \\ % \myvald \\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % % It is possible to use calculated values in tables. For this to % work, the calculation must take place before attempting to parse % the number. This means that any calculation code should be wrapped % in braces and appear before the use of the number. This is % illustrated by using the \pkg{datatool} package to set up a % miniature database, and then output the values doubled % (\ref{tab:calc}). This example also shows that macros such as % \cs{DLTforeach}, which construct a table while \TeX\ is running, % cannot be placed inside an |S| column (or an |s| one). Instead, an % additional dummy column has been added with no inter-column space. % This is used to contain the tale-building macro. %\begin{LaTeXexample}[float] % \DTLnewdb{data} % \DTLnewrow{data}\DTLnewdbentry{data}{value}{66.7012} % \DTLnewrow{data}\DTLnewdbentry{data}{value}{66.0212} % \DTLnewrow{data}\DTLnewdbentry{data}{value}{64.9026} % \begin{table} % \caption{Calculated values} % \label{tab:calc} % \centering % \sisetup{tabformat=2.4} % \begin{tabular}{SS@{}l} % \toprule % {Value} & {Doubled} & % \DTLforeach{data}{\myvalue=value}{% % \DTLiffirstrow {\\ \midrule}{\\}% % \myvalue & % First column % {\DTLmul{\myvalue}{\myvalue}{2}} \myvalue % second column % & }\\ % \bottomrule % \end{tabular} % \end{table} %\end{LaTeXexample} % %\subsection{Adding items after the last column of a tabular} % If you use an |S| or |s| column as the last one in a tabular, and % you use the \pkg{array} ``|<|'' construction to add items after it, % the spacing may be wrong. This will occur if the column contents % are of differing widths. Changing the \LaTeX\ |\\| line ending for % the plain \TeX\ \cs{cr} will give the correct spacing, but does not % allow adjustment of inter-row distance (\ref{tab:cr}).\footnote{For % the \TeX\ experts, the issue here is that the system to gather up % cell contents is added in using the \texttt{<} construction. % Normally, this comes after the cell contents and any other % \texttt{<} arguments, so collects the user additions. However, in % the last cell the contents include \texttt{\bslash\bslash}, which % is converted to \cs{cr} before gathering can occur. By using % \cs{cr} directly, the gathering process receives all of the cell % contents as normal.} In most cases, this should not be a serious % issue. Notice that an extra set of braces is needed here, compared % to usual \LaTeX\ use; this is to prevent any expansion of the % material by \currpkg. %\begin{LaTeXexample}[float] % \begin{table} % \caption{Correcting spacing in last \texttt{S} column} % \label{tab:cr} % \hfil % \begin{tabular}{S<{{\,\si{\kg}}}S<{{\,\si{\kg}}}} % \toprule % \multicolumn{1}{c}{Long header} & % \multicolumn{1}{c}{Long header} \\ % \midrule % 1.23 & 1.23 \\ % 4.56 & 4.56 \\ % 7.8 & 7.8 \\ % \bottomrule % \end{tabular} % \hfil % \begin{tabular}{S<{{\,\si{\kg}}}S<{{\,\si{\kg}}}} % \toprule % \multicolumn{1}{c}{Long header} & % \multicolumn{1}{c}{Long header} \\ % \midrule % 1.23 & 1.23 \cr % 4.56 & 4.56 \cr % 7.8 & 7.8 \cr % \bottomrule % \end{tabular} % \hfil % \end{table} %\end{LaTeXexample} % %\subsection{Using \currpkg\ with the \pkg{cellspace} package} % Both \currpkg\ and \pkg{cellspace} use the letter \texttt{S} for a % new column type. This obviously leads to a problem. If both are % loaded, \currpkg\ will retain the \texttt{S} column, and moves the % functionality of \pkg{cellspace} to the letter \texttt{C}. This % allows the normal use of \pkg{cellspace} with standard column types: % it does \emph{not} work with the \currpkg\ \texttt{S} or \texttt{s} % columns. % %\subsection{Using \currpkg\ with the \pkg{mathabx} package} %\changes{2008/11/26}{v1.1g}{Respect loading of \pkg{mathabx}} % The \pkg{mathabx} package defines its own \cs{second} and % \cs{degree} macros. This is respected by \currpkg: if you want the % \currpkg\ definitions instead, put the lines %\begin{LaTeXexample}[noexample] % \makeatletter % \renewunit{\second}{s} % \renewunit[valuesep=none]{\degree}{\si@sym@degree} % \makeatother %\end{LaTeXexample} % after |\begin{document}|. % %\iffalse %<*bug> %\fi %\section{Reporting a problem} % \currpkg is quite long and complicated, and works hard to cover all % possible eventualities. However, there will be bugs in the code % and unexpected interactions with other packages. If you think you % have found a bug, please report it. A short test-case % demonstrating the problem would be very welcome. The following is % a suitable template, and is available as \file{si-bug.ltx} in the % \texttt{doc/latex/siunitx} directory or by running the \ext{dtx} or % \ext{ins} file through \TeX. % \begin{macrocode} \listfiles \documentclass{article} % \end{macrocode} % Load other packages needed here. % \begin{macrocode} \usepackage{siunitx} % \end{macrocode} % Normally, debugging the load procedure will not be needed; the % debug option here means that all run-time information is logged. % \begin{macrocode} \sisetup{debug} \begin{document} This is the bug test-case document for the \textsf{siunitx} package.\\ Please put your demonstration here, and e-mail to the package author. \begin{center} \texttt{joseph.wright@morningtar2.co.uk} \end{center} \end{document} % \end{macrocode} %\iffalse % %\fi % %\section{Feature requests} % Feature requests for \currpkg are welcome. The package maintainer % will consider any ideas within the remit of the package (units and % values). If suggesting a new feature, an example of how it should % work would be appreciated. If new controls are needed, some % suggestions for option names would be welcome. % %\section{Acknowledgements} % Many thanks indeed to Stefan Pinnow, who has made a very large % number of suggestions and found numerous bugs in the package. His % contribution to the package has been vital. The package author has % learned \LaTeX\ tricks from far too many people to thank all of % them. However, for this package specific thanks must go to the % authors of the existing ``unit'' packages: Danie Els (\SIstyle), % Marcel Heldoorn (\SIunits), Patrick Happel (\unitsdef), Axel % Reichert (\units) and Harald Harders (\numprint). Will Robertson % and Heiko Oberdiek deserve much credit for demonstrating \LaTeX\ % coding best practice. Victor Eijkhout's excellent (and free) % \emph{\TeX\ by Topic} has provided some useful coding hints % \cite{Eijkhout}. The idea for combining and extending unit % provision in \LaTeX\ was heavily inspired by Philip Lehmann's % \pkg{biblatex}. Thanks to the various contributors of ideas for the % package: Donald Arseneau, Michele Dondi, Paul Gans, Ben Morrow, Lan % Thuy Pham, Alan Ristow, Patrick Heinze, Andrea Blomenhofer, Morten % H{\o}gholm, Burkhard Moddemann and Patrick Steegstra. % %\clearpage %\part{Correct application of (SI) units} %\section{Background} % Consistent and logical units are a necessity for scientific work, % and have applicability everywhere. Historically, a number of % systems have been used for physical units. SI units were % introduced by the \latin{Conf\'erence G\'en\'erale des Poids et % Mesures} (CGPM) in 1960. SI units are a coherent system based on % seven base units, from which all other units may be derived. % % At the same time, physical quantities with units are mathematical % entities, and as such way that they are typeset is important. In % mathematics, changes of type (such as using bold, italic, sans % serif typeface and so on) convey information. This means that % rules exist not only for the type of units to be used under the SI % system, but also the way they should appear in print. Advice on % best practice has been made available by the \emph{National % Institute of Standards and Technology} (NIST) \cite{NIST}. % % As befits an agreed international standard, the full rules are % detailed. It is not appropriate to reproduce these in totality % here; instead, a useful summary of the key points is provided. The % full details are available from the \latin{Bureau International des % Poids et Mesures} (BIPM) in French \cite{BIPM:FR} and English % \cite{BIPM:EN}. They also publish a very useful and detailed guide % to using units, values and so on, available online in a number of % different formats \cite{BIPM:PDF}. % % \currpkg takes account of the information given here, so far as is % possible. Thus the package defaults follow the recommendations % made for typesetting units and values. Spacing and so forth is % handled in such a way as to make implementing the rules % (relatively) easy. % %\section{Units} %\subsection{SI base units} % There are seven base SI units, listed in \ref{tab:baseunits}. Apart % from the kilogram, these are defined in terms of a measurable % physical quantity needing the definition alone.\footnote{Some base % units need others defined first; there is therefore a required % order of definition.} The base units have been chosen such that % all physical quantities can be expressed using an appropriative % combination of these units, needing no others and with no % redundancy. The kilogram is slightly different from the other base % units as it is still defined in terms of a ``prototype'' held in % Paris.\footnote{At the time of writing, this is under review and % will be altered.} % %\subsection{SI derived units} % All other units within the SI system are regarded as ``derived'' % from the seven base units. At the most basic, all other SI units % can be expressed as combinations of the base units. However, many % units (listed in \ref{tab:derived}, \ref{tab:experimental} and % \ref{tab:accepted}) have a special name and symbol.\footnote{The % nautical mile has a given name but no agreed symbol, and although % accepted by the SI is not provided by \currpkg as a unit macro.} % Most of these units are simple combinations of one or more base % units (raised to powers as appropriate). A small number of units % derived from experimental data are allowed as SI units % (\ref{tab:experimental}). % % Some of these units (in \ref{tab:accepted}) are regarded as only % ``temporarily'' accepted, as the use of only the base and % fully-consistent derived units in \ref{tab:derived} is encouraged. % They are accepted as they are in common use in one or more % disciplines; some are still very widespread in the appropriate % areas. These units are mainly multiples of base units (for % example, a tonne is \SI{1000}{\kilo\gram}). % % One point to note is that ``unitless ratios'' are regarded as % having base units which cancel out. For example, the radian is % regarded as having base unit \si{\metre\per\metre}. The result of % this division (``$1$'') is therefore regarded as a derived SI unit % in this context. % %\subsection{SI prefixes} % A series of SI prefixes for decimal multiples and submultiples are % provided, and can be used as modifiers for any SI unit (either base % or derived units) with the exception of the kilogram. The prefixes % are listed in \ref{tab:prefix}. No space should be used between a % prefix and the unit, and only a single prefix should be used. Even % the degree Celsius can be given a prefix, for example % \SI{1}{\milli\celsius}. The only exception to this rule is for % degrees, minutes and seconds of an arc: \ang{1;2;3}. % % It is important to note that the kilogram is the only SI unit with % a prefix as part of its name and symbol. Only single prefix may % b