summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/si/si.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/si/si.sty')
-rw-r--r--Master/texmf-dist/tex/latex/si/si.sty2140
1 files changed, 2140 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/si/si.sty b/Master/texmf-dist/tex/latex/si/si.sty
new file mode 100644
index 00000000000..47c94e3f630
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/si/si.sty
@@ -0,0 +1,2140 @@
+%%
+%% This is file `si.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% si.dtx (with options: `package')
+%% ----------------------------------------------------------------
+%% The si 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
+%% ----------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{si}%
+ [2008/02/18 v0.6 A comprehensive (SI) units package]
+\PackageInfo{si}
+ {This package is experimental. \MessageBreak The interface and
+ functionality is subject to review \MessageBreak and may be changed
+ in later releases}
+\begingroup
+ \@ifundefined{eTeXversion}
+ {\PackageError{si}
+ {Not running under e-TeX}
+ {This package requires e-TeX. Try compiling the document
+ with\MessageBreak `elatex' instead of `latex'. When using
+ pdfTeX, try `pdfelatex'\MessageBreak instead of `pdflatex'}%
+ \endgroup\endinput}
+ {\endgroup}
+\RequirePackage{xkeyval}
+\@ifpackagelater{xkeyval}{2005/05/07}
+ {}
+ {\PackageError{si}
+ {xkeyval >= 2.5 required}
+ {si requires the `xkeyval' package, version 2.5 or
+ later.\MessageBreak The version loaded is:
+ `\@nameuse{ver@xkeyval.sty}'.\MessageBreak
+ This is a fatal error; the package will abort.}%
+ \endinput}
+\RequirePackage{amstext,array,xspace}
+\newcommand*{\si@tempa}{}
+\newcommand*{\si@tempb}{}
+\newcommand*{\si@tempc}{}
+\newif\ifsi@switch
+\newcommand*{\si@packagecheck}{%
+ \begingroup
+ \@for\si@tempa:=SIunits,siunits,sistyle,SIstyle,unitsdef\do{%
+ \@ifpackageloaded{\si@tempa}
+ {\PackageError{si}
+ {Package `\si@tempa' incompatible}
+ {The `\si@tempa' package and `si' are
+ incompatible.\MessageBreak Use the
+ `emulate=\si@tempa' package option when loading si.}}
+ {}}
+ \@for\si@tempa:=units\do{%
+ \@ifpackageloaded{\si@tempa}
+ {\PackageWarning{si}
+ {Consider loading the si package with\MessageBreak
+ option `emulate=\si@tempa', rather than\MessageBreak
+ loading both \si@tempa and si}}
+ {}}
+ \endgroup}
+\si@packagecheck
+\AtBeginDocument{\si@packagecheck}
+\newcommand*{\si@ifdefinable}[1]{%
+ \expandafter\expandafter\expandafter\@ifundefined%
+ \expandafter\expandafter\expandafter%
+ {\expandafter\@gobble\string#1}}
+\newcommand*{\si@addtolist}[2]{%
+ \ifx\@empty#1\@empty
+ \edef#1{#2}%
+ \else
+ \edef#1{#1,#2}%
+ \fi}
+\newtoks{\si@temptoks}
+\newcommand*{\si@addtocsname}[2]{%
+ \@ifundefined{#1}
+ {\@namedef{#1}{#2}}
+ {\si@temptoks\expandafter\expandafter\expandafter{%
+ \csname #1\endcsname#2}%
+ \expandafter\edef\csname #1\endcsname{\the\si@temptoks}}}
+\begingroup
+ \catcode`\Q=3
+ \long\gdef\si@xifmtarg#1#2Q#3#4#5\@nil{#4}
+ \long\gdef\si@ifnotmtarg#1{%
+ \si@xifmtarg#1QQ\@firstofone\@gobble\@nil}
+\endgroup
+\newif\ifsi@debug
+\newif\ifsi@logmin
+\newif\ifsi@lognone
+\newcommand*{\si@log@err}[2]{%
+ \ifsi@lognone\else
+ \ifsi@logmin
+ \PackageWarning{si}{#1}%
+ \else
+ \PackageError{si}{#1}{#2}%
+ \fi
+ \fi}
+\newcommand*{\si@log@warn}[1]{%
+ \ifsi@lognone\else
+ \ifsi@logmin\else
+ \PackageWarning{si}{#1}%
+ \fi
+ \fi}
+\newcommand*{\si@log@inf}[1]{%
+ \ifsi@lognone\else
+ \ifsi@logmin\else
+ \PackageInfo{si}{#1}%
+ \fi
+ \fi}
+\newcommand*{\si@log@debug}[1]{%
+ \ifsi@lognone\else
+ \ifsi@debug
+ \PackageInfo{si}{#1}%
+ \fi
+ \fi}
+\newcommand*{\sisetup}[1]{%
+ \iffalse{\fi\ifnum0=`}\fi
+ \setkeys[si]{opt}{#1}%
+ \ifnum0=`{\fi\iffalse}\fi}
+\newcommand*{\si@opt@key}[2]{%
+ \define@key[si]{opt}{#1}
+ {#2\si@log@debug{Option #1 set to ##1}}}
+\newcommand*{\si@opt@cmdkey}[3][]{%
+ \define@cmdkey[si]{opt}[si@]{#2}[#1]{#3}}
+\newcommand*{\si@opt@cmdkeys}[2][]{%
+ \define@cmdkeys[si]{opt}[si@]{#2}[#1]}
+\newcommand*{\si@opt@boolkey}[2][]{%
+ \define@boolkey[si]{opt}[si@]{#2}[true]
+ {#1\si@log@debug{Option #2 set to ##1}}}
+\newcommand*{\si@opt@choicekey}[5][]{%
+ \define@choicekey*+[si]{opt}{#2}[\si@tempa]{#3}[#1]
+ {#4\si@log@debug{Option #2 set to ##1}}
+ {#5\si@log@debug{Option #2 set to ##1}}}
+\newcommand*{\si@opt@xchoicekey}[3]{%
+ \si@opt@choicekey[#3]{#1}{#2}
+ {\expandafter\renewcommand\expandafter*%
+ \csname si@#1\endcsname{\@nameuse{si@fix@##1}}}
+ {\expandafter\renewcommand\expandafter*%
+ \csname si@#1\endcsname{##1}}
+ \expandafter\newcommand\expandafter*\csname si@#1\endcsname%
+ {\@nameuse{si@fix@#3}}}
+\newcommand*{\si@opt@compatkey}[2]{%
+ \define@boolkey[si]{opt}[si@old@]{#2}[true]
+ {\si@log@debug{Emulating #1 package option\MessageBreak #2}%
+ \sisetup{emulate=#1}%
+ \si@log@debug{Option #2 set to ##1}}
+ \AtEndOfPackage{\si@opt@disablekey{#2}
+ {Compatibility option #2 only\MessageBreak
+ available when loading si package}}}
+\newcommand*{\si@opt@disablekey}[2]{%
+ \key@ifundefined[si]{opt}{#1}
+ {}
+ {\si@log@debug{Disabling key #1}%
+ \si@opt@key{#1}{\si@log@warn{#2}}}}
+\si@opt@choicekey[normal]{log}{debug,verbose,normal,errors,none}
+ {\si@debugfalse
+ \si@logminfalse
+ \si@lognonefalse
+ \renewcommand*{\si@tempb}{none}%
+ \ifx\si@tempa\si@tempb
+ \si@lognonetrue
+ \fi
+ \renewcommand*{\si@tempb}{minimal}%
+ \ifx\si@tempa\si@tempb
+ \si@logmintrue
+ \fi
+ \renewcommand*{\si@tempb}{debug}%
+ \ifx\si@tempa\si@tempb
+ \si@debugtrue
+ \fi
+ \renewcommand*{\si@tempb}{verbose}%
+ \ifx\si@tempa\si@tempb
+ \si@debugtrue
+ \fi}
+ {\si@log@warn{Unrecognised value `#1' for option log}}
+\si@opt@boolkey{debug}
+\newcommand*{\si@emulate}{}
+\si@opt@choicekey[SIunits]{emulate}
+ {SIunits,sistyle,numprint,units,unitsdef}
+ {\si@log@debug{Found emulation request for #1 package}%
+ \si@addtolist{\si@emulate}{#1}}
+ {\si@log@warn{Unknown value `#1' for option emulate
+ \MessageBreak No emulation will occur}}
+\AtEndOfPackage{%
+ \si@opt@disablekey{emulate}
+ {emulate option only available when\MessageBreak
+ loading package}}
+\si@opt@xchoicekey{unitsep}{thin,med,medium,thick,space,none,cdot,
+ times}{thin}
+\si@opt@xchoicekey{unitspace}{space,thin,med,medium,thick,none}
+ {thin}
+\si@opt@xchoicekey{valuesep}{space,thin,med,medium,thick,none}
+ {thin}
+\si@opt@xchoicekey{digitsep}
+ {thin,med,medium,thick,none,comma,stop,fullstop,period}{thin}
+\si@opt@xchoicekey{decimalsign}{comma,stop,fullstop,period,cdot}
+ {fullstop}
+\si@opt@xchoicekey{anglesep}{thin,med,medium,thick,none}{none}
+\si@opt@boolkey{obeymode}
+\newif\ifsi@textmode
+\si@opt@boolkey{textmode}
+\si@opt@choicekey{mode}{math,maths,text}
+ {\si@textmodefalse
+ \renewcommand*{\si@tempb}{text}%
+ \ifx\si@tempa\si@tempb
+ \si@textmodetrue
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option mode}}
+\si@opt@boolkey{obeyfamily}
+\si@opt@boolkey{obeybold}
+\newif\ifsi@inlinebtext
+\si@opt@choicekey{inlinebold}{text,maths,math}
+ {\si@inlinebtextfalse
+ \renewcommand*{\si@tempb}{text}%
+ \ifx\si@tempa\si@tempb
+ \si@inlinebtexttrue
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option inlinebold}}
+\si@opt@boolkey{obeyitalic}
+\si@opt@cmdkeys{mathsdefault,mathsrm,mathssf,mathstt}
+\si@opt@key{mathdefault}{\sisetup{mathsdefault=#1}}
+\si@opt@key{mathrm}{\sisetup{mathsrm=#1}}
+\si@opt@key{mathsf}{\sisetup{mathssf=#1}}
+\si@opt@key{mathtt}{\sisetup{mathstt=#1}}
+\si@opt@cmdkeys{textdefault,textrm,textsf,texttt}
+\si@opt@cmdkeys{mathnumdefault,textnumdefault}
+\si@opt@key{mathsnumdefault}{\sisetup{mathnumdefault=#1}}
+\si@opt@cmdkeys{numlist,numdecimal,numexp,numgobble,numsign,numextra}
+\newcommand*{\si@numvalid}{\si@numgobble\si@numexp\si@numsign%
+ \si@numdecimal\si@numlist\si@numextra}
+\si@opt@boolkey{sepfour}
+\si@opt@xchoicekey{expproduct}{times,cdot}{times}
+\si@opt@xchoicekey{exppower}{ten}{ten}
+\si@opt@xchoicekey{prefixproduct}{times,cdot,none}{times}
+\si@opt@xchoicekey{prefixpower}{ten,two}{ten}
+\newif\ifsi@prefixnum
+\si@opt@choicekey{prefix}{symbol,letter,power,number}
+ {\si@prefixnumfalse
+ \renewcommand*{\si@tempb}{power}%
+ \ifx\si@tempa\si@tempb
+ \si@prefixnumtrue
+ \fi
+ \renewcommand*{\si@tempb}{number}%
+ \ifx\si@tempa\si@tempb
+ \si@prefixnumtrue
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option prefix}}
+\newif\ifsi@num@padlead
+\newif\ifsi@num@padtrail
+\si@opt@choicekey[all]{padnumber}
+ {leading,lead,trailing,trail,all,both,true,none,false}
+ {\si@num@padleadfalse
+ \si@num@padtrailfalse
+ \renewcommand*{\si@tempb}{leading}%
+ \ifx\si@tempa\si@tempb
+ \si@num@padleadtrue
+ \fi
+ \renewcommand*{\si@tempb}{lead}%
+ \ifx\si@tempa\si@tempb
+ \si@num@padleadtrue
+ \fi
+ \renewcommand*{\si@tempb}{trailing}%
+ \ifx\si@tempa\si@tempb
+ \si@num@padtrailtrue
+ \fi
+ \renewcommand*{\si@tempb}{trail}%
+ \ifx\si@tempa\si@tempb
+ \si@num@padtrailtrue
+ \fi
+ \renewcommand*{\si@tempb}{all}%
+ \ifx\si@tempa\si@tempb
+ \si@num@padleadtrue
+ \si@num@padtrailtrue
+ \fi
+ \renewcommand*{\si@tempb}{true}%
+ \ifx\si@tempa\si@tempb
+ \si@num@padleadtrue
+ \si@num@padtrailtrue
+ \fi
+ \renewcommand*{\si@tempb}{both}%
+ \ifx\si@tempa\si@tempb
+ \si@num@padleadtrue
+ \si@num@padtrailtrue
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option padnumber}}
+\newif\ifsi@num@signmant
+\newif\ifsi@num@signexp
+\si@opt@xchoicekey{sign}{plus,minus,pm,mp}{plus}
+\si@opt@choicekey[all]{addsign}
+ {mantissa,exponent,mant,exp,all,both,true,none,false}
+ {\si@num@signmantfalse
+ \si@num@signexpfalse
+ \renewcommand*{\si@tempb}{mantissa}%
+ \ifx\si@tempa\si@tempb
+ \si@num@signmanttrue
+ \fi
+ \renewcommand*{\si@tempb}{mant}%
+ \ifx\si@tempa\si@tempb
+ \si@num@signmanttrue
+ \fi
+ \renewcommand*{\si@tempb}{exponent}%
+ \ifx\si@tempa\si@tempb
+ \si@num@signexptrue
+ \fi
+ \renewcommand*{\si@tempb}{exp}%
+ \ifx\si@tempa\si@tempb
+ \si@num@signexptrue
+ \fi
+ \renewcommand*{\si@tempb}{all}%
+ \ifx\si@tempa\si@tempb
+ \si@num@signmanttrue
+ \si@num@signexptrue
+ \fi
+ \renewcommand*{\si@tempb}{true}%
+ \ifx\si@tempa\si@tempb
+ \si@num@signmanttrue
+ \si@num@signexptrue
+ \fi
+ \renewcommand*{\si@tempb}{both}%
+ \ifx\si@tempa\si@tempb
+ \si@num@signmanttrue
+ \si@num@signexptrue
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option addsign}}
+\newif\ifsi@ang@padsmall
+\newif\ifsi@ang@padlarge
+\si@opt@choicekey[all]{padangle}
+ {small,large,all,both,true,none,false}
+ {\si@ang@padsmallfalse
+ \si@ang@padlargefalse
+ \renewcommand*{\si@tempb}{small}%
+ \ifx\si@tempa\si@tempb
+ \si@ang@padsmalltrue
+ \fi
+ \renewcommand*{\si@tempb}{large}%
+ \ifx\si@tempa\si@tempb
+ \si@ang@padlargetrue
+ \fi
+ \renewcommand*{\si@tempb}{all}%
+ \ifx\si@tempa\si@tempb
+ \si@ang@padsmalltrue
+ \si@ang@padlargetrue
+ \fi
+ \renewcommand*{\si@tempb}{true}%
+ \ifx\si@tempa\si@tempb
+ \si@ang@padsmalltrue
+ \si@ang@padlargetrue
+ \fi
+ \renewcommand*{\si@tempb}{both}%
+ \ifx\si@tempa\si@tempb
+ \si@ang@padsmalltrue
+ \si@ang@padlargetrue
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option padangle}}
+\si@opt@boolkey{astroang}
+\si@opt@cmdkey[-1]{tabformat}{}
+\si@opt@boolkey{xspace}
+\newif\ifsi@slash
+\newif\ifsi@frac
+\si@opt@choicekey[reciprocal]{per}
+ {reciprocal,rp,power,slash,frac,fraction}
+ {\si@slashfalse
+ \si@fracfalse
+ \renewcommand*{\si@tempb}{slash}%
+ \ifx\si@tempa\si@tempb
+ \si@fractrue
+ \si@slashtrue
+ \let\si@frac\si@frc@slash
+ \fi
+ \renewcommand*{\si@tempb}{frac}%
+ \ifx\si@tempa\si@tempb
+ \si@fractrue
+ \fi
+ \renewcommand*{\si@tempb}{fraction}%
+ \ifx\si@tempa\si@tempb
+ \si@fractrue
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option per}}
+\si@opt@xchoicekey{slash}{slash}{slash}
+\si@opt@cmdkeys{denrbrac,denlbrac}
+\si@opt@choicekey[frac]{fraction}
+ {frac,nicefrac,nice,sfrac,xfrac,uglyfrac,ugly}
+ {\let\si@frac\si@frc@frac
+ \renewcommand*{\si@tempb}{nicefrac}%
+ \ifx\si@tempa\si@tempb
+ \let\si@frac\si@frc@nice
+ \fi
+ \renewcommand*{\si@tempb}{uglyfrac}%
+ \ifx\si@tempa\si@tempb
+ \let\si@frac\si@frc@ugly
+ \fi
+ \renewcommand*{\si@tempb}{nice}%
+ \ifx\si@tempa\si@tempb
+ \let\si@frac\si@frc@nice
+ \fi
+ \renewcommand*{\si@tempb}{sfrac}%
+ \ifx\si@tempa\si@tempb
+ \let\si@frac\si@frc@sfrac
+ \fi
+ \renewcommand*{\si@tempb}{xfrac}%
+ \ifx\si@tempa\si@tempb
+ \let\si@frac\si@frc@sfrac
+ \fi
+ \renewcommand*{\si@tempb}{ugly}%
+ \ifx\si@tempa\si@tempb
+ \let\si@frac\si@frc@ugly
+ \fi}
+ {\si@log@warn{Unknown value `#1' for option fraction}}
+\si@opt@cmdkeys{load,noload}
+\si@opt@key{alsoload}{\si@addtolist{\si@load}{#1}}
+\AtEndOfPackage{%
+ \si@opt@disablekey{load}
+ {Configuration files can only be used\MessageBreak
+ when loading si}
+ \si@opt@disablekey{also}
+ {Configuration files can only be used\MessageBreak
+ when loading si}
+ \si@opt@disablekey{noload}
+ {Configuration files can only be used\MessageBreak
+ when loading si}}
+\si@opt@cmdkeys{textOmega,mathsOmega}
+\si@opt@key{mathOmega}{\sisetup{mathsOmega=#1}}
+\newcommand*{\si@mathsOmega}{\text{\ensuremath{\Omega}}}
+\newcommand*{\si@textOmega}{\ensuremath{\Omega}}
+\si@opt@cmdkeys{textmu,mathsmu}
+\si@opt@key{mathmu}{\sisetup{mathsmu=#1}}
+\DeclareFontEncoding{TS1}{}{}
+\DeclareFontSubstitution{TS1}{cmr}{m}{n}
+\DeclareTextSymbol{\si@textmu}{TS1}{181}
+\DeclareTextSymbolDefault{\si@textmu}{TS1}
+\DeclareFontFamily{OML}{eur}{\skewchar\font127}
+\DeclareFontShape{OML}{eur}{m}{n}%
+ {<5> <6> <7> <8> <9> gen * eurm %
+ <10><10.95><12><14.4><17.28><20.74><24.88>eurm10}{}
+\DeclareSymbolFont{greek}{OML}{eur}{m}{n}
+\DeclareMathSymbol{\si@mathsmu}{\mathord}{greek}{"16}
+\si@opt@cmdkeys{textdegree,mathsdegree,textminute,mathsminute,
+ textsecond,mathssecond}
+\si@opt@key{mathdegree}{\sisetup{mathsdegree=#1}}
+\si@opt@key{mathminute}{\sisetup{mathsminute=#1}}
+\si@opt@key{mathsecond}{\sisetup{mathssecond=#1}}
+\newcommand*{\si@textdegree}{\ensuremath{{}^{\circ}}}
+\newcommand*{\si@mathsdegree}{{}^{\circ}}
+\newcommand*{\si@textminute}{\ensuremath{{}^{\prime}}}
+\newcommand*{\si@mathsminute}{{}^{\prime}}
+\newcommand*{\si@textsecond}{\ensuremath{{}^{\prime\prime}}}
+\newcommand*{\si@mathssecond}{{}^{\prime\prime}}
+\si@opt@cmdkeys{textcelsius,mathscelsius}
+\si@opt@key{mathcelsius}{\sisetup{mathscelsius=#1}}
+\newcommand*{\si@textcelsius}{\si@textdegree C}
+\newcommand*{\si@mathscelsius}{\si@mathsdegree\mathrm{C}}
+\si@opt@cmdkeys{textringA,mathsringA}
+\si@opt@key{mathringA}{\sisetup{mathsringA=#1}}
+\newcommand*{\si@textringA}{\AA}
+\newcommand*{\si@mathsringA}{\text{\AA}}
+\si@opt@boolkey{redefsymbols}
+\AtBeginDocument{%
+ \si@opt@disablekey{redefsymbols}
+ {Symbols can only be redefined\MessageBreak
+ when loading si}}
+\newlength\si@eVcorra
+\newlength\si@eVcorrb
+\si@opt@key{eVcorra}{\setlength\si@eVcorra{#1}}
+\si@opt@key{eVcorrb}{\setlength\si@eVcorrb{#1}}
+\si@opt@cmdkeys{loadlocales,loctolang}
+\si@opt@cmdkey{locale}{%
+ \sisetup{loadlocales={#1}}%
+ \AtEndOfPackage{\si@loc@set{#1}}}
+\AtBeginDocument{%
+ \si@opt@disablekey{loadlocales}
+ {Locale files can only be loaded\MessageBreak
+ in the preamble}
+ \si@opt@disablekey{loctolang}
+ {Locale files can only be loaded\MessageBreak
+ in the preamble}
+ \si@opt@cmdkey{locale}{\si@loc@set{#1}}}
+\si@opt@compatkey{units}{ugly}
+\si@opt@compatkey{units}{nice}
+\si@opt@compatkey{units}{loose}
+\si@opt@compatkey{units}{tight}
+\si@opt@compatkey{unitsdef}{OHM}
+\si@opt@compatkey{unitsdef}{ohm}
+\si@opt@compatkey{unitsdef}{redef-gensymb}
+\newif\ifsi@gensymb
+\si@opt@compatkey{unitsdef}{LITER}
+\si@opt@compatkey{unitsdef}{liter}
+\si@opt@compatkey{unitsdef}{noxspace}
+\si@opt@compatkey{unitsdef}{noconfig}
+\si@opt@compatkey{unitsdef}{noabbr}
+\si@opt@compatkey{unitsdef}{noampereageabbr}
+\si@opt@compatkey{unitsdef}{nofrequncyabbr}
+\si@opt@compatkey{unitsdef}{nomolabbr}
+\si@opt@compatkey{unitsdef}{novoltageabbr}
+\si@opt@compatkey{unitsdef}{novolumeabbr}
+\si@opt@compatkey{unitsdef}{noweightabbr}
+\si@opt@compatkey{unitsdef}{noenergyabbr}
+\si@opt@compatkey{unitsdef}{nolengthabbr}
+\si@opt@compatkey{unitsdef}{notimeabbr}
+\si@opt@compatkey{SIunits}{cdot}
+\si@opt@compatkey{SIunits}{thickspace}
+\si@opt@compatkey{SIunits}{mediumspace}
+\si@opt@compatkey{SIunits}{thinspace}
+\si@opt@compatkey{SIunits}{thickqspace}
+\si@opt@compatkey{SIunits}{mediumqspace}
+\si@opt@compatkey{SIunits}{thinqspace}
+\si@opt@compatkey{SIunits}{amssymb}
+\si@opt@compatkey{SIunits}{squaren}
+\si@opt@compatkey{SIunits}{pstricks}
+\si@opt@compatkey{SIunits}{Gray}
+\si@opt@compatkey{SIunits}{italian}
+\si@opt@compatkey{SIunits}{textstyle}
+\si@opt@compatkey{SIunits}{binary}
+\si@opt@compatkey{SIunits}{noams}
+\si@opt@compatkey{SIunits}{derivedinbase}
+\si@opt@compatkey{SIunits}{derived}
+\newcommand*{\si@fix@thin}{\,}
+\newcommand*{\si@fix@med}{\:}
+\newcommand*{\si@fix@medium}{\:}
+\newcommand*{\si@fix@thick}{\;}
+\newcommand*{\si@fix@space}{\text{~}}
+\newcommand*{\si@fix@cdot}{\cdot}
+\newcommand*{\si@fix@comma}{{,}}
+\newcommand*{\si@fix@stop}{{.}}
+\newcommand*{\si@fix@fullstop}{{.}}
+\newcommand*{\si@fix@period}{{.}}
+\newcommand*{\si@fix@times}{\times}
+\newcommand*{\si@fix@plus}{+}
+\newcommand*{\si@fix@minus}{-}
+\newcommand*{\si@fix@pm}{\pm}
+\newcommand*{\si@fix@mp}{\mp}
+\newcommand*{\si@fix@two}{2}
+\newcommand*{\si@fix@ten}{10}
+\newcommand*{\si@fix@slash}{/}
+\newcommand*{\si@fix@none}{}
+\newcommand*{\si@symbol}[1]{%
+ \expandafter\DeclareRobustCommand\expandafter*\expandafter{%
+ \csname si@sym@#1\endcsname}{%
+ \ifmmode
+ \expandafter\csname si@maths#1\expandafter\endcsname%
+ \else
+ \expandafter\csname si@text#1\expandafter\endcsname%
+ \fi}}
+\si@symbol{Omega}
+\si@symbol{ringA}
+\si@symbol{mu}
+\si@symbol{degree}
+\si@symbol{minute}
+\si@symbol{second}
+\si@symbol{celsius}
+\AtBeginDocument{%
+ \ifsi@redefsymbols
+ \@ifpackageloaded{textcomp}
+ {\si@log@debug{Redefining symbols using textcomp}%
+ \renewcommand*{\si@textdegree}{\textdegree}%
+ \renewcommand*{\si@mathsdegree}{\text{\textdegree}}%
+ \@ifpackageloaded{mathptmx}{}
+ {\renewcommand*{\si@textmu}{\textmu}%
+ \renewcommand*{\si@textOmega}{\textohm}}%
+ \long\def\si@tempa{OT1}%
+ \ifx\si@tempa\encodingdefault
+ \renewcommand*{\si@mathsringA}{\text{\capitalring{A}}}%
+ \renewcommand*{\si@textringA}{\capitalring{A}}
+ \fi}{}
+ \@ifpackageloaded{upgreek}
+ {\si@log@debug{Redefining symbols using upgreek}%
+ \renewcommand*{\si@mathsmu}{\upmu}%
+ \renewcommand*{\si@mathsOmega}{\Upomega}}{}
+ \fi}
+\newcommand*{\si@frc@frac}[2]{%
+ \ensuremath{\frac{\expandafter\si@unt@out\expandafter{#1}}%
+ {\expandafter\si@unt@out\expandafter{#2}}}}
+\let\si@frac\si@frc@frac
+\newcommand*{\si@frc@slash}[2]{%
+ \expandafter\si@unt@out\expandafter{#1}%
+ \si@out@text{\ensuremath{\si@slash}}%
+ \expandafter\si@unt@out\expandafter{#2}}
+\newcommand*{\si@frc@nice}[2]{%
+ \ensuremath{\si@frc@nicefrac{\expandafter\si@unt@out%
+ \expandafter{#1}}{\expandafter\si@unt@out\expandafter{#2}}}}
+\newcommand*{\si@frc@sfrac}[2]{%
+ \sfrac{\expandafter\si@unt@out\expandafter{#1}}%
+ {\expandafter\si@unt@out\expandafter{#2}}}
+\AtBeginDocument{%
+ \@ifpackageloaded{xfrac}
+ {}
+ {\si@log@inf{xfrac package unavailable\MessageBreak
+ using `fraction=sfrac' will fall back on\MessageBreak
+ nicefrac-like method}%
+ \renewcommand*{\si@frc@sfrac}[2]{%
+ \si@log@warn{xfrac package unavailable}%
+ \si@frc@nice{#1}{#2}}}}
+\newlength\si@frc@displen
+\newlength\si@frc@textlen
+\newlength\si@frc@suplen
+\newlength\si@frc@ssuplen
+\newcommand*{\si@frc@nicefrac}{%
+ \ifmmode
+ \expandafter\si@frc@mathsnf%
+ \else
+ \expandafter\si@frc@textnf%
+ \fi}
+\newcommand*{\si@frc@mathsnf}[2]{%
+ \begingroup
+ \settoheight{\si@frc@displen}{\ensuremath{\displaystyle{M}}}%
+ \settoheight{\si@frc@textlen}{\ensuremath{\textstyle{M}}}%
+ \settoheight{\si@frc@suplen}{\ensuremath{\scriptstyle{M}}}%
+ \settoheight{\si@frc@ssuplen}{\ensuremath{\scriptscriptstyle{M}}}%
+ \addtolength{\si@frc@displen}{-\si@frc@ssuplen}%
+ \addtolength{\si@frc@textlen}{-\si@frc@ssuplen}%
+ \addtolength{\si@frc@suplen}{-\si@frc@ssuplen}%
+ \mathchoice
+ {\raisebox{\si@frc@displen}{\ensuremath{\scriptstyle{#1}}}}%
+ {\raisebox{\si@frc@textlen}{\ensuremath{\scriptstyle{#1}}}}%
+ {\raisebox{\si@frc@suplen}%
+ {\ensuremath{\scriptscriptstyle{#1}}}}%
+ {\raisebox{\si@frc@ssuplen}%
+ {\ensuremath{\scriptscriptstyle{#1}}}}%
+ \mkern-2mu/\mkern-1mu%
+ \bgroup
+ \mathchoice
+ {\scriptstyle}%
+ {\scriptstyle}%
+ {\scriptscriptstyle}%
+ {\scriptscriptstyle}%
+ {#2}%
+ \egroup
+ \endgroup}
+\newcommand*{\si@frc@textnf}[2]{%
+ \begingroup
+ \settoheight{\si@frc@textlen}{M}%
+ \settoheight{\si@frc@ssuplen}{\fontsize\sf@size\z@%
+ \selectfont{M}}%
+ \addtolength{\si@frc@textlen}{-\si@frc@ssuplen}%
+ \raisebox{\si@frc@textlen}{\fontsize\sf@size\z@%
+ \selectfont{#1}}%
+ \hspace{-0.25ex}/\hspace{-0.25ex}%
+ \hbox{\fontsize\sf@size\z@\selectfont{#2}}%
+ \endgroup}
+\newcommand*{\si@frc@ugly}[1]{%
+ \def\si@tempa{#1}%
+ \ifmmode
+ \expandafter\si@frc@frac%
+ \else
+ \def\si@tempb{1}%
+ \ifx\si@tempa\si@tempb
+ \setbox\si@tempbox=\hbox{\ensuremath{\si@valuesep}}%
+ \hskip-\wd\si@tempbox%
+ \def\si@tempa{}%
+ \fi
+ \expandafter\si@frc@slash%
+ \fi
+ {\si@tempa}}
+\newcommand*{\si@fam@getmfam}{%
+ \sbox{0}{$%
+ \@ifundefined{mathsf}
+ {\si@log@debug{No mathsf family found}%
+ \global\chardef\si@fam@sf=99}%
+ {\mathsf{\global\chardef\si@fam@sf=\fam}}%
+ \@ifundefined{mathtt}
+ {\si@log@debug{No mathtt family found}%
+ \global\chardef\si@fam@tt=99}%
+ {\mathtt{\global\chardef\si@fam@tt=\fam}}%
+ $}}
+\AtBeginDocument{\si@fam@getmfam}
+\newcommand*{\si@fam@ifbtext}[1]{%
+ \if b\expandafter\@car\f@series\@nil
+ #1\fi}
+\newcommand{\si@fam@ifbmaths}[1]{%
+ \def\si@tempa{bold}%
+ \ifx\math@version\si@tempa
+ #1\fi}
+\newcommand*{\si@fam@ifbinline}{%
+ \ifsi@inlinebtext
+ \expandafter\si@fam@ifbtext%
+ \else
+ \expandafter\si@fam@ifbmaths%
+ \fi}
+\newcommand*{\si@fam@ifitext}[1]{%
+ \if n\expandafter\@car\f@series\@nil\else
+ #1\fi}
+\newcommand*{\si@fam@mode}{%
+ \ifsi@obeymode
+ \ifmmode
+ \sisetup{mode=maths}%
+ \else
+ \sisetup{mode=text}%
+ \fi
+ \fi}
+\newif\ifsi@fam@set
+\newcommand*{\si@fam@set}{%
+ \si@fam@settrue
+ \edef\si@tempa{\sfdefault}%
+ \edef\si@tempb{\ttdefault}%
+ \ifsi@obeyfamily
+ \si@log@debug{Font detection: checking font}%
+ \ifmmode
+ \ifdim\displaywidth>0pt\relax
+ \si@log@debug{Font detection: display maths}%
+ \ifnum\the\fam=\si@fam@sf
+ \si@log@debug{Font detection: sf}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathssf\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@textsf\endcsname
+ \else
+ \ifnum\the\fam=\si@fam@tt
+ \si@log@debug{Font detection: tt}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathstt\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@texttt\endcsname
+ \else
+ \si@log@debug{Font detection: rm}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathsdefault\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@textdefault\endcsname
+ \fi
+ \fi
+ \else
+ \si@log@debug{Font detection: inline maths}%
+ \ifx\f@family\si@tempa
+ \si@log@debug{Font detection: sf}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathssf\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@textsf\endcsname
+ \else
+ \ifx\f@family\si@tempb
+ \si@log@debug{Font detection: tt}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathstt\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@texttt\endcsname
+ \else
+ \si@log@debug{Font detection: rm}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathsdefault\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@textdefault\endcsname
+ \fi
+ \fi
+ \fi
+ \else
+ \si@log@debug{Font detection: text}%
+ \ifx\f@family\si@tempa
+ \si@log@debug{Font detection: sf}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathssf\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@textsf\endcsname
+ \else
+ \ifx\f@family\si@tempb
+ \si@log@debug{Font detection: tt}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathstt\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@texttt\endcsname
+ \else
+ \si@log@debug{Font detection: rm}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathsdefault\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@textdefault\endcsname
+ \fi
+ \fi
+ \fi
+ \else
+ \si@log@debug{Font detection: inactive}%
+ \expandafter\let\expandafter\si@fam@maths
+ \csname\si@mathsdefault\endcsname
+ \expandafter\let\expandafter\si@fam@text
+ \csname\si@textdefault\endcsname
+ \fi
+ \def\si@fam@bold{\unboldmath\mdseries}%
+ \def\si@fam@setbold{\boldmath\bfseries}%
+ \ifsi@obeybold
+ \si@log@debug{Weight detection: checking weight}%
+ \ifmmode
+ \ifdim\displaywidth>0pt\relax
+ \si@fam@ifbmaths
+ {\let\si@fam@bold\si@fam@setbold
+ \si@log@debug{Weight detection: bold weight}}%
+ \else
+ \si@fam@ifbinline
+ {\let\si@fam@bold\si@fam@setbold
+ \si@log@debug{Weight detection: bold weight}}%
+ \fi
+ \else
+ \si@fam@ifbtext%
+ {\let\si@fam@bold\si@fam@setbold
+ \si@log@debug{Weight detection: bold weight}}%
+ \fi
+ \fi
+ \let\si@fam@italic\upshape
+ \ifsi@obeyitalic
+ \si@log@debug{Italic detection: checking italic}%
+ \si@fam@ifitext
+ {\let\si@fam@italic\relax
+ \si@log@debug{Italic detection: italic}}%
+ \ifsi@textmode\else
+ \si@log@inf{maths mode - obeyitalic inactive}%
+ \fi
+ \fi}
+\DeclareRobustCommand*{\num}[2][]{%
+ \begingroup%
+ \sisetup{#1}%
+ \si@fam@mode%
+ \si@log@debug{Processing \string\num\space input `#2'}%
+ \expandafter\si@out@num\expandafter{\si@num{#2}}%
+ \endgroup}
+\newcommand*{\si@num}[1]{%
+ \begingroup
+ \makeatletter%
+ \@makeother{\,}%
+ \@makeother{\.}%
+ \@makeother{\+}%
+ \@makeother{\-}%
+ \def~{}%
+ \def\,{}%
+ \catcode`\~=\active\relax
+ \catcode`\^=\active\relax
+ \scantokens{\si@num@xdef\si@tempa{#1}\@empty}%
+ \endgroup
+ \si@ifnotmtarg{\si@tempa}{%
+ \expandafter\si@num@valid\si@tempa\@empty\@empty%
+ \ifsi@switch
+ \expandafter\si@num@format\expandafter\si@tempa%
+ \else
+ {#1}%
+ \fi}}
+\def\si@num@xdef#1#2\@empty{\xdef#1{#2}}
+\def\si@num@valid#1#2\@empty{%
+ \si@num@ifchr{#1}{\si@numvalid}{%
+ \ifx\@empty#2\@empty\else
+ \si@num@valid#2\@empty\@empty\@empty%
+ \fi
+ \si@switchtrue}%
+ {\si@log@err{Invalid character `#1' in numerical input}%
+ {Only characters from the list `\si@numvalid'\MessageBreak
+ should be present in the argument of the \string\num
+ macro\MessageBreak (or derivative such as an `s' column)}%
+ \si@switchfalse}}
+\newcommand*{\si@num@ifchr}[2]{%
+ \begingroup
+ \si@switchfalse
+ \def\si@tempa{#1}%
+ \edef\si@tempb{#2}%
+ \expandafter\si@num@chrstr\si@tempb\@empty\@empty%
+ \ifsi@switch%
+ \endgroup\expandafter\@firstoftwo%
+ \else
+ \endgroup\expandafter\@secondoftwo%
+ \fi}
+\def\si@num@chrstr#1#2\@empty{%
+ \def\si@tempc{#1}%
+ \edef\si@tempb{#2}%
+ \ifx\si@tempa\si@tempc
+ \si@switchtrue
+ \else
+ \ifx\@empty\si@tempb\@empty\else
+ \si@num@chrstr#2\@empty%
+ \fi
+ \fi}
+\newcommand*{\si@num@exp}{}
+\newcommand*{\si@num@mant}{}
+\newcommand*{\si@num@expout}{}
+\newcommand*{\si@num@mantout}{}
+\newcommand*{\si@num@out}{}
+\newcommand*{\si@num@format}[1]{%
+ \protected@edef\si@num@arg{#1}%
+ \def\si@num@exp{}%
+ \def\si@num@mant{}%
+ \def\si@num@expout{}%
+ \def\si@num@mantout{}%
+ \si@log@debug{Formatting number `\si@num@arg'}%
+ \si@switchfalse
+ \expandafter\si@num@mantexp\si@num@arg\@empty\@empty%
+ \si@num@sign{mant}%
+ \protected@edef\si@num@out{\si@num@mantout}%
+ \ifx\@empty\si@num@mant\@empty\else
+ \si@num@digits{mant}%
+ \protected@edef\si@num@out{\si@num@mantout}%
+ \fi
+ \si@num@sign{exp}%
+ \ifx\@empty\si@num@exp\@empty\else
+ \si@num@digits{exp}%
+ \ifx\@empty\si@num@mant\@empty\else
+ \protected@edef\si@num@out%
+ {\si@num@out\noexpand\ensuremath{{}\noexpand\si@expproduct{}}}%
+ \fi
+ \protected@edef\si@num@out%
+ {\si@num@out\si@exppower%
+ \noexpand\textsuperscript{\si@num@expout}}%
+ \fi
+ \ifx\@empty\si@num@mant\@empty
+ \ifx\@empty\si@num@exp\@empty
+ \si@log@err{Invalid number format `\si@num@arg'}%
+ {Something is wrong with the number format; does it
+ contain \MessageBreak any numbers (from the list %
+ `\si@numlist')?}%
+ \renewcommand*\si@num@out{}%
+ \fi
+ \fi%
+ \si@num@out}
+\def\si@num@mantexp#1#2\@empty{%
+ \si@num@ifchr{#1}{\si@numgobble}{}{%
+ \si@num@ifchr{#1}{\si@numexp}%
+ {\ifsi@switch
+ \si@log@err{Duplicate exponent marker found}%
+ {Only a single exponent character (from the list
+ `\si@numexp')\MessageBreak may occur in a
+ numerical argument}%
+ \fi
+ \si@switchtrue
+ \si@log@debug{Exponent marker `#1' found in `\si@num@arg'}}%
+ {\ifsi@switch
+ \si@log@debug{Adding `#1' to exponent for `\si@num@arg'}%
+ \protected@edef\si@num@exp{\si@num@exp#1}%
+ \else
+ \si@log@debug{Adding `#1' to mantissa for `\si@num@arg'}%
+ \protected@edef\si@num@mant{\si@num@mant#1}%
+ \fi}}%
+ \ifx\@empty#2\@empty\else
+ \si@num@mantexp#2\@empty\@empty\@empty%
+ \fi}
+\newcommand*{\si@num@sign}[1]{%
+ \expandafter\ifx\expandafter\@empty\csname si@num@#1\endcsname%
+ \@empty\else
+ \expandafter\expandafter\expandafter\si@num@gensign%
+ \csname si@num@#1\endcsname\@empty\@empty\@empty%
+ \edef\si@tempc{#1}%
+ \ifx\@empty\si@tempa\@empty
+ \def\si@tempa{mant}%
+ \ifx\si@tempa\si@tempc
+ \ifsi@num@signmant
+ \si@log@debug{Adding sign \si@sign\space to mantissa for
+ `\si@num@arg'}%
+ \protected@edef\si@tempa{\si@sign}%
+ \else
+ \def\si@tempa{}%
+ \fi
+ \else
+ \ifsi@num@signexp
+ \si@log@debug{Adding sign \si@sign\space to exponent for
+ `\si@num@arg'}%
+ \protected@edef\si@tempa{\si@sign}%
+ \else
+ \def\si@tempa{}%
+ \fi
+ \fi
+ \fi
+ \ifx\@empty\si@tempa\@empty
+ \def\si@tempa{mant}%
+ \ifx\si@tempa\si@tempc
+ \si@log@debug{Unsigned mantissa for `\si@num@arg'}%
+ \else
+ \si@log@debug{Unsigned exponent for `\si@num@arg'}%
+ \fi
+ \else
+ \expandafter\protected@edef\csname si@num@#1out\endcsname%
+ {\noexpand\ensuremath{\si@tempa}}%
+ \ifx\@empty\si@tempb\@empty
+ \expandafter\def\csname si@num@#1\endcsname{}%
+ \def\si@tempa{mant}%
+ \ifx\si@tempa\si@tempc
+ \ifx\@empty\si@num@exp\@empty
+ \si@log@warn{Sign but no number for `\si@num@arg'}%
+ \fi
+ \else
+ \si@log@warn{Sign but no number for `\si@num@arg'}%
+ \fi
+ \else
+ \expandafter\protected@edef\csname si@num@#1\endcsname%
+ {\si@tempb}%
+ \fi
+ \fi
+ \fi}
+\def\si@num@gensign#1#2#3\@empty{%
+ \si@num@ifchr{#1}{\si@numsign}{%
+ \si@num@ifchr{#2}{\si@numsign}{%
+ \if +#1
+ \if -#2
+ \si@log@debug{Found sign combination +- for `\si@num@arg'}%
+ \def\si@tempa{\pm}%
+ \else
+ \si@log@warn{Unknown sign combination `#1#2'}%
+ \def\si@tempa{#1#2}%
+ \fi
+ \else
+ \if -#1
+ \if +#2
+ \si@log@debug{Found sign combination -+ for `\si@num@arg'}%
+ \def\si@tempa{\mp}%
+ \else
+ \si@log@warn{Unknown sign combination `#1#2'}%
+ \def\si@tempa{#1#2}%
+ \fi
+ \else
+ \si@log@warn{Unknown sign combination `#1#2'}%
+ \def\si@tempa{#1#2}%
+ \fi
+ \fi
+ \edef\si@tempb{#3}}%
+ {\si@log@debug{Found single sign character `#1' for
+ `\si@num@arg'}%
+ \def\si@tempa{#1}%
+ \edef\si@tempb{#2#3}}}%
+ {\si@log@debug{No sign found for `\si@num@arg'}%
+ \def\si@tempa{}%
+ \edef\si@tempb{#1#2#3}}}%
+\newcommand*{\si@num@digits}[1]{%
+ \def\si@tempa{}%
+ \def\si@tempb{}%
+ \si@switchfalse
+ \expandafter\expandafter\expandafter\si@num@split%
+ \csname si@num@#1\endcsname\@empty\@empty%
+ \ifx\@empty\si@tempa\@empty
+ \ifsi@num@padlead
+ \si@log@debug{Adding leading zero for `\si@num@arg'}%
+ \def\si@tempa{0}%
+ \fi
+ \fi
+ \ifx\@empty\si@tempb\@empty
+ \ifsi@num@padtrail
+ \ifsi@switch
+ \si@log@debug{Adding trailing zero for `\si@num@arg'}%
+ \def\si@tempb{0}%
+ \fi
+ \fi
+ \fi
+ \ifx\@empty\si@tempa\@empty
+ \ifx\@empty\si@tempb\@empty\else
+ \si@num@sepdigits{#1}%
+ \fi
+ \else
+ \si@num@sepdigits{#1}%
+ \fi}
+\def\si@num@split#1#2\@empty{%
+ \si@num@ifchr{#1}{\si@numdecimal}{%
+ \ifsi@switch
+ \si@log@err{Duplicate decimal marker in `\si@num@arg'}
+ {Only a single decimal marker (from the list
+ `\si@numdecimal')\MessageBreak may occur in a
+ numerical argument}%
+ \else
+ \si@log@debug{Found decimal marker `#1' in `\si@num@arg'}%
+ \si@switchtrue
+ \fi}{%
+ \si@num@ifchr{#1}{\si@numsign}{%
+ \si@log@err{Misplaced sign in `\si@num@arg'}
+ {Sign characters `\si@numsign' can only occur\MessageBreak
+ at the start of a number}}{%
+ \ifsi@switch
+ \si@log@debug{Adding `#1' to decimal part for `\si@num@arg'}%
+ \protected@edef\si@tempb{\si@tempb#1}%
+ \else
+ \si@log@debug{Adding `#1' to integer part for `\si@num@arg'}%
+ \protected@edef\si@tempa{\si@tempa#1}%
+ \fi}}%
+ \ifx\@empty#2\@empty\else
+ \si@num@split#2\@empty\@empty%
+ \fi}
+\newcommand*{\si@num@decimalhook}{}
+\newcommand*{\si@num@sepdigits}[1]{%
+ \si@num@ifextra{\si@tempa}{}
+ {\expandafter\si@num@int\expandafter{\si@tempa}}%
+ \def\si@tempc{}%
+ \ifx\@empty\si@tempb\@empty\else
+ \protected@edef\si@tempc{\noexpand\ensuremath{{\noexpand%
+ \si@decimalsign}}}%
+ \si@num@decimalhook%
+ \si@num@ifextra{\si@tempb}{}%
+ {\expandafter\si@num@dec\expandafter{\si@tempb}}%
+ \fi
+ \expandafter\protected@edef\csname si@num@#1out\endcsname%
+ {\csname si@num@#1out\endcsname\si@tempa\si@tempc\si@tempb}}
+\newcommand*{\si@num@ifextra}[1]{%
+ \begingroup
+ \si@switchfalse
+ \expandafter\si@num@extra#1\@empty\@empty%
+ \ifsi@switch
+ \si@log@debug{Found `extra' characters in `#1'}%
+ \endgroup\expandafter\@firstoftwo%
+ \else
+ \endgroup\expandafter\@secondoftwo%
+ \fi}
+\def\si@num@extra#1#2\@empty{%
+ \ifx\@empty#1\@empty\else
+ \si@num@ifchr{#1}{\si@numextra}{\si@switchtrue}{}%
+ \ifx\@empty#2\@empty\else
+ \si@num@extra#2\@empty\@empty%
+ \fi
+ \fi}
+\newcommand*{\si@num@int}[1]{%
+ \def\si@tempa{}%
+ \ifsi@sepfour
+ \si@num@intfmt{}#1\@empty\@empty\@empty%
+ \else
+ \si@num@iffive{#1}
+ {\si@num@intfmt{}#1\@empty\@empty\@empty}
+ {\def\si@tempa{#1}}%
+ \fi}
+\newcommand*{\si@num@iffive}[1]{%
+ \si@num@five#1\@empty\@empty\@empty\@empty\@empty\end}
+\def\si@num@five#1#2#3#4#5\end{%
+ \ifx\@empty#5\@empty
+ \expandafter\@secondoftwo%
+ \else
+ \expandafter\@firstoftwo%
+ \fi}
+\newcommand*{\si@num@intfmt}[4]{%
+ \ifx\@empty#2\@empty
+ \si@num@intsep#1\relax
+ \else
+ \ifx\@empty#3\@empty
+ \si@num@intsep\@empty\@empty#1#2\relax
+ \else
+ \ifx\@empty#4\@empty
+ \si@num@intsep\@empty#1#2#3\relax
+ \else
+ \si@num@fiint{#1#2#3#4}%
+ \fi
+ \fi
+ \fi}
+\def\si@num@fiint#1\fi\fi\fi{\fi\fi\fi\si@num@intfmt{#1}}
+\newcommand*{\si@num@intsep}[4]{%
+ \protected@edef\si@tempa{\si@tempa#1#2#3}%
+ \if\relax#4\relax
+ \else
+ \protected@edef\si@tempa{\si@tempa\noexpand\ensuremath{\noexpand%
+ \si@digitsep}}%
+ \expandafter\si@num@intsep\expandafter#4%
+ \fi}
+\newcommand*{\si@num@dec}[1]{%
+ \def\si@tempb{}%
+ \ifsi@sepfour
+ \si@num@decfmt#1\@empty\@empty\@empty\@empty%
+ \else
+ \si@num@iffive{#1}
+ {\si@num@decfmt#1\@empty\@empty\@empty\@empty}
+ {\protected@edef\si@tempb{\si@tempb#1}}%
+ \fi
+}
+\newcommand*{\si@num@decfmt}[4]{%
+ \protected@edef\si@tempb{\si@tempb#1#2#3}%
+ \ifx\@empty#4\@empty%
+ \else
+ \protected@edef\si@tempb{\si@tempb\noexpand\ensuremath{\noexpand%
+ \si@digitsep}}%
+ \expandafter\si@num@decfmt\expandafter#4%
+ \fi}
+\DeclareRobustCommand*{\ang}[2][]{%
+ \begingroup
+ \sisetup{#1}%
+ \si@fam@mode%
+ \si@log@debug{Processing \string\ang\space input `#2'}%
+ \@makeother{\;}%
+ \makeatletter%
+ \scantokens{\si@ang@parse#2;;;\@nil}}
+\def\si@ang@parse#1;#2;#3;#4\@nil{\si@ang@set{#1}{#2}{#3}}
+\newcommand*{\si@ang@killdegree}{\let\si@sym@degree\relax}
+\newcommand*{\si@ang@killminute}{\let\si@sym@minute\relax}
+\newcommand*{\si@ang@killsecond}{\let\si@sym@second\relax}
+\newcommand*{\si@ang@astrosign}[1]{%
+ \renewcommand*{\si@decimalsign}{%
+ \rlap{\si@ang@decimalsign}%
+ \expandafter\csname si@sym@#1\endcsname}%
+ \def\si@num@decimalhook{\expandafter\aftergroup%
+ \csname si@ang@kill#1\endcsname}}%
+\newcommand*{\si@ang@set}[3]{%
+ \ifsi@ang@padlarge
+ \newcommand*{\si@ang@degs}{0\si@sym@degree}%
+ \newcommand*{\si@ang@mins}{0\si@sym@minute}%
+ \newcommand*{\si@ang@secs}{0\si@sym@second}%
+ \else
+ \newcommand*{\si@ang@degs}{}%
+ \newcommand*{\si@ang@mins}{}%
+ \newcommand*{\si@ang@secs}{}%
+ \fi
+ \protected@edef\si@ang@decimalsign{\si@decimalsign}%
+ \ifsi@astroang
+ \let\si@ang@movesign\si@ang@astrosign
+ \else
+ \let\si@ang@movesign\@gobble
+ \fi
+ \newcommand*{\si@ang@secnum}{\si@ang@num{second}}%
+ \newcommand*{\si@ang@minnum}{\si@ang@num{minute}}%
+ \si@ifnotmtarg{#3}
+ {\si@log@debug{Found seconds `#3'}%
+ \renewcommand*{\si@ang@secs}
+ {\si@ang@secnum{#3}\si@sym@second}%
+ \renewcommand*{\si@ang@mins}
+ {\si@ang@pad{0\si@sym@minute}}%
+ \renewcommand*{\si@ang@degs}
+ {\si@ang@pad{0\si@sym@degree}}}%
+ \si@ifnotmtarg{#2}
+ {\si@log@debug{Found minutes `#2'}%
+ \renewcommand*{\si@ang@secnum}{\si@ang@signlessnum{second}}%
+ \renewcommand*{\si@ang@mins}
+ {\si@ang@minnum{#2}\si@sym@minute}%
+ \renewcommand*{\si@ang@degs}
+ {\si@ang@pad{0\si@sym@degree}}}%
+ \si@ifnotmtarg{#1}
+ {\si@log@debug{Found degrees `#1'}%
+ \renewcommand*{\si@ang@secnum}{\si@ang@signlessnum{second}}%
+ \renewcommand*{\si@ang@minnum}{\si@ang@signlessnum{minute}}%
+ \renewcommand*{\si@ang@degs}
+ {\si@ang@num{degree}{#1}%
+ \si@sym@degree}}%
+ \si@out@num%
+ {\si@ang@degs\si@anglesep\si@ang@mins\si@anglesep\si@ang@secs}%
+ \endgroup}
+\newcommand*{\si@ang@pad}[1]{%
+ \ifsi@ang@padsmall
+ #1%
+ \else
+ \relax%
+ \fi}
+\newcommand{\si@ang@num}[2]{%
+ \begingroup%
+ \si@ang@movesign{#1}%
+ \si@num{#2}%
+ \endgroup}
+\newcommand{\si@ang@signlessnum}[2]{%
+ \begingroup%
+ \si@ang@movesign{#1}%
+ \sisetup{addsign=none}%
+ \si@num{#2}%
+ \endgroup}
+\newcolumntype{s}{}
+\renewcommand*{\NC@rewrite@s}{%
+ \@ifnextchar[%]
+ {\si@tab@rewrite}
+ {\si@tab@rewrite[]}
+}
+\def\si@tab@rewrite[#1]{%
+ \edef\si@tempa{\the\@temptokena
+ >{\noexpand\si@tab@begin[#1]\noexpand\ignorespaces}c%
+ <{\noexpand\si@tab@end}}%
+ \@temptokena\expandafter{\si@tempa}%
+ \NC@find}
+\newtoks\si@tab@numtoks
+\newtoks\si@tab@pretoks
+\newtoks\si@tab@posttoks
+\newcommand*{\si@tab@begin}[1][]{%
+ \begingroup
+ \sisetup{#1}%
+ \si@tab@numtoks{}%
+ \si@tab@pretoks{}%
+ \si@tab@posttoks{}%
+ \si@switchfalse
+ \si@log@debug{Processing s column cell contents}%
+ \si@tab@gettok}
+\newcommand*{\si@tab@gettok}[1]{%
+ \ifx\tabularnewline#1
+ \let\si@tab@next\tabularnewline
+ \else
+ \ifx\end#1
+ \let\si@tab@next\end
+ \else
+ \ifx\si@tab@end#1
+ \let\si@tab@next\si@tab@end
+ \else
+ \ifx\endtabular#1
+ \let\si@tab@next\endtabular
+ \else
+ \ifx\csname#1
+ \let\si@tab@next\csname
+ \else
+ \ifx\relax#1\relax
+ \let\si@tab@next\relax
+ \else
+ \let\si@tab@next\si@tab@gettok
+ \si@num@ifchr{#1}{\si@numvalid}
+ {\si@switchtrue
+ \si@log@debug{Found valid cell contents `#1'}%
+ \si@tab@numtoks=\expandafter{\the\si@tab@numtoks#1}}
+ {\si@log@debug{Found other cell contents \string#1}%
+ \si@tab@othertok{#1}}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \si@tab@next}
+\newcommand*{\si@tab@othertok}[1]{%
+ \ifsi@switch
+ \si@tab@posttoks=\expandafter{\the\si@tab@posttoks#1}%
+ \else
+ \si@tab@pretoks=\expandafter{\the\si@tab@pretoks#1}%
+ \fi}
+\newcommand{\si@tab@end}{%
+ \hfil%
+ \the\si@tab@pretoks%
+ \ifsi@switch
+ \expandafter\si@tab@numout%
+ \fi
+ \the\si@tab@posttoks%
+ \hfil%
+ \endgroup}
+\newcount\si@tempcnta
+\newcount\si@tempcntb
+\newcommand*{\si@tab@numout}{%
+ \let\si@num@format\si@tab@num@format
+ \expandafter\si@num\expandafter{\the\si@tab@numtoks}%
+ \afterassignment\si@tab@format\expandafter\si@tempcnta%
+ \si@tabformat\relax}
+\newcommand*{\si@tab@mantout}{}
+\newcommand*{\si@tab@num@format}[1]{%
+ \let\si@tab@org@sepdigits\si@num@sepdigits
+ \let\si@num@sepdigits\si@tab@num@sepdigits
+ \edef\si@num@arg{#1}%
+ \si@switchfalse
+ \expandafter\si@num@mantexp\si@num@arg\@empty\@empty%
+ \si@num@sign{mant}%
+ \ifx\@empty\si@num@mant\@empty\else
+ \si@num@digits{mant}%
+ \protected@edef\si@num@out{\si@tab@mantout}%
+ \fi
+ \let\si@num@sepdigits\si@tab@org@sepdigits
+ \si@num@sign{exp}%
+ \ifx\@empty\si@num@exp\@empty\else
+ \si@num@digits{exp}%
+ \ifx\@empty\si@num@mant\@empty\else
+ \protected@edef\si@num@out%
+ {\si@num@out\noexpand\ensuremath{\noexpand\si@expproduct}}%
+ \fi
+ \protected@edef\si@num@out%
+ {\si@num@out\si@exppower%
+ \noexpand\textsuperscript{\si@num@expout}}%
+ \fi
+ \ifx\@empty\si@num@mant\@empty
+ \ifx\@empty\si@num@exp\@empty
+ \si@log@err{Invalid number format `\si@num@arg'}%
+ {Something is wrong with the number format; does it
+ contain \MessageBreak any numbers (from the list %
+ `\si@numlist')?}%
+ \renewcommand*\si@num@out{}%
+ \renewcommand*\si@tab@mantout{}%
+ \fi
+ \fi}
+\newcommand*{\si@tab@num@sepdigits}[1]{%
+ \si@num@ifextra{\si@tempa}{}
+ {\expandafter\si@num@int\expandafter{\si@tempa}}%
+ \def\si@tempc{}%
+ \ifx\@empty\si@tempb\@empty\else
+ \si@num@ifextra{\si@tempb}{}%
+ {\expandafter\si@num@dec\expandafter{\si@tempb}}%
+ \fi
+ \expandafter\protected@edef\csname si@num@#1out\endcsname%
+ {\csname si@num@#1out\endcsname\si@tempa}%
+ \expandafter\protected@edef\csname si@tab@#1out\endcsname%
+ {\si@tempb}}%
+\newbox\si@tab@prebox
+\newbox\si@tab@postbox
+\newbox\si@tempbox
+\def\si@tab@format#1\relax{%
+ \ifnum\z@<\si@tempcnta
+ \expandafter\si@tab@right%
+ \else
+ \expandafter\si@tab@centre%
+ \fi
+ {#1}%
+ \box\si@tab@prebox\box\si@tab@postbox}
+\newcommand*\si@tab@centre[1]{%
+ \setbox\si@tab@prebox=\hbox%
+ {\expandafter\si@out@num\expandafter{\si@num@mantout}}%
+ \ifx\@empty\si@tab@mantout\@empty
+ \ifx\@empty\si@num@out\@empty
+ \setbox\si@tab@postbox=\hbox%
+ {\phantom{\ensuremath{{\si@decimalsign}}}}%
+ \else
+ \setbox\si@tab@postbox=\hbox%
+ {\expandafter\si@out@num\expandafter{\si@num@out}}%
+ \fi
+ \else
+ \setbox\si@tab@postbox=\hbox%
+ {\ensuremath{{\si@decimalsign}}%
+ \expandafter\si@out@num\expandafter{\si@num@out}}%
+ \fi
+ \ifdim \wd\si@tab@prebox>\wd\si@tab@postbox
+ \setbox\si@tab@postbox=\hbox to\wd\si@tab@prebox%
+ {\unhbox\si@tab@postbox\hfill}%
+ \else
+ \setbox\si@tab@prebox=\hbox to\wd\si@tab@postbox%
+ {\hfill\unhbox\si@tab@prebox}%
+ \fi}
+\newdimen\si@tab@predim
+\newdimen\si@tab@postdim
+\newdimen\si@tempdima
+\newdimen\si@tempdimb
+\newcommand*\si@tab@right[1]{%
+ \setbox\si@tempbox=\hbox{\si@out@num{1}}
+ \si@tempdima\wd\si@tempbox
+ \ifx\relax#1\relax
+ \hfill
+ \let\si@tab@prea\relax
+ \let\si@tab@preb\relax
+ \else
+ \si@tab@predim\the\si@tempcnta\si@tempdima
+ \si@tab@sepcorr{pre}%
+ \edef\si@tab@prea{to\si@tab@predim}%
+ \edef\si@tab@preb{\hss\hfill}%
+ \si@tempcnta\@gobble#1\relax
+ \fi
+ \si@tab@postdim\si@tempcnta\si@tempdima
+ \setbox\si@tempbox=\hbox{\ensuremath{{\si@decimalsign}}}%
+ \advance\si@tab@postdim\wd\si@tempbox
+ \si@tab@sepcorr{post}%
+ \setbox\si@tab@prebox=\hbox\si@tab@prea{\si@tab@preb%
+ \expandafter\si@out@num\expandafter{\si@num@mantout}}%
+ \ifx\@empty\si@tab@mantout\@empty
+ \setbox\si@tab@postbox=\hbox to\si@tab@postdim%
+ {\expandafter\si@out@num\expandafter{\si@num@out}\hfil}%
+ \else
+ \setbox\si@tab@postbox=\hbox to\si@tab@postdim%
+ {\ensuremath{{\si@decimalsign}}\expandafter\si@out@num%
+ \expandafter{\si@num@out}\hfil}%
+ \fi}
+\newcommand*{\si@tab@sepcorr}[1]{%
+ \si@tempcntb\the\si@tempcnta\relax
+ \divide\si@tempcntb\thr@@
+ \ifsi@sepfour\else
+ \ifnum\the\si@tempcnta=4
+ \si@tempcntb\z@
+ \fi
+ \fi
+ \setbox\si@tempbox=\hbox{\ensuremath{\si@digitsep}}%
+ \expandafter\advance\csname si@tab@#1dim\endcsname%
+ \si@tempcntb\wd\si@tempbox}%
+\DeclareRobustCommand*{\SI}[2][]{%
+ \@ifnextchar[%]
+ {\si@SI[#1]{#2}}
+ {\si@SI[#1]{#2}[]}}
+\DeclareRobustCommand*{\unitsym}[2][]{\si@SI[#1]{}[]{#2}}
+\newcommand*{\newunit}[3][]{%
+ \si@ifdefinable{#2}
+ {\si@unt@defunit[#1]{#2}{#3}}
+ {\si@log@err{Unit \string#2 already defined!}\@eha}}
+\newcommand*{\renewunit}[3][]{%
+ \si@ifdefinable{#2}
+ {\si@log@err{Unit \string#2 undefined}\@ehc
+ \si@unt@defunit[#1]{#2}{#3}}
+ {\si@unt@defunit[#1]{#2}{#3}}}
+\newcommand*{\provideunit}[3][]{%
+ \si@ifdefinable{#2}
+ {\si@unt@defunit[#1]{#2}{#3}}
+ {}}
+\newcommand*{\newprefix}[3]{%
+ \si@ifdefinable{#1}
+ {\si@unt@defprefix{#1}{#2}{#3}}
+ {\si@log@err{Prefix \string#1 already defined!}\@eha}}
+\newcommand*{\renewprefix}[3]{%
+ \si@ifdefinable{#1}
+ {\si@log@err{Prefix \string#1 undefined}\@ehc
+ \si@unt@defprefix{#1}{#2}{#3}}
+ {\si@unt@defprefix{#1}{#2}{#3}}}
+\newcommand*{\provideprefix}[3]{%
+ \si@ifdefinable{#1}
+ {\si@unt@defprefix{#1}{#2}{#3}}
+ {}}
+\newcommand*{\newpower}[3][]{%
+ \si@ifdefinable{#2}
+ {\si@unt@defpower[#1]{#2}{#3}}
+ {\si@log@err{Power \string#2 already defined!}\@eha}}
+\newcommand*{\renewpower}[3][]{%
+ \si@ifdefinable{#2}
+ {\si@log@err{Power \string#2 undefined}\@ehc
+ \si@unt@defpower[#1]{#2}{#3}}
+ {\si@unt@defpower[#1]{#2}{#3}}}
+\newcommand*{\providepower}[3][]{%
+ \si@ifdefinable{#2}
+ {\si@unt@defpower[#1]{#2}{#3}}
+ {}}
+\newif\ifsi@unt@num\si@unt@numtrue
+\def\si@SI[#1]#2[#3]#4{%
+ \begingroup
+ \si@ifnotmtarg{#1}
+ {\sisetup{#1}%
+ \edef\si@unt@SIopts{#1}}%
+ \si@unt@numfalse
+ \si@xspacefalse
+ \si@ifnotmtarg{#3}
+ {\si@log@debug{Prefix unit found}%
+ \si@unt@printunit{#3}}%
+ \si@ifnotmtarg{#2}
+ {\si@log@debug{Number found in \string\SI\space argument}%
+ \num{#2}%
+ \si@unt@numtrue}%
+ \si@ifnotmtarg{#4}
+ {\si@unt@printunit{#4}}%
+ \endgroup}
+\newif\ifsi@unt@littest
+\newcommand*{\si@unt@ifliteral}[1]{%
+ \begingroup
+ \si@unt@littesttrue
+ \setbox\si@tempbox=\hbox{\si@unt@out{#1}}%
+ \ifdim\wd\si@tempbox>\z@\relax
+ \endgroup\expandafter\@firstoftwo%
+ \else
+ \endgroup\expandafter\@secondoftwo%
+ \fi}
+\newif\ifsi@unt@litout
+\newcommand{\si@unt@printunit}[1]{%
+ \si@unt@ifliteral{#1}
+ {\si@log@debug{Literal items found in unit argument:\MessageBreak
+ outputting without further processing}%
+ \si@unt@litouttrue
+ \si@unt@addvaluesep%
+ \si@unt@out{#1}}
+ {\si@log@debug{Macro unit found:\MessageBreak
+ processing to format output}%
+ \si@unt@init%
+ \advance\si@unt@depthcnt\@ne\relax
+ #1%
+ \si@unt@final}}
+\newcommand*{\si@unt@addvaluesep}{%
+ \ifsi@unt@num
+ \expandafter\si@unt@addvalsep%
+ \fi}
+\newcommand*{\si@unt@addvalsep}{%
+ \ifsi@unt@litout
+ \expandafter\si@unt@litvalsep%
+ \else
+ \expandafter\si@unt@stackvalsep%
+ \fi}
+\newcommand*{\si@unt@stackvalsep}{%
+ \protected@edef\si@unt@spstack{\si@valuesep}}
+\newcommand*{\si@unt@litvalsep}{%
+ \nobreak\ensuremath{\si@valuesep}\nobreak}
+\newcommand*{\si@unt@spstack}{}
+\newcommand*{\si@unt@stacka}{}
+\newcommand*{\si@unt@stackb}{}
+\newcount\si@unt@unitcnta
+\newcount\si@unt@unitcntb
+\newcount\si@unt@depthcnt
+\newif\ifsi@unt@first
+\si@unt@depthcnt\m@ne\relax
+\newcommand*{\si@unt@init}{%
+ \begingroup
+ \si@unt@litoutfalse
+ \si@unt@firsttrue
+ \si@unt@perfalse
+ \si@unt@perseenfalse
+ \si@unt@prepowerfalse
+ \si@unt@depthcnt\z@\relax
+ \si@unt@powerdim\z@\relax
+ \si@unt@unitcnta\z@\relax
+ \si@unt@unitcntb\z@\relax
+ \si@unt@prefixcnt\z@\relax
+ \renewcommand*{\si@unt@spstack}{}%
+ \renewcommand*{\si@unt@stacka}{}%
+ \renewcommand*{\si@unt@stackb}{}%
+ \renewcommand*{\si@unt@holdstacka}{}%
+ \renewcommand*{\si@unt@holdstackb}{}%
+ \renewcommand*{\si@unt@lastadda}{space}%
+ \renewcommand*{\si@unt@lastaddb}{space}}
+\newcommand*{\si@unt@final}{%
+ \si@unt@third%
+ \si@unt@stackout%
+ \endgroup
+ \ifsi@xspace
+ \expandafter\expandafter\expandafter\xspace%
+ \fi}
+\newcommand*{\si@unt@defunit}[3][]{%
+ \si@log@debug{Declaring unit \string#2 with \MessageBreak
+ meaning \string#3}%
+ \si@ifnotmtarg{#1}
+ {\expandafter\expandafter\expandafter\def\expandafter%
+ \csname\expandafter\@gobble\string#2@opt@unt@si\endcsname{#1}}%
+ \DeclareRobustCommand*{#2}[1][]{%
+ \ifsi@unt@littest
+ \expandafter\si@gobblethree
+ \else
+ \ifsi@unt@litout
+ \expandafter\expandafter\expandafter\@gobbletwo
+ \else
+ \expandafter\expandafter\expandafter\si@unt@unit%
+ \fi
+ \fi
+ {##1}{#2}{#3}}}
+\long\def \si@gobblethree #1#2#3{}
+\newcommand*{\si@unt@defprefix}[3]{%
+ \si@log@debug{Declaring multiple \string#1 with \MessageBreak
+ meaning \string#3}%
+ \DeclareRobustCommand{#1}{%
+ \ifsi@unt@littest
+ \expandafter\si@gobblethree
+ \else
+ \ifsi@unt@litout
+ \expandafter\expandafter\expandafter\@gobbletwo
+ \else
+ \expandafter\expandafter\expandafter\si@unt@prefix%
+ \fi
+ \fi
+ {#1}{#2}{#3}}}
+\newcommand*{\si@unt@defpower}[3][]{%
+ \si@log@debug{Declaring power \string#2 with \MessageBreak
+ meaning \string#3}%
+ \expandafter\expandafter\expandafter\edef\expandafter%
+ \csname\expandafter\@gobble\string#2@opt@si\endcsname{#1}%
+ \DeclareRobustCommand{#2}{%
+ \ifsi@unt@littest
+ \expandafter\@gobbletwo
+ \else
+ \ifsi@unt@litout
+ \expandafter\expandafter\expandafter\si@unt@litpower%
+ \else
+ \expandafter\expandafter\expandafter\si@unt@power%
+ \fi
+ \fi
+ {#2}{#3}}}
+\newcommand*{\si@unt@unithook}{}
+\newcommand*{\si@unt@unit}[3]{%
+ \ifnum\si@unt@depthcnt=\m@ne\relax
+ \expandafter\si@unt@init%
+ \fi
+ \advance\si@unt@depthcnt\@ne\relax
+ \si@log@debug{Unit processing: level \the\si@unt@depthcnt,
+ \MessageBreak unit \string#2}%
+ \si@unt@firstorsecond{#1}{#2}%
+ \si@unt@ifliteral{#3}
+ {\si@unt@addtostack{unit}{#3}%
+ \ifsi@unt@prepower
+ \expandafter\si@unt@stkpower%
+ \fi}
+ {#3}%
+ \advance\si@unt@depthcnt\m@ne\relax
+ \ifnum\si@unt@depthcnt=\z@\relax
+ \expandafter\si@unt@final%
+ \fi}
+\newcommand{\si@unt@firstorsecond}[2]{%
+ \ifsi@unt@first
+ \expandafter\si@unt@first%
+ \else
+ \expandafter\si@unt@second%
+ \fi
+ {#1}{#2}}%
+\newcommand*{\si@unt@first}[2]{%
+ \si@ifnotmtarg{#1}
+ {\num{#1}}%
+ \si@unt@unithook%
+ \ifcsname\expandafter\@gobble\string#2@opt@unt@si\endcsname
+ \expandafter\si@unt@setopts%
+ \else
+ \expandafter\@gobble
+ \fi
+ {#2}%
+ \si@unt@addvaluesep%
+ \si@unt@firstfalse}
+\newcommand*{\si@unt@setopts}[1]{%
+ \expandafter\expandafter\expandafter\expandafter\expandafter%
+ \expandafter\expandafter\si@temptoks\expandafter\expandafter%
+ \expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\csname\expandafter\@gobble\string#1@opt@unt@si%
+ \endcsname}%
+ \expandafter\sisetup\expandafter{\the\si@temptoks}%
+ \si@log@debug{Applying options ``\the\si@temptoks''
+ for\MessageBreak unit \string#1}%
+ \@ifundefined{si@unt@SIopts}{}
+ {\ifx\@empty\si@unt@SIopts\@empty\else
+ \expandafter\expandafter\si@unt@setSIopts%
+ \fi}}
+\newcommand*{\si@unt@setSIopts}{%
+ \expandafter\si@temptoks\expandafter{\si@unt@SIopts}%
+ \expandafter\sisetup\expandafter{\the\si@temptoks}}
+\newcommand{\si@unt@second}[2]{%
+ \si@ifnotmtarg{#1}
+ {\si@log@warn{Optional argument to unit macro\MessageBreak
+ allowed only for outer unit}}%
+ \si@unt@third%
+ \si@unt@addtostack{space}{\ensuremath{\si@unitsep}}}
+\newcommand*{\si@unt@third}{%
+ \ifsi@unt@prepower\else
+ \expandafter\si@unt@stkpower%
+ \fi
+ \def\si@tempa{prefix}%
+ \expandafter\ifx\csname si@unt@lastadd\si@unt@checkstack%
+ \endcsname\si@tempa\else
+ \expandafter\si@unt@spacecheck%
+ \fi
+ \ifsi@unt@per
+ \expandafter\si@unt@perseentrue
+ \fi}
+\newcommand*{\si@unt@spacecheck}{%
+ \def\si@tempa{space}%
+ \expandafter\ifx\csname si@unt@lastadd\si@unt@checkstack%
+ \endcsname\si@tempa\else
+ \expandafter\si@unt@reciptest%
+ \fi}
+\newcommand*{\si@unt@prefix}[3]{%
+ \si@unt@firstorsecond{}{#1}%
+ \ifsi@prefixnum
+ \expandafter\si@unt@countprefix%
+ \else
+ \expandafter\si@unt@addprefix%
+ \fi
+ {#2}{#3}}
+\newcommand*{\si@unt@addprefix}[2]{\si@unt@addtostack{prefix}{#2}}
+\newcount\si@unt@prefixcnt
+\newcommand*{\si@unt@countprefix}[2]{%
+ \si@tempcnta#1\relax
+ \ifsi@unt@per
+ \si@unt@invprefix%
+ \fi
+ \advance\si@unt@prefixcnt\si@tempcnta\relax}
+\newcommand*{\si@unt@invprefix}{%
+ \si@tempcntb\si@tempcnta\relax
+ \si@tempcnta -\si@tempcntb\relax}
+\newcommand*{\si@unt@litpower}[2]{\textsuperscript{#2}}
+\newif\ifsi@unt@prepower
+\newcommand*{\si@unt@power}[2]{%
+ \si@unt@powerdim #2 pt\relax
+ \ifsi@frac\else
+ \ifsi@unt@per
+ \expandafter\expandafter\expandafter\si@unt@invpower%
+ \fi
+ \fi
+ \def\si@tempa{post}%
+ \si@unt@prepowertrue
+ \expandafter\expandafter\expandafter\ifx\expandafter%
+ \csname\expandafter\@gobble\string#1@opt@si\endcsname\si@tempa
+ \expandafter\si@unt@stackpower%
+ \fi}
+\newdimen\si@unt@powerdim
+\newcommand*{\si@unt@stackpower}{%
+ \si@unt@prepowerfalse
+ \si@unt@stkpower%
+ \si@unt@perfalse
+ \si@unt@perseenfalse}
+\newcommand*{\si@unt@stkpower}{%
+ \ifdim\si@unt@powerdim=\m@ne pt\relax
+ \ifsi@frac\else
+ \expandafter\expandafter\expandafter\si@unt@stkpwr%
+ \fi
+ \else
+ \expandafter\si@unt@stkpwr%
+ \fi}
+\newcommand*{\si@unt@stkpwr}{%
+ \ifdim\si@unt@powerdim=\z@\relax\else
+ \edef\si@tempa{unit}%
+ \expandafter\ifx\csname si@unt@lastadd\si@unt@checkstack%
+ \endcsname\si@tempa
+ \si@unt@addtostack{power}{^{\num{\strip@pt\si@unt@powerdim}}}%
+ \fi
+ \fi
+ \si@unt@powerdim\z@\relax}
+\newcommand*{\si@unt@invpower}{%
+ \si@tempdima\si@unt@powerdim\relax
+ \si@unt@powerdim -\si@tempdima\relax
+ \ifdim\si@unt@powerdim=\p@\relax
+ \si@unt@powerdim\z@\relax
+ \fi}
+\newif\ifsi@unt@per
+\newif\ifsi@unt@perseen
+\DeclareRobustCommand*{\per}{\si@per}
+\newcommand*{\si@per}{%
+ \si@unt@firstorsecond{}{\per}%
+ \ifsi@unt@per
+ \expandafter\si@unt@perfalse
+ \else
+ \expandafter\si@unt@pertrue
+ \fi}
+\newcommand*{\si@unt@reciptest}{%
+ \ifsi@unt@per
+ \ifsi@unt@perseen
+ \expandafter\expandafter\expandafter\si@unt@recip%
+ \fi
+ \fi}
+\newcommand*{\si@unt@recip}{%
+ \si@unt@powerdim\m@ne pt\relax
+ \si@unt@stackpower}
+\newcommand*{\si@unt@lastadda}{}
+\newcommand*{\si@unt@lastaddb}{}
+\newcommand*{\si@unt@addtostack}[2]{%
+ \edef\si@tempa{#1}%
+ \expandafter\ifx\csname si@unt@lastadd\si@unt@checkstack\endcsname%
+ \si@tempa
+ \expandafter\@gobbletwo
+ \else
+ \expandafter\si@unt@preplussp%
+ \fi
+ {#1}{#2}}
+\newcommand*{\si@unt@preplussp}[2]{%
+ \def\si@tempa{prefix+space}%
+ \edef\si@tempb{\csname si@unt@lastadd\si@unt@checkstack%
+ \endcsname+#1}%
+ \ifx\si@tempa\si@tempb
+ \expandafter\@gobbletwo
+ \else
+ \expandafter\si@unt@stack%
+ \fi
+ {#1}{#2}}
+\newcommand*{\si@unt@stack}[2]{%
+ \expandafter\edef\csname si@unt@lastadd\si@unt@checkstack%
+ \endcsname{#1}%
+ \edef\si@tempa{#1}%
+ \def\si@tempb{unit}%
+ \ifx\si@tempa\si@tempb
+ \expandafter\si@unt@inccnt%
+ \fi
+ \def\si@tempb{space}%
+ \ifx\si@tempa\si@tempb
+ \expandafter\si@unt@holdspace%
+ \else
+ \expandafter\si@unt@addstack%
+ \fi
+ {#2}}
+\newcommand*{\si@unt@inccnt}{%
+ \expandafter\advance\csname si@unt@unitcnt\si@unt@checkstack%
+ \endcsname\@ne\relax}
+\newcommand*{\si@unt@holdstacka}{}
+\newcommand*{\si@unt@holdstackb}{}
+\newcommand*{\si@unt@holdspace}[1]{%
+ \expandafter\protected@edef\csname si@unt@holdstack%
+ \si@unt@checkstack\endcsname{#1}}
+\newcommand*{\si@unt@addstack}[1]{%
+ \expandafter\protected@edef\csname si@unt@stack%
+ \si@unt@checkstack\endcsname%
+ {\csname si@unt@stack\si@unt@checkstack\endcsname%
+ \csname si@unt@holdstack\si@unt@checkstack\endcsname#1}%
+ \expandafter\renewcommand\expandafter*\expandafter{%
+ \csname si@unt@holdstack\si@unt@checkstack\endcsname}{}}
+\newcommand*{\si@unt@stackout}{%
+ \ifsi@frac
+ \expandafter\si@unt@fracout%
+ \else
+ \expandafter\si@unt@normout%
+ \fi}
+\newcommand*{\si@unt@checkstack}{%
+ \ifsi@frac
+ \ifsi@unt@per
+ \expandafter\expandafter\expandafter b%
+ \else
+ \expandafter\expandafter\expandafter a%
+ \fi
+ \else
+ \expandafter a%
+ \fi}
+\newcommand*{\si@unt@spaceout}{%
+ \ensuremath{\si@unt@spstack}}
+\newcommand*{\si@unt@prefixout}{%
+ \ifnum\si@unt@prefixcnt=\z@\relax\else
+ \ifsi@unt@num
+ \si@out@text{\ensuremath{{}\si@prefixproduct{}}}%
+ \fi
+ \let\si@exppower\si@prefixpower
+ \num{e\the\si@unt@prefixcnt}%
+ \fi}
+\newcommand*{\si@unt@normout}{%
+ \si@unt@prefixout%
+ \si@unt@spaceout%
+ \expandafter\si@unt@out\expandafter{\si@unt@stacka}}
+\newcommand*{\si@unt@fracout}{%
+ \si@unt@notambig%
+ \ifx\@empty\si@unt@stacka\@empty
+ \ifx\@empty\si@unt@stackb\@empty
+ \ifsi@unt@litout\else
+ \si@log@err{Empty fractional unit}{The unit
+ argument\MessageBreak given does not contain any
+ symbols}%
+ \fi
+ \else
+ \ifsi@slash
+ \si@unt@prefixout%
+ \si@frac{}{\si@unt@stackb}%
+ \else
+ \si@unt@prefixout%
+ \si@unt@spaceout%
+ \si@frac{1}{\si@unt@stackb}%
+ \fi
+ \fi
+ \else
+ \ifx\@empty\si@unt@stackb\@empty
+ \si@unt@normout%
+ \else
+ \si@unt@prefixout%
+ \si@unt@spaceout%
+ \si@frac{\si@unt@stacka}{\si@unt@stackb}%
+ \fi
+ \fi}
+\newcommand*{\si@unt@notambig}{%
+ \ifnum\si@unt@unitcntb>\@ne\relax
+ \ifsi@slash
+ \expandafter\expandafter\expandafter\si@unt@notabg%
+ \fi
+ \fi}
+\newcommand*{\si@unt@notabg}{%
+ \protected@edef\si@unt@stackb{\si@denlbrac\si@unt@stackb%
+ \si@denrbrac}}
+\begingroup
+ \catcode`\~=\active
+ \catcode`\.=\active
+ \gdef\si@unt@out#1{%
+ \begingroup
+ \si@unt@nonlatin%
+ \makeatletter%
+ \catcode`\~=\active
+ \catcode`\.=\active
+ \def~{\ensuremath{\si@unitspace}}%
+ \def.{\ensuremath{\si@unitsep}}%
+ \scantokens{\si@out@text{#1}\@empty}%
+ \endgroup}
+\endgroup
+\newcommand*{\si@unt@nonlatin}{\relax}
+\AtBeginDocument{%
+ \@ifpackageloaded{inputenc}
+ {\def\si@tempa{latin1}%
+ \ifx\inputencodingname\si@tempa
+ \si@unt@sym{176}{\si@sym@degree}%
+ \si@unt@sym{181}{\si@sym@mu}%
+ \si@unt@sym{229}{\si@sym@ringA}%
+ \fi}
+ {}}
+\newcommand*{\si@unt@sym}[1]{%
+ \bgroup
+ \uccode`\~#1%
+ \uppercase{%
+ \egroup
+ \def~}}
+\newunit{\kilogram}{kg}
+\newunit{\metre}{m}
+\newunit{\mole}{mol}
+\newunit{\second}{s}
+\newunit{\ampere}{A}
+\newunit{\kelvin}{K}
+\newunit{\candela}{cd}
+\newpower{\Square}{2}
+\newpower[post]{\squared}{2}
+\newpower{\cubic}{3}
+\newpower[post]{\cubed}{3}
+\newcommand*{\tothe}[1]{%
+ \ifsi@unt@littest
+ \expandafter\@gobbletwo
+ \else
+ \ifsi@unt@litout
+ \expandafter\expandafter\expandafter\si@unt@litpower%
+ \else
+ \expandafter\expandafter\expandafter\si@unt@power%
+ \fi
+ \fi
+ {\tothe}{#1}}
+\newcommand*{\tothe@opt@si}{post}
+\newcommand*{\si@loc@load}[1]{%
+ \let\si@loc@sisetup\sisetup
+ \renewcommand*{\sisetup}[1]{%
+ \expandafter\def\csname si@loc@#1\endcsname{##1}}
+ \si@loadfile{#1}%
+ \let\sisetup\si@loc@sisetup}
+\newcommand*{\si@loc@set}[1]{%
+ \ifcsname si@loc@#1\endcsname
+ \si@log@inf{Setting locale to `#1'}%
+ \expandafter\expandafter\expandafter\expandafter\expandafter%
+ \expandafter\expandafter\si@temptoks\expandafter\expandafter%
+ \expandafter\expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\csname si@loc@#1\endcsname}%
+ \expandafter\sisetup\expandafter{\the\si@temptoks}%
+ \ifcsname si@loc@#1@extra\endcsname
+ \csname si@loc@#1@extra\endcsname%
+ \fi
+ \else
+ \ifcsname si@loc@#1@extra\endcsname
+ \si@log@inf{Setting locale to `#1'}%
+ \csname si@loc@#1@extra\endcsname%
+ \else
+ \si@log@warn{Unknown locale `#1'}%
+ \fi
+ \fi}
+\newcommand*{\addtolocale}[2]{\si@addtocsname{si@loc@#1@extra}{#2}}
+\begingroup
+ \catcode`\^=\active\relax
+ \catcode`\-=\active\relax
+ \gdef\si@out@text#1{%
+ \begingroup
+ \catcode`\^=\active\relax%
+ \makeatletter%
+ \ifsi@fam@set\else
+ \expandafter\si@fam@set%
+ \fi
+ \text{\si@fam@italic\si@fam@bold\si@fam@text%
+ \ifsi@textmode
+ \let^\textsuperscript
+ \catcode`\-=\active\relax%
+ \let-\si@out@minus
+ \scantokens{#1\@empty}%
+ \else
+ \let^\sp
+ \let\textsuperscript\sp
+ $\si@fam@maths{\scantokens{#1}}$%
+ \fi}%
+ \endgroup
+ \check@mathfonts}
+\endgroup
+\newcommand*{\si@out@minus}{\ensuremath{-}}
+\newcommand*{\si@out@num}[1]{%
+ \begingroup
+ \sisetup{%
+ textdefault=\si@textnumdefault,%
+ mathdefault=\si@mathnumdefault}%
+ \si@out@text{#1}%
+ \endgroup}
+\sisetup{
+ unitsep=thin,
+ valuesep=thin,
+ decimalsign=fullstop,
+ digitsep=thin,
+ obeybold=false,
+ inlinebold=text,
+ obeyitalic=false,
+ sign=plus,
+ addsign=none,
+ obeymode=false,
+ mode=maths,
+ padangle=small,
+ padnumber=lead,
+ sepfour=false,
+ tabformat=-1,
+ xspace=false,
+ per=reciprocal,
+ slash=slash,
+ mathsdefault=\si@mathsrm,
+ mathsrm=mathrm,
+ mathssf=mathsf,
+ mathstt=mathtt,
+ textdefault=\si@textrm,
+ textrm=rmfamily,
+ textsf=sffamily,
+ texttt=ttfamily,
+ mathsnumdefault=\si@mathsrm,
+ textnumdefault=\si@textrm,
+ numlist=0123456789,
+ numdecimal={.,},
+ numexp=eEdD,
+ numgobble={},
+ numsign=+-\pm\mp,
+ numextra=(),
+ redefsymbols=true,
+ load=default,
+ noload={},
+ eVcorra={0.3ex},
+ eVcorrb={0ex},
+ denlbrac=(,
+ denrbrac=),
+ astroang=false,
+ loadlocales={},
+ loctolang={},
+ prefix=symbol,
+ prefixpower=ten,
+ prefixproduct=times}
+\ProcessOptionsX[si]<opt>
+\newcommand*{\si@extension}{cfg}
+\newcommand*{\si@fileprefix}{si-}
+\newcommand*{\si@ifloaded}[1]{%
+ \@ifl@aded\si@extension{\si@fileprefix#1}}
+\newcommand*{\si@loadfile}[1]{%
+ \si@ifloaded{#1}{}
+ {\InputIfFileExists{\si@fileprefix#1.\si@extension}
+ {}
+ {\si@log@err{Failed to load file
+ \si@fileprefix#1.\si@extension}
+ {The configuration file requested could not be found}}}}
+\newcommand*{\si@requirecfgs}[1]{%
+ \@for\si@tempa:=#1\do{\si@loadfile{\si@tempa}}}
+\newcommand*{\si@loademfile}[1]{%
+ \@ifpackageloaded{#1}
+ {\si@log@err{Emulation clash for package `#1'}
+ {You have asked for emulation of package `#1'\MessageBreak
+ (perhaps by giving si a back-compatibility
+ option)\MessageBreak but the package is already loaded!}}
+ {\si@loadfile{#1}}}
+\newcommand*{\si@emclash}[2]{%
+ \si@log@err{Emulation clash: `#1' and `#2'}
+ {You have asked for emulation of package `#1'\MessageBreak
+ but have already loaded emulation of `#2'}}
+\ifx\@empty\si@emulate\@empty\else
+ \@for\si@tempa:=\si@emulate\do{%
+ \si@loademfile{\si@tempa}}
+\fi
+\newcommand*{\si@expanddefault}[2]{%
+\expandafter\ifx\expandafter\@empty\csname si@#1\endcsname\@empty
+\else
+ \def\si@tempb{default}
+ \def\si@tempc{}
+ \expandafter\@for\expandafter\si@tempa\expandafter:\expandafter
+ =\csname si@#1\endcsname\do{%
+ \ifx\si@tempa\si@tempb
+ \si@addtolist{\si@tempc}{#2}
+ \else
+ \si@addtolist{\si@tempc}{\si@tempa}
+ \fi}
+ \expandafter\edef\csname si@#1\endcsname{\si@tempc}
+ \expandafter\si@addtolist\expandafter{\csname si@no#1\endcsname}
+ {default}
+ \def\si@tempc{}
+ \expandafter\@for\expandafter\si@tempa\expandafter:\expandafter
+ =\csname si@#1\endcsname\do{%
+ \si@switchfalse
+ \expandafter\@for\expandafter\si@tempb\expandafter:\expandafter
+ =\csname si@no#1\endcsname\do{%
+ \ifx\si@tempa\si@tempb
+ \si@switchtrue
+ \fi
+ \ifsi@switch\else
+ \si@addtolist{\si@tempc}{\si@tempa}
+ \fi}}
+ \@for\si@tempa:=\si@tempc\do{%
+ \si@loadfile{\si@tempa}}
+\fi}
+\si@expanddefault{load}{prefix,named,addn,prefixed,accepted,%
+ physical,abbr}
+\ifx\@empty\si@loadlocales\@empty\else
+ \@for\si@tempa:=\si@loadlocales\do{%
+ \si@loc@load{\si@tempa}}
+\fi
+\ifx\@empty\si@loctolang\@empty\else
+ \def\si@tempa#1:#2\@nil{\si@loc@load{#1}}
+ \@for\si@tempb:=\si@loctolang\do{%
+ \expandafter\si@tempa\si@tempb:\@nil}
+ \AtBeginDocument{%
+ \@ifpackageloaded{babel}
+ {\def\si@tempa#1:#2:#3\@nil{%
+ \expandafter\addto\expandafter{\csname extras#2\endcsname}%
+ {\si@loc@set{#1}}}%
+ \@for\si@tempb:=\si@loctolang\do{%
+ \expandafter\si@tempa\si@tempb::\@nil}}
+ {\si@log@warn{babel not loaded - option\MessageBreak
+ loctolang ignored}}}
+\fi
+\IfFileExists{si.cfg}
+ {\si@log@inf{Local configuration file found}%
+ \InputIfFileExists{si.cfg}{}{}}
+ {}
+\endinput
+%%
+%% End of file `si.sty'.