From 120f7e4c07269238a49d6bf82cdd01e0be96f2a7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 23 May 2010 23:51:56 +0000 Subject: siunitx 2 (23may10) git-svn-id: svn://tug.org/texlive/trunk@18439 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/siunitx/config/si-DE.cfg | 49 - .../tex/latex/siunitx/config/si-SIunits.cfg | 346 - .../texmf-dist/tex/latex/siunitx/config/si-UK.cfg | 49 - .../texmf-dist/tex/latex/siunitx/config/si-USA.cfg | 49 - .../texmf-dist/tex/latex/siunitx/config/si-ZA.cfg | 49 - .../tex/latex/siunitx/config/si-abbr.cfg | 98 - .../tex/latex/siunitx/config/si-accepted.cfg | 64 - .../tex/latex/siunitx/config/si-addn.cfg | 59 - .../tex/latex/siunitx/config/si-astro.cfg | 43 - .../tex/latex/siunitx/config/si-binary.cfg | 51 - .../tex/latex/siunitx/config/si-chemeng.cfg | 44 - .../tex/latex/siunitx/config/si-fancynum.cfg | 69 - .../tex/latex/siunitx/config/si-fancyunits.cfg | 127 - .../tex/latex/siunitx/config/si-geophys.cfg | 42 - .../texmf-dist/tex/latex/siunitx/config/si-hep.cfg | 59 - .../tex/latex/siunitx/config/si-hepunits.cfg | 92 - .../tex/latex/siunitx/config/si-named.cfg | 77 - .../tex/latex/siunitx/config/si-physical.cfg | 47 - .../tex/latex/siunitx/config/si-prefix.cfg | 70 - .../tex/latex/siunitx/config/si-prefixed.cfg | 126 - .../tex/latex/siunitx/config/si-sistyle.cfg | 108 - .../tex/latex/siunitx/config/si-synchem.cfg | 47 - .../tex/latex/siunitx/config/si-units.cfg | 74 - .../tex/latex/siunitx/config/si-unitsdef.cfg | 254 - .../latex/siunitx/config/siunitx-abbreviations.cfg | 92 + .../tex/latex/siunitx/config/siunitx-binary.cfg | 48 + .../tex/latex/siunitx/config/siunitx-version-1.cfg | 661 ++ Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 9691 ++++++++++++-------- 28 files changed, 6536 insertions(+), 6049 deletions(-) delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-chemeng.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-geophys.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg delete mode 100644 Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg create mode 100644 Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg create mode 100644 Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg create mode 100644 Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg (limited to 'Master/texmf-dist/tex/latex/siunitx') diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg deleted file mode 100644 index 7c233a15ba3..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg +++ /dev/null @@ -1,49 +0,0 @@ -%% -%% This is file `si-DE.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `DE') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-DE.cfg} - [2010/02/22 v1.4c siunitx: Germany locale] -\sisetup{ - unitsep=cdot, - valuesep=thin, - decimalsymbol=comma, - expproduct=cdot, - digitsep=thin, - sepfour=false, - tophrase={{ bis }}} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-DE.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg deleted file mode 100644 index d8d97003060..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg +++ /dev/null @@ -1,346 +0,0 @@ -%% -%% This is file `si-SIunits.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `SIunits') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-SIunits.cfg} - [2010/02/22 v1.4c siunitx: Emulation of - SIunits] -\si@emulating{SIunits}{2007/12/02 v1.36} -\sisetup{ - unitsep=thick, - valuesep=thick, - prefixproduct=\si@valuesep, - trapambigfrac=false, - stickyper} -\requiresiconfigs{prefix,named,accepted,physical} -\newcommand*{\reciprocal}{\sisetup{per=reciprocal}\si@per} -\let\rp\reciprocal -\renewcommand*{\per}{\sisetup{per=slash}\si@per} -\newcommand*{\usk}{} -\newcommand*{\power}[1]{#1\tothe} -\newcommand*{\rpsquare}{\sisetup{per=reciprocal}\si@per\Square} -\newcommand*{\rpcubic}{\sisetup{per=reciprocal}\si@per\cubic} -\newpower{\fourth}{4} -\newcommand*{\rpfourth}{\sisetup{per=reciprocal}\si@per\fourth} -\newcommand*{\rpsquared}{% - \sisetup{per=reciprocal}\si@unt@pertrue\si@unt@perseentrue% - \squared} -\newcommand*{\rpcubed}{% - \sisetup{per=reciprocal}\si@unt@pertrue\cubed} -\newcommand*{\SIsetup}[1]{% - \@for\si@tempa:=#1\do{% - \@ifundefined{ifsi@old@#1} - {\si@log@warn{Unknown SIunits option `#1'}} - {\csname si@old@#1true\endcsname}} - \si@siu@setup} -\newcommand*{\si@siu@setup}{% - \ifsi@old@cdot - \sisetup{unitsep=cdot}% - \fi - \ifsi@old@thickspace - \sisetup{unitsep=thick}% - \fi - \ifsi@old@mediumspace - \sisetup{unitsep=medium}% - \fi - \ifsi@old@thinspace - \sisetup{unitsep=thin}% - \fi - \ifsi@old@thickqspace - \sisetup{valuesep=thick}% - \fi - \ifsi@old@mediumqspace - \sisetup{valuesep=medium}% - \fi - \ifsi@old@thinqspace - \sisetup{valuesep=thin}% - \fi} -\si@siu@setup -\ifsi@old@squaren - \newpower{\squaren}{2} -\fi -\AtBeginDocument{% - \@ifundefined{square} - {\newpower{\square}{2}} - {\ifsi@old@amssymb - \renewpower{\square}{2} - \else - \ifsi@old@squaren\else - \si@log@warn{\string\square\space already - defined\MessageBreak SIunits mode may cause - errors}% - \fi - \fi}} -\AtBeginDocument{ - \@ifundefined{gray} - {\newunit{\gray}{Gy}} - {\ifsi@old@pstricks - \renewunit{\gray}{Gy} - \else - \ifsi@old@Gray\else - \si@log@warn{\string\gray\space already - defined\MessageBreak SIunits mode may cause - errors}% - \fi - \fi}} -\ifsi@old@italian - \let\unita\SI -\else - \let\unit\SI -\fi -\ifsi@old@textstyle - \sisetup{mode=text} -\fi -\ifsi@old@binary - \sisetup{alsoload=binary} -\fi -\newunit[valuesep=none]{\arcminute}{\si@sym@minute} -\newunit[valuesep=none]{\arcsecond}{\si@sym@second} -\newunit{\rperminute}{r/min} -\newunit{\ton}{t} -\newunit{\degreecelsius}{\celsius} -\let\addunit\newunit -\newcommand*{\addprefix}[2]{\newprefix{#1}{#2}} -\newcommand*{\si@siu@newunit}[3][]{% - \renewcommand*{\si@tempa}{#1}% - \renewcommand*{\si@tempb}{square}% - \def\si@siu@power{}% - \ifx\@empty\si@tempa\@empty\else - \ifx\si@tempa\si@tempb - \renewcommand*{\si@siu@power}{\ssquare}% - \else - \edef\si@siu@power{% - \expandafter\noexpand\csname #1\endcsname}% - \fi - \fi - \edef\si@tempa{% - \expandafter\noexpand\csname #2per#1#3\endcsname}% - \edef\si@tempb{% - \expandafter\noexpand\csname #2\endcsname\noexpand\per - \expandafter\noexpand\si@siu@power - \expandafter\noexpand\csname #3\endcsname}% - \expandafter\expandafter\expandafter\newunit\expandafter% - \expandafter\expandafter{\expandafter\si@tempa\expandafter}% - \expandafter{\si@tempb} - \edef\si@tempa{% - \expandafter\noexpand\csname #2per#1#3np\endcsname}% - \edef\si@tempb{% - \expandafter\noexpand\csname #2\endcsname\noexpand - \reciprocal\expandafter\noexpand\si@siu@power - \expandafter\noexpand\csname #3\endcsname}% - \expandafter\expandafter\expandafter\newunit\expandafter - \expandafter\expandafter{\expandafter\si@tempa\expandafter}% - \expandafter{\si@tempb}% - \si@siu@newunithook[#1]{#2}{#3}} -\providecommand*{\si@siu@newunithook}[3][]{} -\si@siu@newunit{gray}{second} -\si@siu@newunit[square]{metre}{second} -\si@siu@newunit{joule}{mole} -\si@siu@newunit[cubic]{mole}{metre} -\si@siu@newunit[square]{radian}{second} -\si@siu@newunit{radian}{second} -\si@siu@newunit[cubic]{squaremetre}{metre} -\si@siu@newunit[cubic]{katal}{metre} -\si@siu@newunit{coulomb}{mol} -\si@siu@newunit[square]{ampere}{metre} -\si@siu@newunit[cubic]{kilogram}{metre} -\si@siu@newunit[cubic]{coulomb}{metre} -\si@siu@newunit{volt}{metre} -\si@siu@newunit[square]{coulomb}{squaremetre} -\si@siu@newunit{farad}{metre} -\si@siu@newunit[square]{watt}{metre} -\si@siu@newunit[square]{joule}{metre} -\si@siu@newunit[cubic]{newton}{metre} -\si@siu@newunit{newton}{kilogram} -\si@siu@newunit{joule}{kelvin} -\si@siu@newunit{joule}{kilogram} -\si@siu@newunit{coulomb}{kilogram} -\si@siu@newunit{squaremetre}{second} -\si@siu@newunit[square]{squaremetre}{second} -\si@siu@newunit[square]{candela}{metre} -\si@siu@newunit{ampere}{metre} -\si@siu@newunit{joule}{tesla} -\si@siu@newunit{henry}{metre} -\si@siu@newunit{kilogram}{second} -\si@siu@newunit[square]{kilogram}{metre} -\si@siu@newunit{kilogram}{metre} -\si@siu@newunit[square]{newton}{metre} -\si@siu@newunit{watt}{kilogram} -\si@siu@newunit[cubic]{watt}{metre} -\si@siu@newunit{squaremetre}{kilogram} -\si@siu@newunit{cubicmetre}{kilogram} -\si@siu@newunit{newton}{metre} -\si@siu@newunit[cubic]{squaremetre}{second} -\si@siu@newunit{metre}{second} -\si@siu@newunit[cubic]{joule}{metre} -\si@siu@newunit{cubicmetre}{second} -\newcommand*{\si@siu@newunitx}[4]{% - \expandafter\newunit\expandafter{\csname #1per#2\endcsname} - {#3\per#4}% - \expandafter\newunit\expandafter{\csname #1per#2np\endcsname} - {#3\reciprocal#4} - \si@siu@newunitxhook{#1}{#2}{#3}{#4}} -\providecommand*{\si@siu@newunitxhook}[4]{} -\si@siu@newunitx{kilogramsquaremetre}{second} - {\kilogram\squaremetre}{\second} -\si@siu@newunitx{squaremetre}{newtonsecond}{\squaremetre} - {\newton\second} -\si@siu@newunitx{kilogrammetre}{second}{\kilogram\metre} - {\second} -\si@siu@newunitx{kilogram}{squaremetresecond}{\kilogram} - {\squaremetre\second} -\si@siu@newunitx{joule}{molekelvin}{\joule}{\mole\kelvin} -\si@siu@newunitx{kilogram}{kilomole}{\kilogram}{\kilo\mole} -\si@siu@newunitx{kilogrammetre}{squaresecond}{\kilogram\metre} - {\second\squared} -\si@siu@newunitx{watt}{squaremetresteradian}{\watt} - {\squaremetre\steradian} -\si@siu@newunitx{joule}{kilogramkelvin}{\joule} - {\kilogram\kelvin} -\si@siu@newunitx{watt}{metrekelvin}{\watt}{\metre\kelvin} -\si@siu@newunitx{kilogram}{cubicmetrecoulomb}{\kilogram} - {\cubic\metre\coulomb} -\si@siu@newunitx{kilogram}{secondcubicmetre}{\kilogram} - {\second\cubicmetre} -\newunit{\si@siu@unity}{1} -\si@siu@newunitx{}{squaremetresecond}{\si@siu@unity} - {\squaremetre\second} -\newunit{\pascalsecond}{\pascal\second} -\newunit{\amperemetresecond}{\ampere\metre\second} -\newunit{\ohmmetre}{\ohm\metre} -\newunit{\newtonmetre}{\newton\metre} -\let\newtonmetrenp\newtonmetre -\newunit{\kilogramsquaremetre}{\kilogram\squaremetre} -\let\kilogramsquaremetrenp\kilogramsquaremetre -\newcommand*{\si@siu@newprefix}[1]{% - \edef\si@tempa{\expandafter\noexpand\csname #1d\endcsname}% - \edef\si@tempb{\expandafter\noexpand\csname #1\endcsname}% - \expandafter\expandafter\expandafter\newcommand\expandafter - \expandafter\expandafter*\expandafter\expandafter - \expandafter{\expandafter\si@tempa\expandafter}\expandafter - {\expandafter\si@prefixsymbolicfalse\si@tempb}} -\si@siu@newprefix{yocto} -\si@siu@newprefix{zepto} -\si@siu@newprefix{atto} -\si@siu@newprefix{femto} -\si@siu@newprefix{pico} -\si@siu@newprefix{nano} -\si@siu@newprefix{micro} -\si@siu@newprefix{milli} -\si@siu@newprefix{centi} -\si@siu@newprefix{deca} -\si@siu@newprefix{deka} -\si@siu@newprefix{hecto} -\si@siu@newprefix{kilo} -\si@siu@newprefix{mega} -\si@siu@newprefix{giga} -\si@siu@newprefix{tera} -\si@siu@newprefix{peta} -\si@siu@newprefix{exa} -\si@siu@newprefix{zetta} -\si@siu@newprefix{yotta} -\ifsi@old@binary - \si@siu@newprefix{kibi} - \si@siu@newprefix{mebi} - \si@siu@newprefix{gibi} - \si@siu@newprefix{tebi} - \si@siu@newprefix{pebi} - \si@siu@newprefix{exbi} -\fi -\ifsi@old@derived - \newunit{\derradian}{\metre\reciprocal\metre} - \newunit{\dersteradian}{\squaremetre\rpsquare\metre} - \newunit{\derhertz}{\reciprocal\second} - \newunit{\dernewton}{\metre\kilogram\second\rpsquared} - \newunit{\derpascal}{\newton\rpsquare\metre} - \newunit{\derjoule}{\newton\metre} - \newunit{\derwatt}{\joule\reciprocal\second} - \newunit{\dercoulomb}{\ampere\second} - \newunit{\dervolt}{\watt\reciprocal\ampere} - \newunit{\derfarad}{\coulomb\reciprocal\volt} - \newunit{\derohm}{\volt\reciprocal\ampere} - \newunit{\dersiemens}{\ampere\reciprocal\volt} - \newunit{\derweber} - {\squaremetre\kilogram\second\rpsquared\reciprocal\ampere} - \newunit{\dertesla}{\weber\rpsquare\metre} - \newunit{\derhenry}{\weber\reciprocal\ampere} - \newunit{\dercelsius}{\kelvin} - \newunit{\derlumen}{\candela\steradian} - \newunit{\derlux}{\lumen\rpsquare\metre} - \newunit{\derbecquerel}{\derhertz} - \newunit{\dergray}{\joule\reciprocal\kilogram} - \newunit{\dersievert}{\dergray} - \newunit{\derkatal}{\rp\second\usk\mole} -\fi -\ifsi@old@derivedinbase - \newunit{\radianbase}{\metre\reciprocal\metre} - \newunit{\steradianbase}{\squaremetre\rpsquare\metre} - \newunit{\hertzbase}{\reciprocal\second} - \newunit{\newtonbase}{\metre\kilogram\second\rpsquared} - \newunit{\pascalbase}{\reciprocal\metre\kilogram\second% - \rpsquared} - \newunit{\joulebase}{\squaremetre\kilogram\second\rpsquared} - \newunit{\wattbase}{\squaremetre\kilogram\rpcubic\second} - \newunit{\coulombbase}{\ampere\second} - \newunit{\voltbase} - {\squaremetre\kilogram\rpcubic\second\reciprocal\ampere} - \newunit{\faradbase} - {\rpsquare\metre\reciprocal\kilogram\fourth\second\ampere% - \squared} - \newunit{\ohmbase} - {\squaremetre\kilogram\rpcubic\second\rpsquare\ampere} - \newunit{\siemensbase} - {\rpsquare\metre\reciprocal\kilogram\cubic\second\ampere% - \squared} - \newunit{\weberbase} - {\squaremetre\kilogram\second\rpsquared\reciprocal\ampere} - \newunit{\teslabase}{\kilogram\second\rpsquared\reciprocal% - \ampere} - \newunit{\henrybase} - {\squaremetre\kilogram\second\rpsquared\rpsquare\ampere} - \newunit{\celsiusbase}{\kelvin} - \newunit{\lumenbase}{\candela\squaremetre\rpsquare\metre} - \newunit{\luxbase}{\candela\squaremetre\rpfourth\metre} - \newunit{\becquerelbase}{\hertzbase} - \newunit{\graybase}{\squaremetre\second\rpsquared} - \newunit{\sievertbase}{\graybase} - \newunit{\katalbase}{\rp\second\mole} -\fi -\InputIfFileExists{SIunits.cfg} - {\si@log@inf{SIunits config file loaded}} - {\si@log@inf{SIunits config file not found}} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-SIunits.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg deleted file mode 100644 index a750691c66f..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg +++ /dev/null @@ -1,49 +0,0 @@ -%% -%% This is file `si-UK.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `UK') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-UK.cfg} - [2010/02/22 v1.4c siunitx: UK locale] -\sisetup{ - unitsep=thin, - expproduct=times, - valuesep=thin, - decimalsymbol=fullstop, - digitsep=thin, - sepfour=false, - tophrase={{ to }}} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-UK.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg deleted file mode 100644 index 2710d1fc42e..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg +++ /dev/null @@ -1,49 +0,0 @@ -%% -%% This is file `si-USA.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `USA') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-USA.cfg} - [2010/02/22 v1.4c siunitx: USA locale] -\sisetup{ - unitsep=thin, - expproduct=times, - valuesep=thin, - decimalsymbol=fullstop, - digitsep=thin, - sepfour=false, - tophrase={{ to }}} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-USA.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg deleted file mode 100644 index d61cc8b02a6..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg +++ /dev/null @@ -1,49 +0,0 @@ -%% -%% This is file `si-ZA.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `ZA') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-ZA.cfg} - [2010/02/22 v1.4c siunitx: South Africa locale] -\sisetup{ - unitsep=cdot, - valuesep=thin, - expproduct=times, - decimalsymbol=comma, - digitsep=thin, - sepfour=false, - tophrase={{ to }}} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-ZA.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg deleted file mode 100644 index a4714d6c512..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg +++ /dev/null @@ -1,98 +0,0 @@ -%% -%% This is file `si-abbr.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `abbr') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-abbr.cfg} - [2010/02/22 v1.4c siunitx: Abbreviated units] -\requiresiconfigs{prefix,named,accepted,physical} -\newunit{\pA}{\pico\ampere} -\newunit{\nA}{\nano\ampere} -\newunit{\micA}{\micro\ampere} -\newunit{\mA}{\milli\ampere} -\newunit{\kA}{\kilo\ampere} -\newunit{\Hz}{\hertz} -\newunit{\mHz}{\milli\hertz} -\newunit{\kHz}{\kilo\hertz} -\newunit{\MHz}{\mega\hertz} -\newunit{\GHz}{\giga\hertz} -\newunit{\THz}{\tera\hertz} -\newunit{\fmol}{\femto\mole} -\newunit{\pmol}{\pico\mole} -\newunit{\nmol}{\nano\mole} -\newunit{\micmol}{\micro\mole} -\newunit{\mmol}{\milli\mole} -\newunit{\kmol}{\kilo\mole} -\newunit{\kV}{\kilo\volt} -\newunit{\mV}{\milli\volt} -\provideunit{\ml}{\milli\litre} -\provideunit{\micl}{\micro\litre} -\provideunit{\mL}{\milli\liter} -\provideunit{\micL}{\micro\liter} -\newunit{\cmc}{\centi\metre\cubed} -\newunit{\dmc}{\deci\metre\cubed} -\newunit{\cms}{\centi\metre\squared} -\newunit{\kg}{\kilo\gram} -\AtBeginDocument{\provideunit{\fg}{\femto\gram}} -\newunit{\SIfg}{\femto\gram} -\newunit{\pg}{\pico\gram} -\newunit{\nanog}{\nano\gram} -\newunit{\micg}{\micro\gram} -\newunit{\mg}{\milli\gram} -\newunit{\amu}{\atomicmass} -\newunit{\kJ}{\kilo\joule} -\newunit{\eV}{\electronvolt} -\newunit{\meV}{\milli\electronvolt} -\newunit{\keV}{\kilo\electronvolt} -\newunit{\MeV}{\mega\electronvolt} -\newunit{\GeV}{\giga\electronvolt} -\newunit{\TeV}{\tera\electronvolt} -\newunit[unitsep=none]{\kWh}{\kilo\watt\hour} -\newunit{\picom}{\pico\metre} -\newunit{\nm}{\nano\metre} -\newunit{\micm}{\micro\metre} -\newunit{\mm}{\milli\metre} -\newunit{\cm}{\centi\metre} -\newunit{\dm}{\deci\metre} -\newunit{\km}{\kilo\metre} -\newunit{\Sec}{\second} -\newunit{\as}{\atto\second} -\newunit{\fs}{\femto\second} -\provideunit{\ps}{\pico\second} -\newunit{\ns}{\nano\second} -\newunit{\mics}{\micro\second} -\newunit{\ms}{\milli\second} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-abbr.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg deleted file mode 100644 index 8492a1d6d0f..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg +++ /dev/null @@ -1,64 +0,0 @@ -%% -%% This is file `si-accepted.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `accepted') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-accepted.cfg} - [2010/02/22 v1.4c siunitx: SI Accepted units] -\newunit{\minute}{min} -\newunit{\hour}{h} -\newunit{\Day}{d} -\newunit{\dday}{d} -\ifsi@old@OHM - \AtBeginDocument{ - \provideunit[valuesep=none]{\Degree}{\si@sym@degree} - } -\else - \ifsi@gensymb\else - \AtBeginDocument{ - \provideunit[valuesep=none]{\degree}{\si@sym@degree} - } - \fi -\fi -\newunit[valuesep=none]{\arcmin}{\si@sym@minute} -\newunit[valuesep=none]{\arcsec}{\si@sym@second} -\newunit{\litre}{l} -\newunit{\liter}{L} -\newunit{\tonne}{t} -\newunit{\neper}{Np} -\newunit{\bel}{B} -\newunit{\percent}{\char37} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-accepted.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg deleted file mode 100644 index 12fa08637a4..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg +++ /dev/null @@ -1,59 +0,0 @@ -%% -%% This is file `si-addn.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `addn') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-addn.cfg} - [2010/02/22 v1.4c siunitx: SI Additional units] -\provideunit{\angstrom}{\si@sym@ringA} -\AtBeginDocument{% - \ifdefined\Saveangstrom - \def\Saveangstrom{\si@sym@ringA}% - \def\SaveAngstrom{\si@sym@ringA}% - \fi -} -\newunit{\are}{a} -\newunit{\hectare}{\hecto\are} -\newunit{\barn}{b} -\newunit{\BAR}{bar} -\newunit{\bbar}{bar} -\newunit{\millibar}{\milli\BAR} -\newunit{\gal}{Gal} -\newunit{\curie}{Ci} -\newunit{\roentgen}{R} -\newunit{\rad}{rad} -\provideunit{\rem}{rem} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-addn.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg deleted file mode 100644 index e5839f65994..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg +++ /dev/null @@ -1,43 +0,0 @@ -%% -%% This is file `si-astro.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `astro') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-astro.cfg} - [2010/02/22 v1.4c siunitx: Units for astronomy] -\newunit{\parsec}{pc} -\newunit{\lightyear}{ly} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-astro.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg deleted file mode 100644 index 3feb2cf0443..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg +++ /dev/null @@ -1,51 +0,0 @@ -%% -%% This is file `si-binary.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `binary') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-binary.cfg} - [2010/02/22 v1.4c siunitx: Binary units] -\newprefix[binary]{\kibi}{10}{Ki} -\newprefix[binary]{\mebi}{20}{Mi} -\newprefix[binary]{\gibi}{30}{Gi} -\newprefix[binary]{\tebi}{40}{Ti} -\newprefix[binary]{\pebi}{50}{Pi} -\newprefix[binary]{\exbi}{60}{Ei} -\newprefix[binary]{\zebi}{70}{Zi} -\newprefix[binary]{\yobi}{80}{Yi} -\newunit{\bit}{bit} -\newunit{\byte}{B} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-binary.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-chemeng.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-chemeng.cfg deleted file mode 100644 index 620620bc0d9..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-chemeng.cfg +++ /dev/null @@ -1,44 +0,0 @@ -%% -%% This is file `si-chemeng.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `chemeng') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-chemeng.cfg} - [2010/02/22 v1.4c siunitx: Units for chemical engineering] -\newunit{\gmol}{g\text{-}mol} -\newunit{\kgmol}{kg\text{-}mol} -\newunit{\lbmol}{lb\text{-}mol} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-chemeng.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg deleted file mode 100644 index f7a940ec760..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg +++ /dev/null @@ -1,69 +0,0 @@ -%% -%% This is file `si-fancynum.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `fancynum') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-fancynum.cfg} - [2010/02/22 v1.4c siunitx: Emulation of - fancynum] -\si@emulating{fancynum}{2000/08/08 0.92} -\sisetup{decimalsymbol=cdot,digitsep=comma} -\let\fnum\num -\newcommand*{\setfnumdsym}[1]{\sisetup{decimalsymbol={#1}}} -\newcommand*{\setfnumgsym}[1]{\sisetup{digitsep={#1}}} -\newcommand*{\setfnummsym}[1]{\sisetup{expproduct={#1}}} -\ifsi@old@english - \sisetup{decimalsymbol=cdot,digitsep=comma} -\fi -\ifsi@old@french - \sisetup{decimalsymbol=comma,digitsep=fullstop} -\fi -\ifsi@old@tight - \sisetup{expproduct=tighttimes} -\fi -\ifsi@old@loose - \sisetup{expproduct=times} -\fi -\ifsi@old@thinspaces - \sisetup{digitsep=thin} -\fi -\ifsi@old@commas - \sisetup{digitsep=comma} -\fi -\ifsi@old@plain - \sisetup{digitsep=none} -\fi -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-fancynum.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg deleted file mode 100644 index 25d26baf616..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg +++ /dev/null @@ -1,127 +0,0 @@ -%% -%% This is file `si-fancyunits.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `fancyunits') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-fancyunits.cfg} - [2010/02/22 v1.4c siunitx: Emulation of - fancyunits] -\si@emulating{fancyunits}{2007/02/01 v1.0.1} -\si@ifloaded{SIunits} - {\si@log@err{SIunits emulation loaded\MessageBreak before - fancyunits emulation}{You need to load the fancyunits - emualtion\MessageBreak code before that for - SIunits.\MessageBreak Try emulate=fancyunits as the first - option when\MessageBreak loading siunitx}}{} -\newcommand*{\si@siu@newunithook}[3][]{% - \edef\si@tempa{% - \expandafter\noexpand\csname #2per#1#3uf\endcsname}% - \renewcommand*{\si@tempb}{stickyper,per=fraction, - fraction=nice}% - \edef\si@tempc{% - \noexpand\sisetup{\si@tempb}% - \expandafter\noexpand\csname #2\endcsname\noexpand\si@per% - \expandafter\noexpand\si@siu@power% - \expandafter\noexpand\csname #3\endcsname}% - \expandafter\expandafter\expandafter\newunit\expandafter - \expandafter\expandafter{\expandafter\si@tempa\expandafter}% - \expandafter{\si@tempc}% - \edef\si@tempa{% - \expandafter\noexpand\csname #2per#1#3Uf\endcsname}% - \renewcommand*{\si@tempb}{stickyper,per=fraction, - fraction=frac}% - \edef\si@tempc{% - \noexpand\sisetup{\si@tempb}% - \noexpand\def\noexpand\si@frc@hook{\noexpand\textstyle}% - \expandafter\noexpand\csname #2\endcsname\noexpand\si@per% - \expandafter\noexpand\si@siu@power% - \expandafter\noexpand\csname #3\endcsname}% - \expandafter\expandafter\expandafter\newunit\expandafter - \expandafter\expandafter{\expandafter\si@tempa\expandafter}% - \expandafter{\si@tempc}% - \edef\si@tempa{% - \expandafter\noexpand\csname #2per#1#3UF\endcsname}% - \edef\si@tempc{% - \noexpand\sisetup{\si@tempb}% - \noexpand\def\noexpand\si@frc@hook{\noexpand\displaystyle}% - \expandafter\noexpand\csname #2\endcsname\noexpand\si@per% - \expandafter\noexpand\si@siu@power% - \expandafter\noexpand\csname #3\endcsname}% - \expandafter\expandafter\expandafter\newunit\expandafter - \expandafter\expandafter{\expandafter\si@tempa\expandafter}% - \expandafter{\si@tempc}} -\newcommand*{\si@siu@newunitxhook}[4]{% - \expandafter\newunit\expandafter{\csname #1per#2uf\endcsname} - {\sisetup{stickyper,per=fraction,fraction=nice}% - #3\si@per#4}% - \expandafter\newunit\expandafter{\csname #1per#2Uf\endcsname} - {\sisetup{stickyper,per=fraction,fraction=frac}% - \renewcommand*{\si@frc@hook}{\textstyle}% - #3\si@per#4}% - \expandafter\newunit\expandafter{\csname #1per#2UF\endcsname} - {\sisetup{stickyper,per=fraction,fraction=frac}% - \renewcommand*{\si@frc@hook}{\displaystyle}% - #3\si@per#4}} -\requiresiconfigs{SIunits,addn,astro} -\sisetup{obeyall} -\ifsi@old@spaceqspace - \sisetup{valuesep=space} -\fi -\newunit{\paminute}{'} -\newunit{\parsecond}{''} -\newunit{\AstroE}{AE} -\newunit{\oersted}{OE} -\provideunit{\ton}{t} -\let\decaD\decad -\newcommand*{\ufrac}[2]{% - \si[stickyper,per=fraction,fraction=nice]{#1\si@per#2}} -\newcommand*{\Ufrac}[2]{% - \ensuremath{\textstyle{% - \si[stickyper,per=fraction,fraction=frac]{#1\si@per#2}}}} -\newcommand*{\UFrac}[2]{% - \ensuremath{\displaystyle{% - \si[stickyper,per=fraction,fraction=frac]{#1\si@per#2}}}} -\let\pow\power -\let\Squaremetre\squaremetre -\si@siu@newunit{Gray}{second} -\si@siu@newunit[square]{Squaremetre}{metre} -\si@siu@newunitx{Squaremetre}{newtonsecond}{\Square\metre} - {\newton\second} -\si@siu@newunit{Squaremetre}{second} -\si@siu@newunit[square]{Squaremetre}{squaresecond} -\si@siu@newunit{Squaremetre}{kilogram} -\si@siu@newunit[cubic]{Squaremetre}{second} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-fancyunits.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-geophys.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-geophys.cfg deleted file mode 100644 index 8b62aa11907..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-geophys.cfg +++ /dev/null @@ -1,42 +0,0 @@ -%% -%% This is file `si-geophys.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `geophys') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-geophys.cfg} - [2010/02/22 v1.4c siunitx: Units for astronomy] -\newunit{\gon}{gon} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-geophys.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg deleted file mode 100644 index 63c80359f3a..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg +++ /dev/null @@ -1,59 +0,0 @@ -%% -%% This is file `si-hep.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `hep') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-hep.cfg} - [2010/02/22 v1.4c siunitx: Units for high-energy physics] -\requiresiconfigs{prefix,named} -\provideunit{\micron}{\micro\metre} -\newunit{\mrad}{\milli\rad} -\newunit{\gauss}{G} -\newunit{\clight}{\ensuremath{\mathnormal{c}}} -\newunit{\eVperc}{\eV\per\clight} -\newunit{\nanobarn}{\nano\barn} -\newunit{\picobarn}{\pico\barn} -\newunit{\femtobarn}{\femto\barn} -\newunit{\attobarn}{\atto\barn} -\newunit{\zeptobarn}{\zepto\barn} -\newunit{\yoctobarn}{\yocto\barn} -\provideunit{\nb}{\nano\barn} -\provideunit{\pb}{\pico\barn} -\provideunit{\fb}{\femto\barn} -\provideunit{\ab}{\atto\barn} -\provideunit{\zb}{\zepto\barn} -\provideunit{\yb}{\yocto\barn} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-hep.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg deleted file mode 100644 index b6aa8527901..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg +++ /dev/null @@ -1,92 +0,0 @@ -%% -%% This is file `si-hepunits.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `hepunits') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-hepunits.cfg} - [2010/02/22 v1.4c siunitx: Emulation of - hepunits] -\si@emulating{hepunits}{2007/09/27} -\requiresiconfigs{SIunits,accepted,prefix,hep} -\ifsi@old@noprefixcmds\else - \newunit{\invbarn}{\per\barn} - \newunit{\invnanobarn}{\per\nano\barn} - \newunit{\invpicobarn}{\per\pico\barn} - \newunit{\invfemtobarn}{\per\femto\barn} - \newunit{\invattobarn}{\per\atto\barn} - \newunit{\invzeptobarn}{\per\zepto\barn} - \newunit{\invyoctobarn}{\per\yocto\barn} - \newunit{\invnb}{\per\nano\barn} - \newunit{\invpb}{\per\pico\barn} - \newunit{\invfb}{\per\femto\barn} - \newunit{\invab}{\per\atto\barn} - \newunit{\invzb}{\per\zepto\barn} - \newunit{\invyb}{\per\yocto\barn} -\fi -\newunit{\invcmsqpersecond}{\per\Square\centi\metre\per\second} -\newunit{\invcmsqpersec}{\per\Square\centi\metre\per\second} -\newunit{\lumiunits}{\per\Square\centi\metre\per\second} -\newunit{\inveV}{\per\electronvolt} -\newunit{\minveV}{\per\milli\electronvolt} -\newunit{\kinveV}{\per\kilo\electronvolt} -\newunit{\MinveV}{\per\mega\electronvolt} -\newunit{\GinveV}{\per\giga\electronvolt} -\newunit{\TinveV}{\per\tera\electronvolt} -\newunit[per=slash,eVcorrb=0.6ex]{\eVoverc} - {\electronvolt\per\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\eVovercsq} - {\electronvolt\per\Square\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\meVoverc} - {\milli\electronvolt\per\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\keVoverc} - {\kilo\electronvolt\per\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\MeVoverc} - {\mega\electronvolt\per\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\GeVoverc} - {\giga\electronvolt\per\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\TeVoverc} - {\tera\electronvolt\per\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\meVovercsq} - {\milli\electronvolt\per\Square\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\keVovercsq} - {\kilo\electronvolt\per\Square\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\MeVovercsq} - {\mega\electronvolt\per\Square\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\GeVovercsq} - {\giga\electronvolt\per\Square\clight} -\newunit[per=slash,eVcorrb=0.6ex]{\TeVovercsq} - {\tera\electronvolt\per\Square\clight} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-hepunits.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg deleted file mode 100644 index 0469bfd3144..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg +++ /dev/null @@ -1,77 +0,0 @@ -%% -%% This is file `si-named.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `named') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-named.cfg} - [2010/02/22 v1.4c siunitx: SI Named units] -\newunit{\becquerel}{Bq} -\newunit{\coulomb}{C} -\newunit{\farad}{F} -\newunit{\Gray}{Gy} -\newunit{\ggray}{Gy} -\newunit{\hertz}{Hz} -\newunit{\henry}{H} -\newunit{\joule}{J} -\newunit{\katal}{kat} -\newunit{\lumen}{lm} -\newunit{\lux}{lx} -\newunit{\newton}{N} -\ifsi@old@OHM - \newunit{\Ohm}{\si@sym@Omega} -\else - \ifsi@gensymb\else - \provideunit{\ohm}{\si@sym@Omega} - \fi -\fi -\newunit{\pascal}{Pa} -\newunit{\siemens}{S} -\newunit{\sievert}{Sv} -\newunit{\tesla}{T} -\newunit{\volt}{V} -\newunit{\watt}{W} -\newunit{\weber}{Wb} -\ifsi@old@OHM - \newunit{\Celsius}{\si@sym@celsius} -\else - \ifsi@gensymb\else - \newunit{\celsius}{\si@sym@celsius} - \fi -\fi -\newunit\degreeCelsius{\si@sym@celsius} -\newunit{\radian}{rad} -\newunit{\steradian}{sr} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-named.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg deleted file mode 100644 index 79da81cf1ad..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg +++ /dev/null @@ -1,47 +0,0 @@ -%% -%% This is file `si-physical.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `physical') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-physical.cfg} - [2010/02/22 v1.4c siunitx: SI Physically-measured units] -\newcommand*{\si@eVspacea}{\text{\kern-\si@eVcorra}}% -\newcommand*{\si@eVspaceb}{\text{\kern-\si@eVcorrb}}% -\newunit{\electronvolt}{e\protect\si@eVspacea V\protect% - \si@eVspaceb} -\newunit{\atomicmass}{u} -\newunit{\atomicmassunit}{u} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-physical.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg deleted file mode 100644 index b006a92d2b2..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg +++ /dev/null @@ -1,70 +0,0 @@ -%% -%% This is file `si-prefix.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `prefix') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-prefix.cfg} - [2010/02/22 v1.4c siunitx: SI Multiple prefixes] -\newprefix{\yocto}{-24}{y} -\newprefix{\zepto}{-21}{z} -\newprefix{\atto}{-18}{a} -\newprefix{\femto}{-15}{f} -\newprefix{\pico}{-12}{p} -\newprefix{\nano}{-9}{n} -\ifsi@old@OHM - \newprefix{\Micro}{-6}{\si@sym@mu} -\else - \ifsi@gensymb\else - \newprefix{\micro}{-6}{\si@sym@mu} - \fi -\fi -\newprefix{\milli}{-3}{m} -\newprefix{\centi}{-2}{c} -\newprefix{\deci}{-1}{d} -\newprefix{\deca}{1}{da} -\newprefix{\hecto}{2}{h} -\newprefix{\kilo}{3}{k} -\newprefix{\mega}{6}{M} -\newprefix{\giga}{9}{G} -\newprefix{\tera}{12}{T} -\newprefix{\peta}{15}{P} -\newprefix{\exa}{18}{E} -\newprefix{\zetta}{21}{Z} -\newprefix{\yotta}{24}{Y} -\newprefix{\deka}{1}{da} -\newunit{\gram}{g} -\renewunit{\kilogram}{\kilo\gram} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-prefix.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg deleted file mode 100644 index a970a3ba2e5..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg +++ /dev/null @@ -1,126 +0,0 @@ -%% -%% This is file `si-prefixed.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `prefixed') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-prefixed.cfg} - [2010/02/22 v1.4c siunitx: SI Prefixed units] -\requiresiconfigs{prefix,named,accepted,physical} -\newunit{\picometre}{\pico\metre} -\newunit{\nanometre}{\nano\metre} -\newunit{\micrometre}{\micro\metre} -\newunit{\millimetre}{\milli\metre} -\newunit{\centimetre}{\centi\metre} -\newunit{\decimetre}{\deci\metre} -\newunit{\kilometre}{\kilo\metre} -\newunit{\femtogram}{\femto\gram} -\newunit{\picogram}{\pico\gram} -\newunit{\nanogram}{\nano\gram} -\newunit{\microgram}{\micro\gram} -\newunit{\milligram}{\milli\gram} -\newunit{\femtomole}{\femto\mole} -\newunit{\picomole}{\pico\mole} -\newunit{\nanomole}{\nano\mole} -\newunit{\micromole}{\micro\mole} -\newunit{\millimole}{\milli\mole} -\newunit{\kilomole}{\kilo\mole} -\newunit{\attosecond}{\atto\second} -\newunit{\femtosecond}{\femto\second} -\newunit{\picosecond}{\pico\second} -\newunit{\nanosecond}{\nano\second} -\newunit{\microsecond}{\micro\second} -\newunit{\millisecond}{\milli\second} -\newunit{\picoampere}{\pico\ampere} -\newunit{\nanoampere}{\nano\ampere} -\newunit{\microampere}{\micro\ampere} -\newunit{\milliampere}{\milli\ampere} -\newunit{\kiloampere}{\kilo\ampere} -\newunit{\millivolt}{\milli\volt} -\newunit{\kilovolt}{\kilo\volt} -\newunit{\milliwatt}{\milli\watt} -\newunit{\kilowatt}{\kilo\watt} -\newunit{\megawatt}{\mega\watt} -\newunit{\femtofarad}{\femto\farad} -\newunit{\picofarad}{\pico\farad} -\newunit{\nanofarad}{\nano\farad} -\newunit{\microfarad}{\micro\farad} -\newunit{\millifarad}{\milli\farad} -\newunit{\millisiemens}{\milli\siemens} -\ifsi@old@OHM - \newunit{\kilohm}{\kilo\Ohm} - \newunit{\megohm}{\mega\Ohm} - \newunit{\gigaohm}{\giga\Ohm} -\else - \ifsi@gensymb\else - \newunit{\kilohm}{\kilo\ohm} - \newunit{\megohm}{\mega\ohm} - \newunit{\gigaohm}{\giga\ohm} - \fi -\fi -\newunit{\microlitre}{\micro\litre} -\newunit{\millilitre}{\milli\litre} -\newunit{\microliter}{\micro\liter} -\newunit{\milliliter}{\milli\liter} -\newunit{\cubicmetre}{\metre\cubed} -\newunit{\cubiccentimetre}{\centi\metre\cubed} -\newunit{\centimetrecubed}{\centi\metre\cubed} -\newunit{\cubicmicrometre}{\micro\metre\cubed} -\newunit{\cubicmillimetre}{\milli\metre\cubed} -\newunit{\cubicdecimetre}{\cubic\deci\metre} -\newunit{\squaremetre}{\Square\metre} -\newunit{\squarecentimetre}{\Square\centi\metre} -\newunit{\centimetresquared}{\centi\metre\squared} -\newunit{\squarekilometre}{\Square\kilo\metre} -\newunit{\millijoule}{\milli\joule} -\newunit{\kilojoule}{\kilo\joule} -\newunit{\megajoule}{\mega\joule} -\newunit{\millielectronvolt}{\milli\electronvolt} -\newunit{\kiloelectronvolt}{\kilo\electronvolt} -\newunit{\megaelectronvolt}{\mega\electronvolt} -\newunit{\gigaelectronvolt}{\giga\electronvolt} -\newunit{\teraelectronvolt}{\tera\electronvolt} -\newunit[unitsep=none]{\kilowatthour}{\kilo\watt\hour} -\newunit{\millihertz}{\milli\hertz} -\newunit{\kilohertz}{\kilo\hertz} -\newunit{\megahertz}{\mega\hertz} -\newunit{\gigahertz}{\giga\hertz} -\newunit{\terahertz}{\tera\hertz} -\newunit{\millinewton}{\milli\newton} -\newunit{\kilonewton}{\kilo\newton} -\newunit{\hectopascal}{\hecto\pascal} -\newunit{\megabecquerel}{\mega\becquerel} -\newunit{\millisievert}{\milli\sievert} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-prefixed.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg deleted file mode 100644 index d7bee0542b3..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg +++ /dev/null @@ -1,108 +0,0 @@ -%% -%% This is file `si-sistyle.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `sistyle') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-sistyle.cfg} - [2010/02/22 v1.4c siunitx: Emulation of - SIstyle] -\si@emulating{sistyle}{2006/12/20 v2.3} -\sisetup{% - sepfour=true, - obeyfamily, - obeyitalic=true, - numsign=+-, - strictarc=false, - unitsep=cdot} -\newcommand*{\SIobeyboldtrue}{\sisetup{obeybold=true}} -\newcommand*{\SIobeyboldfalse}{\sisetup{obeybold=false}} -\let\num\relax -\si@newrobustcmd*{\num}{% - \@ifstar - {\si@sis@numstar} - {\si@sis@num}} -\newcommand*{\si@sis@num}[2][]{% - \begingroup% - \sisetup{#1}% - \expandafter\si@out@num\expandafter{\si@num{#2}}% - \endgroup} -\newcommand*{\si@sis@numstar}[2][]{% - \begingroup% - \sisetup{mode=text,obeybold}% - \sisetup{#1}% - \expandafter\si@out@num\expandafter{\si@num{#2}}% - \endgroup} -\newcommand*{\pnt}{\ensuremath{\si@decimalsymbol}} -\newcommand*{\SIgroupfourtrue}{\sisetup{sepfour=true}} -\newcommand*{\SIgroupfourfalse}{\sisetup{sepfour=false}} -\newcommand*{\SIunitsep}[1]{\sisetup{valuesep={#1}}} -\newcommand*{\SIunitspace}[1]{\sisetup{unitspace={#1}}} -\newcommand*{\SIunitdot}[1]{\sisetup{unitsep={#1}}} -\newcommand*{\SIdecimalsymbol}[1]{\sisetup{decimalsymbol={#1}}} -\newcommand*{\SIthousandsep}[1]{\sisetup{digitsep={#1}}} -\newcommand*{\SIproductsign}[1]{\sisetup{expproduct={#1}}} -\newcommand*{\SIdecimalsign}[1]{\sisetup{decimalsymbol={#1}}} -\newcommand*{\si@sis@savefont}[2]{% - \@namedef{si@sis@#1}{#2}% - \sisetup{#1=si@sis@#1}} -\newcommand*{\SImathrm}[1]{\si@sis@savefont{mathrm}{#1}} -\newcommand*{\SImathsf}[1]{\si@sis@savefont{mathsf}{#1}} -\newcommand*{\SImathtt}[1]{\si@sis@savefont{mathtt}{#1}} -\newcommand*{\SIdefaultMfam}[1]{\si@sis@savefont{mathrm}{#1}} -\newcommand*{\SIdefaultNfam}[1]{\si@sis@savefont{mathnumrm}{#1}} -\newcommand*{\SIdefaultTfam}[1]{\si@sis@savefont{textrm}{#1}} -\si@newrobustcmd*{\ensureupmath}[1]{% - \begingroup - \sisetup{mode=maths,obeyitalic=false}% - \si@out{#1}% - \endgroup} -\newcommand*{\degC}{\si@sym@celsius} -\newcommand*{\arcdeg}{\si@sym@degree} -\newcommand*{\degF}{\si@sym@degree F} -\newcommand*{\SIstyle}[1]{\sisetup{locale=#1}} -\newcommand*{\SIstyleToLang}[2]{\sisetup{loctolang=#1:#2}} -\newcommand*{\AddToSIstyle}{% - \si@switchfalse - \@ifstar - {\si@switchtrue - \si@sis@addtolocale} - {\si@sis@addtolocale}} -\newcommand*{\si@sis@addtolocale}[2]{% - \ifsi@switch - \expandafter\let\csname si@loc@#1@extra\endcsname\relax - \fi - \addtolocale{#1}{#2}} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-sistyle.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg deleted file mode 100644 index 293072a53ff..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg +++ /dev/null @@ -1,47 +0,0 @@ -%% -%% This is file `si-synchem.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `synchem') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-synchem.cfg} - [2010/02/22 v1.4c siunitx: Units for synthetic chemists] -\requiresiconfigs{prefix} -\newunit{\mmHg}{mmHg} -\newunit{\molar}{\mole\per\cubic\deci\metre} -\newunit{\Molar}{\textsc{m}} -\newunit{\torr}{Torr} -\newunit{\dalton}{Da} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-synchem.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg deleted file mode 100644 index f86e99ddd25..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg +++ /dev/null @@ -1,74 +0,0 @@ -%% -%% This is file `si-units.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `units') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\si@ifloaded{units}{\endinput}{} -\ProvidesFile{si-units.cfg} - [2010/02/22 v1.4c siunitx: Emulation of units] -\si@emulating{units}{1998/08/04 v0.9b} -\si@ifloaded{SIunits} - {\si@emclash{units}{SIunits}\endinput}{} -\si@ifloaded{sistyle} - {\si@emclash{units}{sistyle}\endinput}{} -\sisetup{per=fraction,fraction=nice,obeybold,inlinebold=maths, - ,obeymode} -\ifsi@old@tight - \sisetup{valuesep=thin} -\fi -\ifsi@old@loose - \sisetup{valuesep=space} -\fi -\ifsi@old@ugly - \sisetup{fraction=ugly} -\fi -\si@newrobustcmd*{\unit}[2][]{% - \ifmmode - \SI{#1}{#2}% - \else - \SI[obeyfamily,obeyitalic]{#1}{#2}% - \fi} -\si@newrobustcmd*{\unitfrac}[3][]{% - \begingroup - \si@fam@mode% - \ifmmode\else - \sisetup{obeyfamily,obeyitalic}% - \fi - \si@ifnotmtarg{#1} - {\num{#1}\ensuremath{\si@valuesep}}% - \si@frac{#2}{#3} - \endgroup} -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-units.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg deleted file mode 100644 index eba83cb0606..00000000000 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg +++ /dev/null @@ -1,254 +0,0 @@ -%% -%% This is file `si-unitsdef.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% siunitx.dtx (with options: `unitsdef') -%% --------------------------------------------------------------- -%% 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 -%% --------------------------------------------------------------- -%% -\ProvidesFile{si-unitsdef.cfg} - [2010/02/22 v1.4c siunitx: - Emulation of unitsdef] -\si@emulating{unitsdef}{2005/01/04 v0.2} -\si@ifloaded{SIunits} - {\si@emclash{unitsdef}{SIunits}\endinput}{} -\si@ifloaded{sistyle} - {\si@emclash{unitsdef}{sistyle}\endinput}{} -\requiresiconfigs{units} -\RequirePackage{textcomp} -\RequirePackage[T1]{fontenc} -\sisetup{mode=text,allowoptarg,prespace} -\ifsi@old@noxspace - \sisetup{xspace=false} -\fi -\ifsi@old@noabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@nofrequncyabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@nomolabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@novoltageabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@novolumeabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@noweightabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@noenergyabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@nolengthabbr - \sisetup{noload=abbr} -\fi -\ifsi@old@notimeabbr - \sisetup{noload=abbr} -\fi -\newcommand*{\unitvaluesep}{\,} -\renewcommand*{\si@valuesep}{\text{\unitvaluesep}} -\define@choicekey*+[si]{key}{valuesep}[\si@tempa] - {space,thin,med,medium,thick,none} - {\renewcommand*\unitvaluesep\@nameuse{si@fix@##1}% - \si@log@debug{Option valuesep set to ##1}} - {\si@log@debug{Option valuesep set to ##1}% - \renewcommand*\unitvaluesep{##1}} -\let\unitsignonly\si -\si@newrobustcmd*{\ilu}[2][]{% - \begingroup - #1\unitvaluesep% - \unit{#2}% - \endgroup} -\let\arc\ang -\newcommand*{\unitSIdef}{\upshape} -\newcommand*{\si@unitSIdef}{\unitSIdef\selectfont} -\sisetup{textrm=si@unitSIdef} -\let\per\relax -\si@newrobustcmd*{\per}[2]{% - \begingroup - \si@xspacefalse - \renewcommand*{\unitvaluesep}{}% - \unitfrac{#1}{#2}% - \endgroup} -\newcommand*{\unittimes}{\ensuremath{\cdot}} -\newcommand*{\unitsep}{\,} -\renewcommand*{\si@unt@unithook}{\si@unt@litouttrue} -\sisetup{unitsep=none} -\newcommand*{\unitsuperscript}{\tothe} -\newcommand*{\newnosepunit}{\newunit[valuesep=none]} -\newcommand*{\renewnosepunit}{\renewunit[valuesep=none]} -\newcommand*{\setTextOmega}[2]{% - \renewcommand*{\si@textOmega}{% - \begingroup - \edef\si@tempa{\sfdefault}% - \ifx\f@family\si@tempa - \expandafter#2% - \else - \expandafter#1% - \fi - \endgroup}} -\newcommand*{\setMathOmega}[1]{\sisetup{mathsOmega=#1}} -\newcommand*{\setTextmu}[2]{% - \renewcommand*{\si@textmu}{% - \begingroup - \edef\si@tempa{\sfdefault}% - \ifx\f@family\si@tempa - \expandafter#2% - \else - \expandafter#1% - \fi - \endgroup}} -\newcommand*{\setMathmu}[1]{\sisetup{mathsmu=#1}} -\newcommand*{\setTextCelsius}[2]{% - \renewcommand*{\si@textcelsius}{% - \begingroup - \edef\si@tempa{\sfdefault}% - \ifx\f@family\si@tempa - \expandafter#2% - \else - \expandafter#1% - \fi - \endgroup}} -\newcommand*{\setMathCelsius}[1]{\sisetup{mathscelsius=#1}} -\newcommand*{\setMathDegree}[2]{% - \renewcommand*{\si@textdegree}{% - \begingroup% - \edef\si@tempa{\sfdefault}% - \ifx\f@family\si@tempa - \expandafter#2% - \else - \expandafter#1% - \fi - \endgroup}} -\newcommand*{\setTextDegree}[1]{\sisetup{textdegree=#1}} -\ifsi@old@OHM - \ifsi@old@ohm - \si@log@inf{Both `ohm' and `OHM' options given\MessageBreak - Using default behaviour for unitsdef} - \expandafter\expandafter\expandafter\si@old@OHMfalse - \fi -\fi -\ifsi@old@liter - \ifsi@old@LITER - \si@log@inf{Both `liter' and `LITER' options - given\MessageBreak Using default behaviour for unitsdef} - \else - \renewunit{\liter}{l} - \fi -\fi -\newunit{\ton}{t} -\newunit{\days}{d} -\newunit{\picometer}{\pico\meter} -\newunit{\nanometer}{\nano\meter} -\newunit{\micrometer}{\micro\meter} -\newunit{\millimeter}{\milli\meter} -\newunit{\centimeter}{\centi\meter} -\newunit{\decimeter}{\deci\meter} -\newunit{\kilometer}{\kilo\meter} -\newunit{\femtoliter}{\femto\liter} -\newunit{\picoliter}{\pico\liter} -\newunit{\nanoliter}{\nano\liter} -\newunit{\microliter}{\micro\liter} -\newunit{\milliliter}{\milli\liter} -\newunit{\centiliter}{\centi\liter} -\newunit{\deciliter}{\deci\liter} -\newunit{\hectoliter}{\hecto\liter} -\newunit{\cubicmeter}{\meter\cubed} -\newunit{\cubicmicrometer}{\micro\meter\cubed} -\newunit{\cubicmillimeter}{\milli\meter\cubed} -\newunit{\squaremeter}{\Square\meter} -\newunit{\squarecentimeter}{\Square\centi\meter} -\newunit{\squarekilometer}{\Square\kilo\meter} -\newunit{\ar}{a} -\newunit{\hectar}{\hecto\ar} -\ifsi@old@noabbr -\else - \ifsi@old@novoltageabbr\else - \newunit{\kv}{\kilo\volt} - \newunit{\mv}{\milli\volt} - \fi -\fi -\ifsi@old@noabbr\else - \ifsi@old@notimeabbr\else - \newunit{\sek}{\second} - \fi - \ifsi@old@noweightabbr\else - \newunit{\fg}{\femto\gram} - \fi - \ifsi@old@novolumeabbr\else - \newunit{\fl}{\femto\liter} - \newunit{\pl}{\pico\liter} - \newunit{\nl}{\nano\liter} - \newunit{\micl}{\micro\liter} - \newunit{\ml}{\milli\liter} - \newunit{\cl}{\centi\liter} - \newunit{\dl}{\deci\liter} - \newunit{\hl}{\hecto\liter} - \fi -\fi -\newunit{\calory}{cal} -\newunit{\kilocalory}{\kilo\calory} -\newunit{\uBar}{ba} -\catcode`\-=11\relax -\ifsi@old@redef-gensymb - \expandafter\si@gensymbtrue -\fi -\catcode`\-=12\relax -\ifsi@gensymb - \RequirePackage{gensymb} - \AtBeginDocument{ - \let\gensymbohm\ohm - \let\gensymbcelsius\celsius - \let\gensymbmicro\micro - \let\gensymbdegree\degree - \let\ohm\@undefined - \let\celsius\@undefined - \let\micro\@undefined - \let\degree\@undefined - \ifsi@old@OHM\else - \newunit{\ohm}{\si@sym@Omega} - \newunit{\celsius}{\si@sym@celsius} - \newprefix{\micro}{\si@sym@mu}{-6} - \newunit{\degree}{\si@sym@degree} - \fi} -\fi -\requiresiconfigs{prefix,named,addn,accepted} -\ifsi@old@noconfig\else - \InputIfFileExists{unitsdef.cfg} - {\si@log@inf{unitsdef config file loaded}} - {\si@log@inf{unitsdef config file not found}} -\fi -%% -%% Copyright (C) 2008-2010 by -%% Joseph Wright -%% -%% It may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License (LPPL), either version 1.3c of -%% this license or (at your option) any later version. The latest -%% version of this license is in the file: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work is "maintained" (as per LPPL maintenance status) by -%% Joseph Wright. -%% -%% This work consists of the file siunitx.dtx -%% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. -%% -%% -%% End of file `si-unitsdef.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg new file mode 100644 index 00000000000..d4d787aeb34 --- /dev/null +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg @@ -0,0 +1,92 @@ +%% +%% This is file `siunitx-abbreviations.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% siunitx.dtx (with options: `config,abbreviations') +%% --------------------------------------------------------------- +%% 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 +%% --------------------------------------------------------------- +%% +\ProvidesExplFile {siunitx-abbreviations.cfg} {2010/05/23} {2.0} + {siunitx: Abbreviated units} +\DeclareSIUnit \pA { \pico \ampere } +\DeclareSIUnit \nA { \nano \ampere } +\DeclareSIUnit \uA { \micro \ampere } +\DeclareSIUnit \mA { \milli \ampere } +\DeclareSIUnit \kA { \kilo \ampere } +\DeclareSIUnit \Hz { \hertz } +\DeclareSIUnit \mHz { \milli \hertz } +\DeclareSIUnit \kHz { \kilo \hertz } +\DeclareSIUnit \MHz { \mega \hertz } +\DeclareSIUnit \GHz { \giga \hertz } +\DeclareSIUnit \THz { \tera \hertz } +\DeclareSIUnit \fmol { \femto \mole } +\DeclareSIUnit \pmol { \pico \mole } +\DeclareSIUnit \nmol { \nano \mole } +\DeclareSIUnit \umol { \micro \mole } +\DeclareSIUnit \mmol { \milli \mole } +\DeclareSIUnit \kmol { \kilo \mole } +\DeclareSIUnit \mV { \milli \volt } +\DeclareSIUnit \kV { \kilo \volt } +\DeclareSIUnit \ml { \milli \litre } +\DeclareSIUnit \ul { \micro \litre } +\DeclareSIUnit \mL { \milli \liter } +\DeclareSIUnit \uL { \micro \liter } +\DeclareSIUnit \fg { \femto \gram } +\DeclareSIUnit \pg { \pico \gram } +\DeclareSIUnit \ng { \nano \gram } +\DeclareSIUnit \ug { \micro \gram } +\DeclareSIUnit \mg { \milli \gram } +\DeclareSIUnit \g { \gram } +\DeclareSIUnit \kg { \kilo \gram } +\DeclareSIUnit \amu { \atomicmassunit } +\DeclareSIUnit \kJ { \kilo \joule } +\DeclareSIUnit \eV { \electronvolt } +\DeclareSIUnit \meV { \milli \electronvolt } +\DeclareSIUnit \keV { \kilo \electronvolt } +\DeclareSIUnit \MeV { \mega \electronvolt } +\DeclareSIUnit \GeV { \giga \electronvolt } +\DeclareSIUnit \TeV { \tera \electronvolt } +\DeclareSIUnitWithOptions \kWh { \kilo \watt \hour } + { inter-unit-separator = } +\DeclareSIUnit \nm { \nano \metre } +\DeclareSIUnit \pm { \pico \metre } +\DeclareSIUnit \um { \micro \metre } +\DeclareSIUnit \mm { \milli \metre } +\DeclareSIUnit \cm { \centi \metre } +\DeclareSIUnit \dm { \deci \metre } +\DeclareSIUnit \km { \kilo \metre } +\DeclareSIUnit \s { \second } +\DeclareSIUnit \as { \atto \second } +\DeclareSIUnit \fs { \femto \second } +\DeclareSIUnit \ps { \pico \second } +\DeclareSIUnit \ns { \nano \second } +\DeclareSIUnit \us { \micro \second } +\DeclareSIUnit \ms { \milli \second } +%% +%% Copyright (C) 2008-2010 by +%% Joseph Wright +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Joseph Wright. +%% +%% This work consists of the file siunitx.dtx +%% and the derived files siunitx.pdf, +%% siunitx.sty and +%% siunitx.ins. +%% +%% +%% End of file `siunitx-abbreviations.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg new file mode 100644 index 00000000000..32707c3458b --- /dev/null +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg @@ -0,0 +1,48 @@ +%% +%% This is file `siunitx-binary.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% siunitx.dtx (with options: `config,binary') +%% --------------------------------------------------------------- +%% 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 +%% --------------------------------------------------------------- +%% +\ProvidesExplFile {siunitx-binary.cfg} {2010/05/23} {2.0} + {siunitx: Binary units} +\DeclareBinaryPrefix \kibi { Ki } { 10 } +\DeclareBinaryPrefix \mebi { Mi } { 20 } +\DeclareBinaryPrefix \gibi { Gi } { 30 } +\DeclareBinaryPrefix \tebi { Ti } { 40 } +\DeclareBinaryPrefix \pebi { Pi } { 50 } +\DeclareBinaryPrefix \exbi { Ei } { 60 } +\DeclareBinaryPrefix \zebi { Zi } { 70 } +\DeclareBinaryPrefix \yobi { Yi } { 80 } +\DeclareSIUnit \bit { bit } +\DeclareSIUnit \byte { B } +%% +%% Copyright (C) 2008-2010 by +%% Joseph Wright +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Joseph Wright. +%% +%% This work consists of the file siunitx.dtx +%% and the derived files siunitx.pdf, +%% siunitx.sty and +%% siunitx.ins. +%% +%% +%% End of file `siunitx-binary.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg new file mode 100644 index 00000000000..c7129987c98 --- /dev/null +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg @@ -0,0 +1,661 @@ +%% +%% This is file `siunitx-version-1.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% siunitx.dtx (with options: `config,version-1') +%% --------------------------------------------------------------- +%% 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 +%% --------------------------------------------------------------- +%% +\ProvidesExplFile {siunitx-version-1.cfg} {2010/05/23} {2.0} + {siunitx: Version 1 settings} +\keys_set:nn { siunitx } { load-configurations = abbreviations } +\keys_define:nn { siunitx } { + addsign .choice: , + addsign / + false .meta:n = { explicit-sign = }, + addsign / + true .meta:n = { explicit-sign = + }, + addsign .default:n = { true }, + allowlitunits .meta:n = { free-standing-units = #1 }, + allowlitunits .default:n = { true }, + allowoptarg .meta:n = { unit-optional-argument = #1 }, + allowoptargs .default:n = { true }, + allowzeroexp .meta:n = { retain-zero-exponent = #1 }, + allowzeroexp .default:n = { true }, + angelsep .choice: , + angelsep / + cdot .meta:n = + { arc-separator = { } \cdot { } }, + angelsep / + comma .meta:n = { arc-separator = { {,} } }, + angelsep / + fullstop .meta:n = { arc-separator = { { . } } }, + angelsep / + med .meta:n = { arc-separator = \: }, + angelsep / + medium .meta:n = { arc-separator = \: }, + angelsep / + none .meta:n = { arc-separator = }, + angelsep / + period .meta:n = { arc-separator = { { . } } }, + angelsep / + space .meta:n = { arc-separator = \text { ~ } }, + angelsep / + stop .meta:n = { arc-separator = { { . } } }, + angelsep / + thick .meta:n = { arc-separator = \; }, + angelsep / + thin .meta:n = { arc-separator = \, }, + angelsep / + tightcdot .meta:n = + { arc-separator = \bgroup \cdot \egroup }, + angelsep / + tighttimes .meta:n = + { arc-separator = \bgroup \times \egroup }, + angelsep / + times .meta:n = { arc-separator = \times }, + angelsep / + unknown .meta:n = { arc-separator = #1 }, + astroang .meta:n = + { angle-symbol-over-decimal = #1 }, + astroang .default:n = { true }, + closeerr .meta:n = { close-bracket = #1 }, + closefrac .meta:n = { close-bracket = #1 }, + closerange .meta:n = { close-bracket = #1 }, + colorall .code:n = , + colourall .code:n = , + colorneg .code:n = , + colourneg .code:n = , + colorunits .meta:n = , + colourunits .meta:n = , + colorvalues .meta:n = , + colourvalues .meta:n = , + decimalsymbol .choice: , + decimalsymbol / + cdot .meta:n = + { output-decimal-marker = { } \cdot { } }, + decimalsymbol + fullstop .meta:n = { output-decimal-marker = { { . } } }, + decimalsymbol / + period .meta:n = { output-decimal-marker = { { . } } }, + decimalsymbol / + stop .meta:n = { output-decimal-marker = { { . } } }, + decimalsymbol / + tightcdot .code:n = + { output-decimal-marker = \bgroup \cdot \egroup }, + decimalsymbol / + unknown .meta:n = { output-decimal-marker = #1 }, + debug .code:n = , + detectdisplay .meta:n = { detect-display-math = #1 }, + detectdisplay .default:n = { true }, + digitsep .choice: , + digitsep / + cdot .meta:n = + { group-separator = { } \cdot { } }, + digitsep / + comma .meta:n = { group-separator = { , } }, + digitsep / + fullstop .meta:n = { group-separator = . }, + digitsep / + med .meta:n = { group-separator = \: }, + digitsep / + medium .meta:n = { group-separator = \: }, + digitsep / + none .meta:n = { group-separator = }, + digitsep / + period .meta:n = { group-separator = . }, + digitsep / + space .meta:n = { group-separator = \text { ~ } }, + digitsep / + stop .meta:n = { group-separator = . }, + digitsep / + thick .meta:n = { group-separator = \; }, + digitsep / + thin .meta:n = { group-separator = \, }, + digitsep / + tightcdot .meta:n = + { group-separator = \bgroup \cdot \egroup }, + digitsep / + tighttimes .meta:n = + { group-separator = \bgroup \times \egroup }, + digitsep / + times .meta:n = { group-separator = \times }, + digitsep / + unknown .meta:n = { group-separator = #1 }, + dp .meta:n = + { + round-mode = places, + round-precision = #1, + }, + emulate .code:n = , + errspace .choice: , + errspace / + med .meta:n = { uncertainty-separator = \: }, + errspace / + medium .meta:n = { uncertainty-separator = \: }, + errspace / + none .meta:n = { uncertainty-separator = }, + errspace / + space .meta:n = { uncertainty-separator = \text { ~ } }, + errspace / + thick .meta:n = { uncertainty-separator = \; }, + errspace / + thin .meta:n = { uncertainty-separator = \, }, + errspace / + unknown .meta:n = { uncertainty-separator = #1 }, + eVcorra .code:n = , + eVcorrb .code:n = , + expbase .choice: , + expbase / + ten .meta:n = { exponent-base = 10 }, + expbase / + two .meta:n = { exponent-base = 2 }, + expbase / + unknown .meta:n = { exponent-base = #1 }, + expproduct / + cdot .meta:n = + { exponent-product = { } \cdot { } }, + expproduct / + tightcdot .meta:n = + { exponent-product = \bgroup \cdot \egroup }, + expproduct / + tighttimes .meta:n = + { exponent-product = \bgroup \times \egroup }, + expproduct / + times .meta:n = { exponent-product = \times }, + expproduct / + unknown .meta:n = { exponent-product = #1 }, + fixdp .choice:, + fixdp / + false .meta:n = { round-mode = none }, + fixdp / + true .meta:n = { round-mode = places }, + fixdp .default:n = { true }, + fixsf .choice: , + fixsf / + false .meta:n = { round-mode = none }, + fixsf / + true .meta:n = { round-mode = figures }, + fixsf .default:n = { true }, + fraction .choice: , + fraction / + frac .meta:n = { fraction-function = \frac }, + fraction / + nice .meta:n = { fraction-function = \frac }, + fraction / + sfrac .meta:n = { fraction-function = \sfrac }, + fraction / + ugly .meta:n = + { + fraction-function = \frac , + per-mode = symbol-or-fraction + }, + inlinebold .meta:n = { detect-inline-weight = #1 }, + log .code:n = , + load .code:n = , + mathOmega .meta:n = { math-ohm = #1 }, + mathcelsius .meta:n = { math-celsius = #1 }, + mathdegree .meta:n = { math-degree = #1 }, + mathminute .meta:n = { math-arcminute = #1 }, + mathmu .meta:n = { math-micro = #1 }, + mathringA .meta:n = { math-angstrom = #1 }, + mathrm .meta:x = + { math-rm = \exp_not:c {#1} }, + mathsOmega .meta:n = { math-ohm = #1 }, + mathscelsius .meta:n = { math-celsius . = #1 }, + mathsdegree .meta:n = { math-degree . = #1 }, + mathsecond .meta:n = { math-arcsecond = #1 }, + mathsf .meta:x = + { math-sf = \exp_not:c {#1} }, + mathsminute .meta:n = { math-arcminute = #1 }, + mathsmu .meta:n = { math-micro = #1 }, + mathsringA .meta:n = { math-angstrom = #1 }, + mathsrm .meta:x = + { math-rm = \exp_not:c {#1} }, + mathssecond .meta:n = { math-arcsecond = #1 }, + mathssf .meta:x = + { math-sf = \exp_not:c {#1} }, + mathstt .meta:x = + { math-tt = \exp_not:c {#1} }, + mathtt .meta:x = + { math-tt = \exp_not:c {#1} }, + negcolor .meta:n = { negative-color = #1 }, + negcolour .meta:n = { negative-color = #1 }, + noload .code:n = , + numaddn .meta:n = { input-symbols = #1 }, + numcloseerr .meta:n = { input-close-uncertainty = #1 }, + numdecimal .meta:n = { input-decimal-markers = #1 }, + numdigits .meta:n = { input-digits = #1 }, + numdiv .meta:n = { input-quotient = #1 }, + numexp .meta:n = { input-exponent-markers = #1 }, + numgobble .meta:n = { input-ignore = #1 }, + numopenerr .meta:n = { input-open-uncertainty = #1 }, + numprod .meta:n = { input-product = #1 }, + numsign .meta:n = { input-signs = #1 }, + obeyall .meta:n = { detect-all = #1 }, + obeyall .default:n = { true }, + obeybold .meta:n = { detect-weight = #1 }, + obeybold .default:n = { true }, + obeyitalic .meta:n = { detect-italic = #1 }, + opbeyitalic .default:n = { true }, + obeymode .meta:n = { detect-mode = #1 }, + obeymode .default:n = { true }, + openerr .meta:n = { open-bracket = #1 }, + openfrac .meta:n = { open-bracket = #1 }, + openrange .meta:n = { open-bracket = #1 }, + padangle .choice: , + padangle / + all .meta:n = + { + add-arc-degree-zero = true, + add-arc-minute-zero = true, + add-arc-second-zero = true + }, + both .meta:n = + { + add-arc-degree-zero = true, + add-arc-minute-zero = true, + add-arc-second-zero = true + }, + padangle / + false .meta:n = + { + add-arc-degree-zero = false, + add-arc-minute-zero = false, + add-arc-second-zero = false + }, + padangle / + large .meta:n = + { + add-arc-degree-zero = true, + add-arc-minute-zero = true, + add-arc-second-zero = false + }, + padangle / + none .meta:n = + { + add-arc-degree-zero = false, + add-arc-minute-zero = false, + add-arc-second-zero = false + }, + padangle / + small .meta:n = + { + add-arc-degree-zero = false, + add-arc-minute-zero = true, + add-arc-second-zero = true + }, + true .meta:n = + { + add-arc-degree-zero = true, + add-arc-minute-zero = true, + add-arc-second-zero = true + }, + padnumber .choice: , + padnumber / + all .meta:n = + { + add-decimal-zero = true, + add-integer-zero = true + }, + padnumber / + both .meta:n = + { + add-decimal-zero = true, + add-integer-zero = true + }, + padnumber / + false .meta:n = + { + add-decimal-zero = false, + add-integer-zero = false + }, + padnumber / + leading .meta:n = + { + add-decimal-zero = true, + add-integer-zero = false + }, + padnumber / + none .meta:n = + { + add-decimal-zero = false, + add-integer-zero = false + }, + padnumber / + trailing .meta:n = + { + add-decimal-zero = false, + add-integer-zero = true + }, + padnumber / + true .meta:n = + { + add-decimal-zero = true, + add-integer-zero = true + }, + per .choice: , + per / + fraction .meta:n = { per-mode = fraction }, + per / + reciprocal .meta:n = { per-mode = reciprocal }, + per / + slash .meta:n = { per-mode = symbol }, + prefixbase .code:n = , + prefixproduct .code:n = , + prefixsymbolic .meta:n = { prefixes-as-symbols = #1 }, + prefixsymbolic .default:n = { true }, + prespace .meta:n = { space-before-unit = #1 }, + prespace .default:n = { true }, + redefsymbols .meta:n = { redefine-symbols = #1 }, + redefsymbols .default:n = { true }, + repeatunits .choice: , + repeatunits / + false .meta:n = + { + multi-part-numbers = single, + product-units = single, + }, + repeatunits / + power .meta:n = + { + multi-part-numbers = repeat, + product-units = power, + }, + repeatunits / + true .meta:n = + { + multi-part-numbers = repeat, + product-units = repeat, + }, + repeatunits .default:n = { true }, + retainplus .meta:n = { retain-explicit-plus = #1 }, + retainplus .default:n = { true }, + seperr .meta:n = { separate-uncertainty = #1 }, + seperr .default:n = { true }, + sepfour .meta:n = { group-four-digits = true }, + sepfour .default:n = { true }, + sf .meta:n = + { + round-mode = figures, + round-precision = #1, + }, + sign .meta:n = { explicit-sign = #1 }, + slash .choice: , + slash / + slash .meta:n = { per-symbol = / }, + slash / + unknown .meta:n = { per symbol = #1 }, + stickyper .meta:n = { sticky-per = #1 }, + stickyper .default:n = { true }, + strictarc .code:n = , + tabalign .meta:n = + { + table-number-alignment = #1, + table-text-alignment = #1, + table-unit-alignment = #1 + }, + tabalignexp .code:n = , + tabautofit .meta:n = { table-auto-round = #1 }, + tabformat .meta:n = { table-format = #1 }, + tabnumalign .meta:n = { table-number-alignment = #1 }, + tabparseonly .meta:n = { table-parse-only = #1 }, + tabparseonly .default:n = { true }, + tabtextalign .meta:n = { table-text-numbers = #1 }, + tabunitalign .meta:n = { table-unit-alignment = #1 }, + textOmega .meta:n = { text-ohm = #1 }, + textcelsius .meta:n = { text-celsius = #1 }, + textdegree .meta:n = { text-degree = #1 }, + textminute .meta:n = { text-arcminute = #1 }, + textmode .choice: , + textmode / + true .meta:n = { mode = text }, + textmode / + false .meta:n = { mode = math }, + textmode .default:n = { true }, + textmu .meta:n = { text-micro = #1 }, + textringA .meta:n = { text-angstrom = #1 }, + textrm .meta:x = + { text-rm = \exp_not:c {#1} }, + textsecond .meta:n = { text-arcsecond = #1 }, + textsf .meta:x = + { text-sf = \exp_not:c {#1} }, + texttt .meta:x = + { text-tt = \exp_not:c {#1} }, + tightpm .meta:n = { tight-spacing = #1 }, + tightpm .default:n = { true }, + tophrase .meta:n = { range-phrase = #1 }, + trapambigerr .choice: , + trapambigerr + / false .meta:n = { multi-part-units = single }, + trapambigerr + / true .meta:n = { multi-part-units = brackets }, + trapambigerr .default:n = { true }, + trapambigfrac .meta:n = { bracket-numbers = #1 }, + trapambigfrac .default:n = { true }, + trapambigrange .choice: , + trapambigrange + / false .meta:n = { range-units = single }, + trapambigrange + / true .meta:n = { range-units = brackets }, + trapambigrange .default:n = { true }, + unitcolor .meta:n = { unit-color = #1 }, + unitcolour .meta:n = { unit-color = #1 }, + unitmathrm .meta:x = + { unit-math-rm = \exp_not:c {#1} }, + unitmathsf .meta:x = + { unit-math-sf = \exp_not:c {#1} }, + unitmathsrm .meta:x = + { unit-math-rm = \exp_not:c {#1} }, + unitmathssf .meta:x = + { unit-math-sf = \exp_not:c {#1} }, + unitmathstt .meta:x = + { unit-math-tt = \exp_not:c {#1} }, + unitmathtt .meta:x = + { unit-math-tt = \exp_not:c {#1} }, + unitmode .meta:n = { unit-mode = #1 }, + unitsep .choice: , + unitsep / + cdot .meta:n = + { inter-unit-separator = { } \cdot { } }, + unitsep / + comma .meta:n = { inter-unit-separator = { {,} } }, + unitsep / + fullstop .meta:n = { inter-unit-separator = { { . } } }, + unitsep / + med .meta:n = { inter-unit-separator = \: }, + unitsep / + medium .meta:n = { inter-unit-separator = \: }, + unitsep / + none .meta:n = { inter-unit-separator = }, + unitsep / + period .meta:n = { inter-unit-separator = { { . } } }, + unitsep / + space .meta:n = { inter-unit-separator = \text { ~ } }, + unitsep / + stop .meta:n = { inter-unit-separator = { { . } } }, + unitsep / + thick .meta:n = { inter-unit-separator = \; }, + unitsep / + thin .meta:n = { inter-unit-separator = \, }, + unitsep / + tightcdot .meta:n = + { inter-unit-separator = \bgroup \cdot \egroup }, + unitsep / + tighttimes .meta:n = + { inter-unit-separator = \bgroup \times \egroup }, + unitsep / + times .meta:n = { inter-unit-separator = \times }, + unitsep / + unknown .meta:n = { inter-unit-separator = #1 }, + unitspace .choice: , + unitspace / + med .meta:n = { inter-unit-separator = \: }, + unitspace / + medium .meta:n = { inter-unit-separator = \: }, + unitspace / + none .meta:n = { inter-unit-separator = }, + unitspace / + space .meta:n = { inter-unit-separator = \text { ~ } }, + unitspace / + thick .meta:n = { inter-unit-separator = \; }, + unitspace / + thin .meta:n = { inter-unit-separator = \, }, + unitspace / + unknown .meta:n = { inter-unit-separator = #1 }, + valuecolor .meta:n = { number-color = #1 }, + valuecolour .meta:n = { number-color = #1 }, + valuemathrm .meta:x = + { number-math-rm = \exp_not:c {#1} }, + valuemathsf .meta:x = + { number-math-sf = \exp_not:c {#1} }, + valuemathsrm .meta:x = + { number-math-rm = \exp_not:c {#1} }, + valuemathssf .meta:x = + { number-math-sf = \exp_not:c {#1} }, + valuemathstt .meta:x = + { number-math-tt = \exp_not:c {#1} }, + valuemathtt .meta:x = + { number-math-tt = \exp_not:c {#1} }, + valuemode .meta:n = { number-mode = #1 }, + valuesep .choice: , + valuesep / + cdot .meta:n = + { unit-value-separator = { } \cdot { } }, + valuesep / + comma .meta:n = { unit-value-separator = { {,} } }, + valuesep / + fullstop .meta:n = { unit-value-separator = { { . } } }, + valuesep / + med .meta:n = { unit-value-separator = \: }, + valuesep / + medium .meta:n = { unit-value-separator = \: }, + valuesep / + none .meta:n = { unit-value-separator = }, + valuesep / + period .meta:n = { unit-value-separator = { { . } } }, + valuesep / + space .meta:n = { unit-value-separator = \text { ~ } }, + valuesep / + stop .meta:n = { unit-value-separator = { { . } } }, + valuesep / + thick .meta:n = { unit-value-separator = \; }, + valuesep / + thin .meta:n = { unit-value-separator = \, }, + valuesep / + tightcdot .meta:n = + { unit-value-separator = \bgroup \cdot \egroup }, + valuesep / + tighttimes .meta:n = + { unit-value-separator = \bgroup \times \egroup }, + valuesep / + times .meta:n = { unit-value-separator = \times }, + valuesep / + unknown .meta:n = { unit-value-separator = #1 }, + xspace .meta:n = { use-xspace = #1 }, + xpace .default:n = { true } +} +\cs_set_eq:NN \newunit \DeclareSIUnit +\cs_set_eq:NN \renewunit \DeclareSIUnit +\cs_set_eq:NN \provideunit \DeclareSIUnit +\NewDocumentCommand \newpower { o m m } { + \IfNoValueTF {#1} + { \DeclareSIPrePower #2 {#3} } + { \DeclareSIPostPower #2 {#3} } +} +\NewDocumentCommand \renewpower { o m m } { + \IfNoValueTF {#1} + { \DeclareSIPrePower #2 {#3} } + { \DeclareSIPostPower #2 {#3} } +} +\NewDocumentCommand \providepower { o m m } { + \IfNoValueTF {#1} + { \DeclareSIPrePower #2 {#3} } + { \DeclareSIPostPower #2 {#3} } +} +\NewDocumentCommand \newprefix { o m m m } { + \IfNoValueTF {#1} + { \DeclareSIPrefix #2 {#3} {#4} } + { \DeclareBinaryPrefix #2 {#3} {#4} } +} +\NewDocumentCommand \renewprefix { o m m m } { + \IfNoValueTF {#1} + { \DeclareSIPrefix #2 {#3} {#4} } + { \DeclareBinaryPrefix #2 {#3} {#4} } +} +\NewDocumentCommand \provideprefix { o m m m } { + \IfNoValueTF {#1} + { \DeclareSIPrefix #2 {#3} {#4} } + { \DeclareBinaryPrefix #2 {#3} {#4} } +} +\cs_set_eq:NN \newqualifier \DeclareSIQualifier +\cs_set_eq:NN \renewqualifier \DeclareSIQualifier +\cs_set_eq:NN \providequalifier \DeclareSIQualifier +\DeclareSIPrePower \Square { 2 } +\DeclareSIPrePower \ssquare { 2 } +\DeclareSIUnit \BAR { \bar } +\DeclareSIUnit \bbar { \bar } +\DeclareSIUnit \Day { \day } +\DeclareSIUnit \dday { \day } +\DeclareSIUnit \Gray { \gray } +\DeclareSIUnit \ggray { \gray } +\DeclareSIUnit \atomicmass { \atomicmassunit } +\DeclareSIUnit \arcmin { \arcminute } +\DeclareSIUnit \arcsec { \arcsecond } +\DeclareSIUnit \are { a } +\DeclareSIUnit \curie { Ci } +\DeclareSIUnit \gal { Gal } +\DeclareSIUnit \millibar { \milli \bar } +\DeclareSIUnit \rad { rad } +\DeclareSIUnit \rem { rem } +\DeclareSIUnit \roentgen { R } +\DeclareSIUnit \micA { \micro \ampere } +\DeclareSIUnit \micmol { \micro \mole } +\DeclareSIUnit \micl { \micro \litre } +\DeclareSIUnit \micL { \micro \liter } +\DeclareSIUnit \nanog { \nano \gram } +\DeclareSIUnit \micg { \micro \gram } +\DeclareSIUnit \picm { \pico \metre } +\DeclareSIUnit \micm { \micro \metre } +\DeclareSIUnit \Sec { \second } +\DeclareSIUnit \mics { \micro \second } +\DeclareSIUnit \cmc { \centi \metre \cubed } +\DeclareSIUnit \dmc { \deci \metre \cubed } +\DeclareSIUnit \cms { \centi \metre \squared } +\DeclareSIUnit \parsec { pc } +\DeclareSIUnit \lightyear { ly } +\DeclareSIUnit \gmol { g \text { - } mol } +\DeclareSIUnit \kgmol { kg \text { - } mol } +\DeclareSIUnit \lbmol { lb \text { - } mol } +\DeclareSIUnit \molar { \mole \per \cubic \deci \metre } +\DeclareSIUnit \Molar { \textsc { m } } +\DeclareSIUnit \torr { Torr } +\DeclareSIUnit \gon { gon } +%% +%% Copyright (C) 2008-2010 by +%% Joseph Wright +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Joseph Wright. +%% +%% This work consists of the file siunitx.dtx +%% and the derived files siunitx.pdf, +%% siunitx.sty and +%% siunitx.ins. +%% +%% +%% End of file `siunitx-version-1.cfg'. diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 90b94d7132f..a407b5d22b6 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -13,3961 +13,5743 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{siunitx} - [2010/02/22 v1.4c A comprehensive (SI) units package] -\begingroup - \@ifundefined{eTeXversion} - {\PackageError{siunitx} - {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} -\edef\si@catcodes{% - \catcode\string`\string ` \the\catcode\string`\`\relax - \catcode\string`\string = \the\catcode\string`\=\relax - \catcode\string`\string ^ \the\catcode\string`\^\relax - \catcode\string`\string _ \the\catcode\string`\_\relax - \catcode\string`\string ~ \the\catcode\string`\~\relax - \catcode\string`\string : \the\catcode\string`\:\relax - \catcode\string`\string - \the\catcode\string`\-\relax - \catcode\string`\string + \the\catcode\string`\+\relax - \catcode\string`\string ; \the\catcode\string`\;\relax - \catcode\string`\string , \the\catcode\string`\,\relax - \catcode\string`\string . \the\catcode\string`\.\relax} -\catcode\string`\` 12\relax -\catcode`\= 12\relax -\catcode`\^ 7\relax -\catcode`\_ 8\relax -\catcode`\~ \active\relax -\@makeother{\:} -\@makeother{\-} -\@makeother{\+} -\@makeother{\;} -\@makeother{\,} -\@makeother{\.} -\RequirePackage{xkeyval}[2005/05/07] -\RequirePackage{amstext,array,xspace} -\newcommand*{\si@tempa}{} -\newcommand*{\si@tempb}{} -\newcommand*{\si@tempc}{} -\newif\ifsi@switch -\newbox\si@tempboxa -\newbox\si@tempboxb -\newbox\si@tempboxc -\newbox\si@tempboxd -\newtoks{\si@temptoks} -\newcommand*{\si@blockpkgs}{SIunits,sistyle,siunits,SIstyle,% - unitsdef,fancyunits} -\newcommand*{\si@checkpkgs}{units,hepunits,fancynum} -\newcommand*{\si@packagecheck}{% - \begingroup - \@for\si@tempa:=\si@blockpkgs\do{ - \@ifpackageloaded{\si@tempa} - {\PackageError{siunitx} - {Package `\si@tempa' incompatible} - {The \si@tempa\space package and siunitx are - incompatible.\MessageBreak Use the - `emulate=\si@tempa' package option when loading - siunitx}} - {}} - \@for\si@tempa:=\si@checkpkgs\do{% - \@ifpackageloaded{\si@tempa} - {\PackageWarning{siunitx} - {Consider loading the siunitx package - with\MessageBreak option `emulate=\si@tempa', rather - than\MessageBreak loading both \si@tempa\space and - siunitx}} - {}} - \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} -\newcommand*{\si@addtocsname}[2]{% - \@ifundefined{#1} - {\expandafter\gdef\csname #1\endcsname{#2}} - {\si@temptoks\expandafter\expandafter\expandafter{% - \csname #1\endcsname#2}% - \expandafter\xdef\csname #1\endcsname{\the\si@temptoks}}} -\begingroup - \catcode`\Q=3 - \long\gdef\si@ifmtarg#1{% - \si@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil} - \long\gdef\si@xifmtarg#1#2Q#3#4#5\@nil{#4} - \long\gdef\si@ifnotmtarg#1{% - \si@xifmtarg#1QQ\@firstofone\@gobble\@nil} -\endgroup -\@ifpackageloaded{etoolbox} - {\let\si@newrobustcmd\newrobustcmd} - {\protected\def\si@newrobustcmd{% - \@ifstar - {\let\l@ngrel@x\protected\si@newcommand} - {\def\l@ngrel@x{\protected\long}\si@newcommand}} - \newcommand*{\si@newcommand}[1]{\@testopt{\si@newcmd#1}0} - \def\si@newcmd#1[#2]{% - \@ifnextchar[%] - {\si@xargdef#1[#2]} - {\@argdef#1[#2]}} - \long\def\si@xargdef#1[#2][#3]#4{% - \@ifdefinable#1{% - \expandafter\protected - \expandafter\def - \expandafter#1% - \expandafter{% - \expandafter\@testopt - \csname\string#1\endcsname{#3}}% - \expandafter\@yargdef - \csname\string#1\endcsname\tw@{#2}{#4}}}} -\newif\ifsi@debug -\newif\ifsi@logmin -\newif\ifsi@lognone -\newcommand*{\si@log@err}[2]{% - \ifsi@lognone\else - \ifsi@logmin - \PackageWarning{siunitx}{#1}% - \else - \PackageError{siunitx}{#1}{#2}% - \fi - \fi} -\newcommand*{\si@log@warn}[1]{% - \ifsi@lognone\else - \ifsi@logmin\else - \PackageWarning{siunitx}{#1}% - \fi - \fi} -\newcommand*{\si@log@inf}[1]{% - \ifsi@lognone\else - \ifsi@logmin\else - \PackageInfo{siunitx}{#1}% - \fi - \fi} -\newcommand*{\si@log@debug}[1]{% - \ifsi@lognone\else - \ifsi@debug - \PackageInfo{siunitx}{#1}% - \fi - \fi} -\newcommand*{\si@str@ifchrstr}[2]{% - \begingroup - \si@switchfalse - \renewcommand*{\si@tempa}{#1}% - \protected@edef\si@tempb{#2}% - \expandafter\si@str@chrstr\si@tempb\@empty\@empty\@empty - \ifsi@switch - \aftergroup\@firstoftwo - \else - \aftergroup\@secondoftwo - \fi - \endgroup} -\def\si@str@chrstr#1#2\@empty{% - \renewcommand*{\si@tempc}{#1}% - \ifx\si@tempa\si@tempc - \expandafter\si@switchtrue - \else - \ifx\@empty#2\@empty\else - \si@str@chrstr#2\@empty\@empty - \fi - \fi} -\newcommand*{\si@str@ifonlychrs}[2]{% - \begingroup - \si@switchtrue - \protected@edef\si@tempa{#1}% - \renewcommand*{\si@tempb}{#2}% - \expandafter\si@str@onlychrs\si@tempa\@empty\@empty\@empty - \ifsi@switch - \aftergroup\@firstoftwo - \else - \aftergroup\@secondoftwo - \fi - \endgroup} -\def\si@str@onlychrs#1#2\@empty{% - \si@str@ifchrstr{#1}{\si@tempb} - {}{\si@switchfalse}% - \ifx\@empty#2\@empty\else - \si@str@onlychrs#2\@empty\@empty - \fi} -\newcommand*{\sisetup}{\setkeys[si]{key}} -\newcommand*{\si@opt@key}[2]{% - \define@key[si]{key}{#1} - {#2\si@log@debug{Option #1 set to ##1}}} -\newcommand*{\si@opt@cmdkey}[3][]{% - \define@cmdkey[si]{key}[si@]{#2}[#1]{#3}} -\newcommand*{\si@opt@cmdkeys}[2][]{% - \define@cmdkeys[si]{key}[si@]{#2}[#1]} -\newcommand*{\si@opt@boolkey}[2][]{% - \define@boolkey[si]{key}[si@]{#2}[true] - {#1\si@log@debug{Option #2 set to ##1}}} -\newcommand*{\si@opt@choicekey}[4][]{% - \define@choicekey*+[si]{key}{#2}[\si@tempa]{#3}[#1] - {#4\si@log@debug{Option #2 set to ##1}} - {\si@log@warn{Unknown value `##1' for option #2}}} -\newcommand*{\si@opt@xchoicekey}[3]{% - \define@choicekey*+[si]{key}{#1}[\si@tempa]{#2}[#1] - {\si@log@debug{Option #1 set to ##1}% - \expandafter\renewcommand\expandafter*\expandafter{% - \csname si@#1\endcsname}{\@nameuse{si@fix@##1}}} - {\si@log@debug{Option #1 set to ##1}% - \expandafter\renewcommand\expandafter*\expandafter{% - \csname si@#1\endcsname}{##1}} - \expandafter\newcommand\expandafter*\expandafter{% - \csname si@#1\endcsname}% - {\@nameuse{si@fix@#3}}} -\newcommand*{\si@opt@compatkey}[2]{% - \define@boolkey[si]{key}[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 siunitx package}}} -\newcommand*{\si@opt@disablekey}[2]{% - \key@ifundefined[si]{key}{#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@opt@boolkey{debug} -\si@opt@boolkey[% - \ifsi@strict - \sisetup{ - obeymode=false, - obeybold=false, - obeyitalic=false, - mode=maths, - repeatunits=true, - trapambigerr=true, - trapambigfrac=true, - trapambigrange=true} - \@for\si@tempa:=obeyall,obeymode,obeyitalic,mode,unitmode,% - valuemode,textmode,obeybold,repeatunits,trapambigerr,% - trapambigfrac,trapambigrange\do{% - \begingroup - \edef\si@tempb{\endgroup - \noexpand\si@opt@disablekey{\si@tempa} - {Option `\si@tempa' forbidden in strict mode}}% - \si@tempb} - \fi]{strict} -\AtEndOfPackage{ - \si@opt@disablekey{strict} - {Option `strict' only available when\MessageBreak - loading package}} -\newcommand*{\si@emulate}{} -\si@opt@key{emulate}{\si@addtolist{\si@emulate}{#1}} -\AtEndOfPackage{ - \si@opt@disablekey{emulate} - {Option `emulate' only available when\MessageBreak - loading package}} -\si@opt@xchoicekey{unitsep} - {space,thin,med,medium,thick,none,comma,stop,fullstop,period, - times,tighttimes,cdot,tightcdot}{thin} -\si@opt@xchoicekey{unitspace}{space,thin,med,medium,thick, - none}{thin} -\si@opt@xchoicekey{errspace}{space,thin,med,medium,thick, - none}{none} -\si@opt@xchoicekey{valuesep} - {space,thin,med,medium,thick,none,comma,stop,fullstop,period, - times,tighttimes,cdot,tightcdot}{thin} -\si@opt@xchoicekey{digitsep} - {space,thin,med,medium,thick,none,comma,stop,fullstop,period, - times,tighttimes,cdot,tightcdot}{thin} -\si@opt@xchoicekey{decimalsymbol}{comma,stop,fullstop,period, - cdot,tightcdot}{fullstop} -\si@opt@xchoicekey{anglesep} - {space,thin,med,medium,thick,none,comma,stop,fullstop,period, - times,tighttimes,cdot,tightcdot}{none} -\si@opt@boolkey{obeymode} -\newif\ifsi@numtextmode -\newif\ifsi@unittextmode -\si@opt@choicekey[true]{textmode}{true,false} - {\si@numtextmodefalse - \si@unittextmodefalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@numtextmodetrue - \si@unittextmodetrue - \fi} -\si@opt@choicekey{mode}{math,maths,text} - {\si@numtextmodefalse - \si@unittextmodefalse - \renewcommand*{\si@tempb}{text}% - \ifx\si@tempa\si@tempb - \si@numtextmodetrue - \si@unittextmodetrue - \fi} -\si@opt@choicekey{valuemode}{math,maths,text} - {\si@numtextmodefalse - \renewcommand*{\si@tempb}{text}% - \ifx\si@tempa\si@tempb - \si@numtextmodetrue - \fi} -\si@opt@choicekey{unitmode}{math,maths,text} - {\si@unittextmodefalse - \renewcommand*{\si@tempb}{text}% - \ifx\si@tempa\si@tempb - \si@unittextmodetrue - \fi} -\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@opt@boolkey{obeyitalic} -\si@opt@boolkey{detectdisplay} -\si@opt@choicekey[true]{obeyall}{true,false} - {\si@obeyboldfalse - \si@obeyitalicfalse - \si@obeymodefalse - \si@obeyfamilyfalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@obeyboldtrue - \si@obeyitalictrue - \si@obeymodetrue - \si@obeyfamilytrue - \fi} -\si@opt@cmdkeys{valuemathsrm,valuemathssf,valuemathstt} -\si@opt@cmdkeys{unitmathsrm,unitmathssf,unitmathstt} -\si@opt@key{valuemathrm}{\sisetup{valuemathsrm=#1}} -\si@opt@key{valuemathsf}{\sisetup{valuemathssf=#1}} -\si@opt@key{valuemathtt}{\sisetup{valuemathstt=#1}} -\si@opt@key{unitmathrm}{\sisetup{unitmathsrm=#1}} -\si@opt@key{unitmathsf}{\sisetup{unitmathssf=#1}} -\si@opt@key{unitmathtt}{\sisetup{unitmathstt=#1}} -\si@opt@key{mathsrm}{\sisetup{valuemathsrm=#1,unitmathsrm=#1}} -\si@opt@key{mathssf}{\sisetup{valuemathssf=#1,unitmathssf=#1}} -\si@opt@key{mathstt}{\sisetup{valuemathstt=#1,unitmathstt=#1}} -\si@opt@key{mathrm}{\sisetup{valuemathsrm=#1,unitmathsrm=#1}} -\si@opt@key{mathsf}{\sisetup{valuemathssf=#1,unitmathssf=#1}} -\si@opt@key{mathtt}{\sisetup{valuemathstt=#1,unitmathstt=#1}} -\si@opt@cmdkeys{valuetextrm,valuetextsf,valuetexttt} -\si@opt@cmdkeys{unittextrm,unittextsf,unittexttt} -\si@opt@key{textrm}{\sisetup{unittextrm=#1,valuetextrm=#1}} -\si@opt@key{textsf}{\sisetup{unittextsf=#1,valuetextsf=#1}} -\si@opt@key{texttt}{\sisetup{unittexttt=#1,valuetexttt=#1}} -\si@opt@cmdkeys{numdigits,numdecimal,numexp,numgobble,numsign,% - numcloseerr,numopenerr,numaddn,numprod,numdiv} -\newcommand*{\si@numextra}{% - \si@numopenerr\si@numcloseerr\si@numaddn} -\newcommand*{\si@numvalid}{\si@numgobble\si@numexp\si@numsign - \si@numdecimal\si@numdigits\si@numextra\si@numprod\si@numdiv} -\si@opt@boolkey{seperr} -\si@opt@boolkey{trapambigerr} -\si@opt@cmdkeys{openerr,closeerr} -\si@opt@boolkey{sepfour} -\si@opt@boolkey{retainplus} -\si@opt@xchoicekey{expproduct}{times,tighttimes, - cdot,tightcdot}{times} -\si@opt@xchoicekey{expbase}{ten}{ten} -\si@opt@boolkey{allowzeroexp} -\si@opt@xchoicekey{prefixproduct}{times,tighttimes,cdot, - tightcdot,none}{times} -\si@opt@xchoicekey{prefixbase}{ten,two}{ten} -\si@opt@boolkey{prefixsymbolic} -\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} -\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@opt@boolkey{tightpm} -\newcommand*{\si@pm}{% - \ifsi@tightpm - \si@fix@tightpm - \else - \si@fix@pm - \fi} -\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} -\newif\ifsi@ang@toarc -\newif\ifsi@ang@todec -\si@opt@choicekey[all]{angformat} - {dec,decimal,arc,dms,unchanged,none} - {\si@ang@toarcfalse - \si@ang@todecfalse - \renewcommand*{\si@tempb}{dec}% - \ifx\si@tempa\si@tempb - \si@ang@todectrue - \fi - \renewcommand*{\si@tempb}{decimal}% - \ifx\si@tempa\si@tempb - \si@ang@todectrue - \fi - \renewcommand*{\si@tempb}{arc}% - \ifx\si@tempa\si@tempb - \si@ang@toarctrue - \fi - \renewcommand*{\si@tempb}{dms}% - \ifx\si@tempa\si@tempb - \si@ang@toarctrue - \fi} -\si@opt@boolkey{astroang} -\si@opt@boolkey{strictarc} -\newif\ifsi@tab@fixed -\si@opt@boolkey{tabparseonly} -\si@opt@choicekey{tabnumalign} - {centredecimal,centerdecimal,right,left,centre,center} - {\si@tab@fixedtrue - \def\si@tab@rfill@S{0.5}% - \def\si@tab@lfill@S{0.5}% - \renewcommand*{\si@tempb}{right}% - \ifx\si@tempa\si@tempb - \def\si@tab@rfill@S{0}% - \def\si@tab@lfill@S{1}% - \fi - \renewcommand*{\si@tempb}{left}% - \ifx\si@tempa\si@tempb - \def\si@tab@rfill@S{1}% - \def\si@tab@lfill@S{0}% - \fi - \renewcommand*{\si@tempb}{centredecimal}% - \ifx\si@tempa\si@tempb - \expandafter\si@tab@fixedfalse - \fi - \renewcommand*{\si@tempb}{centerdecimal}% - \ifx\si@tempa\si@tempb - \expandafter\si@tab@fixedfalse - \fi} -\si@opt@key{tabalign}{\sisetup{tabnumalign=#1,tabtextalign=#1, - tabunitalign=#1}} -\si@opt@boolkey{tabalignexp} -\si@opt@boolkey[% - \si@tabalignexpfalse - \ifsi@tabexpalign - \expandafter\si@tabalignexptrue - \fi - ]{tabexpalign} -\newcount\si@tab@mantprecnt -\newcount\si@tab@mantpostcnt -\newcount\si@tab@expprecnt -\newcount\si@tab@exppostcnt -\newif\ifsi@tab@mantsign -\newif\ifsi@tab@expsign -\si@opt@cmdkey{tabformat} - {\si@num@fixpm - \renewcommand*{\si@num@arg}{tabformat data}% - \renewcommand*{\si@num@exp}{}% - \renewcommand*{\si@num@mant}{}% - \si@tab@mantsignfalse - \si@tab@expsignfalse - \si@switchfalse - \si@num@sepmantexp{#1}% - \si@num@sepsign{mant}% - \ifx\@empty\si@num@mantsign\@empty - \ifsi@num@delplus - \expandafter\expandafter\expandafter\si@tab@mantsigntrue - \fi - \else - \expandafter\si@tab@mantsigntrue - \fi - \si@num@sepsign{exp}% - \ifx\@empty\si@num@expsign\@empty - \ifsi@num@delplus - \expandafter\expandafter\expandafter\si@tab@expsigntrue - \fi - \else - \expandafter\si@tab@expsigntrue - \fi - \si@opt@proctform{mant}% - \si@opt@proctform{exp}% - \ifnum\si@tab@mantpostcnt=\z@\relax - \ifnum\si@tab@mantprecnt=\z@\relax - \si@log@err{Empty mantissa argument for tabformat} - {The argument `#1' contains no valid entry for - a mantissa\MessageBreak It should be of the - form `m.n', where m and n are integers}% - \fi - \fi - \ifsi@tab@fixed\else - \sisetup{tabnumalign=centre}% - \fi - \let\pm\si@num@pm - \let\mp\si@num@mp} -\newcommand*{\si@opt@proctform}[1]{% - \renewcommand*{\si@num@predec}{}% - \renewcommand*{\si@num@postdec}{}% - \si@switchfalse - \expandafter\si@ifnotmtarg\expandafter{% - \csname si@num@#1\endcsname} - {\expandafter\expandafter\expandafter\si@num@digits - \csname si@num@#1\endcsname\@empty\@empty}% - \csname si@tab@#1precnt\endcsname\z@\relax - \csname si@tab@#1postcnt\endcsname\z@\relax - \ifx\@empty\si@num@predec\@empty\else - \csname si@tab@#1precnt\endcsname\si@num@predec\relax - \fi - \ifx\@empty\si@num@postdec\@empty\else - \csname si@tab@#1postcnt\endcsname\si@num@postdec\relax - \fi} -\si@opt@choicekey{tabtextalign}{left,right,centre,center} - {\def\si@tab@rfill@t{0.5}% - \def\si@tab@lfill@t{0.5}% - \renewcommand*{\si@tempb}{right}% - \ifx\si@tempa\si@tempb - \def\si@tab@rfill@t{0}% - \def\si@tab@lfill@t{1}% - \fi - \renewcommand*{\si@tempb}{left}% - \ifx\si@tempa\si@tempb - \def\si@tab@rfill@t{1}% - \def\si@tab@lfill@t{0}% - \fi} -\si@opt@choicekey{tabunitalign}{left,right,centre,center} - {\def\si@tab@rfill@s{0.5}% - \def\si@tab@lfill@s{0.5}% - \renewcommand*{\si@tempb}{right}% - \ifx\si@tempa\si@tempb - \def\si@tab@rfill@s{0}% - \def\si@tab@lfill@s{1}% - \fi - \renewcommand*{\si@tempb}{left}% - \ifx\si@tempa\si@tempb - \def\si@tab@rfill@s{1}% - \def\si@tab@lfill@s{0}% - \fi} -\si@opt@boolkey[% - \ifsi@fixdp - \expandafter\si@fixsffalse - \fi]{fixdp} -\newcount\si@num@dp -\si@opt@key{dp}{% - \si@str@ifonlychrs{#1}{0123456789} - {\si@num@dp#1\relax - \si@fixdptrue - \si@fixsffalse} - {\si@log@err{Invalid input for dp option} - {The dp option must be given a positive integer}}} -\si@opt@boolkey[% - \ifsi@fixsf - \expandafter\si@fixdpfalse - \fi]{fixsf} -\newcount\si@num@sf -\si@opt@key{sf}{% - \si@str@ifonlychrs{#1}{0123456789} - {\si@num@sf#1\relax - \ifnum\si@num@sf=\z@\relax - \si@log@warn{Setting sf=0 disables function}% - \si@fixsffalse - \else - \si@fixsftrue - \si@fixdpfalse - \fi} - {\si@log@err{Invalid input for sf option} - {The sf option must be given a positive integer}}} -\si@opt@boolkey{tabautofit} -\si@opt@boolkey{xspace} -\si@opt@boolkey - [\si@unt@numfalse - \ifsi@prespace - \si@unt@numtrue - \fi] - {prespace} -\si@opt@boolkey{allowoptarg} -\si@opt@boolkey{allowlitunits} -\newif\ifsi@slash -\newif\ifsi@frac -\si@opt@boolkey{stickyper} -\si@opt@choicekey[reciprocal]{per} - {reciprocal,rp,power,slash,frac,fraction} - {\si@slashfalse - \si@fracfalse - \let\si@frac\si@frc@frac - \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@opt@xchoicekey{slash}{slash}{slash} -\newif\ifsi@repeatunits -\newif\ifsi@addunitpower -\si@opt@choicekey[true]{repeatunits}{true,false,power} - {\si@repeatunitsfalse - \si@addunitpowerfalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@repeatunitstrue - \fi - \renewcommand*{\si@tempb}{power}% - \ifx\si@tempa\si@tempb - \si@addunitpowertrue - \fi} -\si@opt@boolkey{trapambigfrac} -\si@opt@cmdkeys{closefrac,openfrac} -\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@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 package} - \si@opt@disablekey{noload} - {Configuration files can only be used\MessageBreak - when loading package}} -\AtEndOfPackage{ - \si@opt@key{alsoload}{% - \@for\si@tempa:=#1\do{\si@loadfile{\si@tempa}}}} -\si@opt@boolkey{colourunits} -\si@opt@boolkey{colourvalues} -\si@opt@choicekey[true]{colorunits} - {true,false} - {\si@colourunitsfalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@colourunitstrue - \fi} -\si@opt@choicekey[true]{colorvalues} - {true,false} - {\si@colourvaluesfalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@colourvaluestrue - \fi} -\si@opt@choicekey[true]{colorall} - {true,false} - {\si@colourvaluesfalse - \si@colourunitsfalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@colourunitstrue - \si@colourvaluestrue - \fi} -\si@opt@choicekey[true]{colourall} - {true,false} - {\si@colourvaluesfalse - \si@colourunitsfalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@colourunitstrue - \si@colourvaluestrue - \fi} -\si@opt@cmdkeys{unitcolour,valuecolour} -\si@opt@key{unitcolor}{\sisetup{unitcolour=#1}} -\si@opt@key{valuecolor}{\sisetup{valuecolour=#1}} -\si@opt@key{colour}{\sisetup{unitcolour=#1,valuecolour=#1}} -\si@opt@key{color}{\sisetup{unitcolour=#1,valuecolour=#1}} -\si@opt@boolkey{colourneg} -\si@opt@choicekey[true]{colorneg} - {true,false} - {\si@colournegfalse - \renewcommand*{\si@tempb}{true}% - \ifx\si@tempa\si@tempb - \si@colournegtrue - \fi} -\si@opt@cmdkeys{negcolour} -\si@opt@key{negcolor}{\sisetup{negcolour=#1}} -\si@opt@cmdkeys{textOmega,mathsOmega} -\si@opt@key{mathOmega}{\sisetup{mathsOmega=#1}} -\newcommand*{\si@mathsOmega}{\text{\ensuremath{\si@upOmega}}} -\newcommand*{\si@textOmega}{\ensuremath{\si@upOmega}} -\newcommand*\si@upOmega{} -\AtBeginDocument{ - \ifdefined\upOmega - \let\si@upOmega\upOmega - \else - \let\si@upOmega\Omega - \fi -} -\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} -\def\si@mathsmu{\text{\si@textmu}} -\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\kern-\scriptspace C} -\newcommand*{\si@mathscelsius}{% - \si@mathsdegree\kern-\scriptspace 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 siunitx}} -\newlength\si@eVcorra -\newlength\si@eVcorrb -\si@opt@key{eVcorra}{\setlength\si@eVcorra{#1}} -\si@opt@key{eVcorrb}{\setlength\si@eVcorrb{#1}} -\si@opt@xchoicekey{tophrase}{to,dots,ndash,dash}{to} -\si@opt@boolkey{trapambigrange} -\si@opt@cmdkeys{openrange,closerange} -\si@opt@key{locale}{% - \si@loc@load{#1}% - \si@loc@set{#1}}% -\si@opt@key{loctolang}{\si@loc@ltol{#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} -\si@opt@compatkey{hepunits}{noprefixcmds} -\si@opt@compatkey{fancynum}{english} -\si@opt@compatkey{fancynum}{french} -\si@opt@compatkey{fancynum}{tight} -\si@opt@compatkey{fancynum}{loose} -\si@opt@compatkey{fancynum}{thinspaces} -\si@opt@compatkey{fancynum}{commas} -\si@opt@compatkey{fancynum}{plain} -\si@opt@compatkey{fancyunits}{spaceqspace} -\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@tighttimes}{\bgroup\times\egroup} -\newcommand*{\si@fix@tightcdot}{\bgroup\cdot\egroup} -\newcommand*{\si@fix@plus}{+} -\newcommand*{\si@fix@minus}{-} -\newcommand*{\si@fix@pm}{\pm} -\newcommand*{\si@fix@tightpm}{\bgroup\pm\egroup} -\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@fix@to}{ to } -\newcommand*{\si@fix@dash}{--} -\newcommand*{\si@fix@dots}{\,\dots\,} -\newcommand*{\si@symbol}[1]{% - \expandafter\protected\expandafter\def - \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}}% - \renewcommand*{\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@mathsOmega}{\Upomega}}{} - \fi} -\newcommand*{\si@frc@frac}[2]{% - \ensuremath{\si@frc@hook\frac{% - \expandafter\si@unt@out\expandafter{#1}}% - {\expandafter\si@unt@out\expandafter{#2}}}} -\let\si@frac\si@frc@frac -\newcommand*{\si@frc@hook}{} -\newcommand*{\si@frc@slash}[2]{% - \expandafter\si@unt@out\expandafter{#1}% - \si@out{\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\relax/\mkern-1mu\relax - \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@\relax - \selectfont{M}}% - \addtolength{\si@frc@textlen}{-\si@frc@ssuplen}% - \raisebox{\si@frc@textlen}{\fontsize\sf@size\z@\relax - \selectfont{#1}}% - \hspace{-0.25ex}/\hspace{-0.25ex}% - \hbox{\fontsize\sf@size\z@\selectfont{#2}}% - \endgroup} -\newcommand*{\si@frc@ugly}[1]{% - \renewcommand*{\si@tempa}{#1}% - \ifmmode - \expandafter\si@frc@frac - \else - \renewcommand*{\si@tempb}{1}% - \ifx\si@tempa\si@tempb - \setbox\si@tempboxa=\hbox{\ensuremath{\si@valuesep}}% - \hskip-\wd\si@tempboxa\relax - \renewcommand*{\si@tempa}{}% - \fi - \expandafter\si@frc@slash - \fi - {\si@tempa}} -\g@addto@macro{\document}{% - \ifdefined\mathsf - \setbox\si@tempboxa=\hbox{% - $\mathsf{\global\chardef\si@fam@sf=\fam}$}% - \else - \si@log@inf{\string\mathsf not found}% - \global\chardef\si@fam@sf=99\relax - \fi - \ifdefined\mathtt - \setbox\si@tempboxa=\hbox{% - $\mathtt{\global\chardef\si@fam@tt=\fam}$}% - \else - \si@log@inf{\string\mathtt not found}% - \global\chardef\si@fam@tt=99\relax - \fi} -\newcommand*\si@fam@detect@default{% - \edef\si@tempa{\familydefault}% - \edef\si@tempb{\sfdefault}% - \ifx\si@tempa\si@tempb - \@ifpackageloaded{cmbright}{}{\sisetup{ mathsrm = mathsf}}% - \sisetup{ textrm = sffamily }% - \fi - \edef\si@tempb{\ttdefault}% - \ifx\si@tempa\si@tempb - \sisetup +\RequirePackage{expl3} +\ProvidesExplPackage {siunitx} {2010/05/23} {2.0} + {A comprehensive (SI) units package} +\msg_set:nnnn { siunitx } { incompatible-package } + { Package~'#1'~incompatible. } + { The~#1~package~and~siunitx~are~incompatible. } +\cs_set_protected_nopar:Npn \_siunitx_load_check:n #1 { + \group_begin: + \@ifpackageloaded {#1} + { \msg_error:nnx { siunitx } { incompatible-package } {#1} } + { } + \group_end: +} +\clist_map_function:nN + { SIunits , sistyle , siunits , SIstyle , unitsdef , fancyunits } + \_siunitx_load_check:n +\AtBeginDocument { + \clist_map_function:nN { SIunits , sistyle , siunits , SIstyle } + \_siunitx_load_check:n +} +\RequirePackage{ amstext , array , l3keys2e } +\cs_set:Npn \_siunitx_tmp:w { } +\bool_new:N \_l_siunitx_tmp_bool +\box_new:N \_l_siunitx_tmp_box +\int_new:N \_l_siunitx_tmp_int +\tl_new:N \_l_siunitx_tmpa_tl +\tl_new:N \_l_siunitx_tmpb_tl +\bool_new:N \_l_siunitx_error_bool +\cs_set_protected:Npn \_siunitx_error:nxx #1#2#3 { + \bool_set_true:N \_l_siunitx_error_bool + \msg_error:nnxx { siunitx } {#1} {#2} {#3} +} +\cs_set_protected:Npn \_siunitx_error:nx #1#2 { + \_siunitx_error:nxx {#1} {#2} { } +} +\cs_set_protected:Npn \_siunitx_error:n #1 { + \_siunitx_error:nxx {#1} { } { } +} +\cs_generate_variant:Nn \_siunitx_error:nx { nV } +\AtBeginDocument { + \cs_if_free:cT { T@TS1 } + { + \DeclareFontEncoding { TS1 } { } { } + \DeclareFontSubstitution { TS1 } { cmr } { m } { n } + } +} +\DeclareTextSymbolDefault \_c_siunitx_minus_tl { TS1 } +\DeclareTextSymbol \_c_siunitx_minus_tl { TS1 } { 61 } +\DeclareTextSymbol \_c_siunitx_mu_tl { TS1 } { 181 } +\DeclareTextSymbolDefault \_c_siunitx_mu_tl { TS1 } +\tl_new:N \_c_siunitx_omega_tl +\tl_set:Nn \_c_siunitx_omega_tl { \Omega } +\AtBeginDocument { + \cs_if_exist:NT \upOmega + { \tl_set:Nn \_c_siunitx_omega_tl { \upOmega } } +} +\cs_set_protected:Npn \_siunitx_tl_put_left_math:Nn #1#2 { + \tl_put_left:Nn #1 { \_siunitx_ensuremath:n {#2} } +} +\cs_generate_variant:Nn \_siunitx_tl_put_left_math:Nn { NV } +\cs_generate_variant:Nn \_siunitx_tl_put_left_math:Nn { cV } +\cs_set_protected:Npn \_siunitx_tl_put_right_math:Nn #1#2 { + \tl_put_right:Nn #1 { \_siunitx_ensuremath:n {#2} } +} +\cs_generate_variant:Nn \_siunitx_tl_put_right_math:Nn { NV } +\cs_generate_variant:Nn \_siunitx_tl_put_right_math:Nn { cV } +\keys_define:nn { siunitx } { + unknown .code:n = + { + \msg_error:nnx { siunitx } { unknown-option } + { \exp_not:V \l_keys_key_tl } + } +} +\clist_new:N \_l_siunitx_option_deactivate_clist +\cs_set_protected_nopar:Npn \_siunitx_option_deactivate:n #1 { + \clist_put_right:Nn \_l_siunitx_option_deactivate_clist {#1} +} +\cs_set_protected_nopar:Npn \_siunitx_option_deactivate_aux:n #1 { + \keys_define:nn { siunitx } + { + #1 .code:n = + { \msg_warning:nnx { siunitx } { option-preamble-only } {#1} } + } +} +\AtBeginDocument { + \clist_map_function:NN \_l_siunitx_option_deactivate_clist + \_siunitx_option_deactivate_aux:n +} +\cs_generate_variant:Nn \prop_del:Nn { c } +\cs_generate_variant:Nn \prop_put:Nnn { cnV } +\cs_generate_variant:Nn \tl_replace_all_in:Nnn { NnV } +\group_begin: +\tl_map_inline:nn { \M \A \C \R \O } + { \char_make_other:n { `#1 } } +\tl_map_inline:nn { \F \N \T } + { \char_set_lccode:nn { `#1 } { `#1 } } +\tl_to_lowercase:n { + \group_end: + \prg_new_conditional:Nnn \_siunitx_cs_if_tl:N { T , TF } + { + \exp_after:wN \_siunitx_cs_if_tl_aux:w + \token_to_meaning:N #1 MACRO \q_nil + { + \cs_if_exist:cTF { \cs_to_str:N #1 ~ } + { \prg_return_false: } + { \prg_return_true: } + } + { \prg_return_false: } + } + \cs_set_nopar:Npn \_siunitx_cs_if_tl_aux:w #1 MACRO #2 \q_nil + { \tl_if_empty:nTF {#1} } + \prg_new_conditional:Nnn \_siunitx_cs_if_macro:N { T } + { + \exp_after:wN \_siunitx_cs_if_tl_aux:w + \token_to_meaning:N #1 MACRO \q_nil + { \prg_return_true: } + { \prg_return_false: } + } +} +\cs_set_eq:NN \_siunitx_ensuremath:n \ensuremath +\AtBeginDocument { + \@ifpackageloaded { tex4ht } + { + \cs_set_eq:NN \_siunitx_ensuremath:n \use:n + \keys_set:nn { siunitx } { mode = text } + } + { } +} +\cs_set_protected_nopar:Npn \_siunitx_set_math_fam:n #1 { + \int_new:c { _c_siunitx_math #1 _int } + \group_begin: + \hbox_set:Nn \_l_siunitx_tmp_box + { + \ensuremath + { + \use:c { math #1 } + { + \int_gset:cn { _c_siunitx_math #1 _int } { \fam } + } + } + } + \group_end: +} +\tl_put_right:Nn \document { + \_siunitx_set_math_fam:n { sf } + \_siunitx_set_math_fam:n { tt } +} +\cs_set_protected_nopar:Npn \_siunitx_set_text_fam:n #1 { + \tl_new:c { _c_siunitx_text #1 _tl } + \tl_set:cx { _c_siunitx_text #1 _tl } { \use:c { #1 default } } +} +\AtBeginDocument { + \_siunitx_set_text_fam:n { sf } + \_siunitx_set_text_fam:n { tt } +} +\tl_new:N \_l_siunitx_detect_inline_weight_tl +\keys_define:nn { siunitx } { + detect-all .choice:, + detect-all .default:n = true, + detect-all / false .meta:n = + { + detect-family = false, + detect-italic = false, + detect-mode = false, + detect-weight = false + }, + detect-all / true .meta:n = + { + detect-family = true, + detect-italic = true, + detect-mode = true, + detect-weight = true + }, + detect-display-math .bool_set:N = + \_l_siunitx_detect_display_math_bool, + detect-family .bool_set:N = \_l_siunitx_detect_family_bool, + detect-inline-weight .choice:, + detect-inline-weight .value_required:, + detect-inline-weight / + combined .code:n = + { \tl_set:Nn \_l_siunitx_detect_inline_weight_tl { combined } }, + detect-inline-weight / + math .code:n = + { \tl_set:Nn \_l_siunitx_detect_inline_weight_tl { math } }, + detect-inline-weight / + text .code:n = + { \tl_set:Nn \_l_siunitx_detect_inline_weight_tl { text } }, + detect-italic .bool_set:N = \_l_siunitx_detect_italic_bool, + detect-mode .bool_set:N = \_l_siunitx_detect_mode_bool, + detect-none .choice:, + detect-none .default:n = true, + detect-none / false .meta:n = + { + detect-family = true, + detect-italic = true, + detect-mode = true, + detect-weight = true + }, + detect-none / true .meta:n = + { + detect-family = false, + detect-italic = false, + detect-mode = false, + detect-weight = false + }, + detect-weight .bool_set:N = \_l_siunitx_detect_weight_bool +} +\bool_new:N \_l_siunitx_font_set_bool +\bool_new:N \_l_siunitx_font_math_mode_bool +\tl_new:N \_l_siunitx_font_family_tl +\cs_set_nopar:Npn \_siunitx_font_italic: { } +\cs_set_nopar:Npn \_siunitx_font_weight: { } +\cs_set_protected_nopar:Npn \_siunitx_detect_font: { + \bool_if:NF \_l_siunitx_font_set_bool + { + \_siunitx_detect_font_init: + \bool_if:NT \_l_siunitx_detect_weight_bool + { \_siunitx_detect_font_weight: } + \bool_if:NT \_l_siunitx_detect_family_bool + { \_siunitx_detect_font_family: } + \bool_if:NT \_l_siunitx_detect_italic_bool + { \_siunitx_detect_font_italic: } + \bool_if:NT \_l_siunitx_detect_mode_bool + { \_siunitx_detect_font_mode: } + } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_init: { + \bool_set_true:N \_l_siunitx_font_set_bool + \cs_set:Npn \_siunitx_font_weight: + { + \unboldmath + \mdseries + } + \cs_set:Npn \_siunitx_font_italic: { \upshape } + \tl_set:Nn \_l_siunitx_font_family_tl { rm } + \bool_set_true:N \_l_siunitx_font_math_mode_bool +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_weight: { + \mode_if_math:TF + { + \mode_if_inner:TF + { + \use:c + { + _siunitx_detect_font_weight_ + \_l_siunitx_detect_inline_weight_tl + : + } + } + { + \bool_if:NTF \_l_siunitx_detect_display_math_bool + { \_siunitx_detect_font_weight_math: } + { \_siunitx_detect_font_weight_text: } + } + } + { \_siunitx_detect_font_weight_text: } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_weight_combined: { + \_siunitx_detect_font_weight_math: + \_siunitx_detect_font_weight_text: +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_weight_math: { + \tl_if_eq:nVT { bold } \math@version + { + \cs_set:Npn \_siunitx_font_weight: + { + \boldmath + \bfseries + } + } + \tl_if_eq:nVT { light } \math@version + { + \cs_set:Npn \_siunitx_font_weight: + { \lseries } + } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_weight_text: { + \tl_set:Nx \_l_siunitx_tmpa_tl { \exp_args:NV \tl_head_i:n \f@series } + \tl_if_eq:nVT { b } \_l_siunitx_tmpa_tl + { + \cs_set:Npn \_siunitx_font_weight: + { + \boldmath + \bfseries + } + } + \tl_if_eq:nVT { l } \_l_siunitx_tmpa_tl + { + \cs_set:Npn \_siunitx_font_weight: + { \lseries } + } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_family: { + \_siunitx_detect_font_family_text: + \bool_if:NT \_l_siunitx_detect_display_math_bool + { + \mode_if_math:T + { \mode_if_inner:F { \_siunitx_detect_font_family_math: } } + } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_family_math: { + \tl_set:Nn \_l_siunitx_font_family_tl { rm } + \intexpr_compare:nNnT + { \int_use:N \fam } = { \int_use:N \_c_siunitx_mathsf_int } + { \tl_set:Nn \_l_siunitx_font_family_tl { sf } } + \intexpr_compare:nNnT + { \int_use:N \fam } = { \int_use:N \_c_siunitx_mathtt_int } + { \tl_set:Nn \_l_siunitx_font_family_tl { tt } } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_family_text: { + \tl_if_eq:NNT \f@family \_c_siunitx_textsf_tl + { \tl_set:Nn \_l_siunitx_font_family_tl { sf } } + \tl_if_eq:NNT \f@family \_c_siunitx_texttt_tl + { \tl_set:Nn \_l_siunitx_font_family_tl { tt } } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_italic: { + \tl_if_eq:nVT { it } \f@shape + { \cs_set_nopar:Npn \_siunitx_font_italic: { \itshape } } +} +\cs_set_protected_nopar:Npn \_siunitx_detect_font_mode: { + \mode_if_math:F + { \bool_set_false:N \_l_siunitx_font_math_mode_bool } +} +\bool_new:N \_l_siunitx_number_math_mode_bool +\bool_new:N \_l_siunitx_unit_math_mode_bool +\cs_set:Npn \_siunitx_number_mathrm:n #1 { } +\cs_set:Npn \_siunitx_number_mathsf:n #1 { } +\cs_set:Npn \_siunitx_number_mathtt:n #1 { } +\cs_set_nopar:Npn \_siunitx_number_textrm: { } +\cs_set_nopar:Npn \_siunitx_number_textsf: { } +\cs_set_nopar:Npn \_siunitx_number_texttt: { } +\keys_define:nn { siunitx } { + number-color .tl_set:N = \_l_siunitx_number_color_tl, + number-math-rm .code:n = + { \cs_set_nopar:Npn \_siunitx_number_mathrm:n ##1 { #1 {##1} } }, + number-math-sf .code:n = + { \cs_set_nopar:Npn \_siunitx_number_mathsf:n ##1 { #1 {##1} } }, + number-math-tt .code:n = + { \cs_set_nopar:Npn \_siunitx_number_mathtt:n ##1 { #1 {##1} } }, + number-mode .choice:, + number-mode / math .code:n = + { \bool_set_true:N \_l_siunitx_number_math_mode_bool }, + number-mode / text .code:n = + { \bool_set_false:N \_l_siunitx_number_math_mode_bool }, + number-text-rm .code:n = + { \cs_set_nopar:Npn \_siunitx_number_textrm: {#1} }, + number-text-sf .code:n = + { \cs_set_nopar:Npn \_siunitx_number_textsf: {#1} }, + number-text-tt .code:n = + { \cs_set_nopar:Npn \_siunitx_number_texttt: {#1} } +} +\cs_set_nopar:Npn \_siunitx_unit_mathrm: { } +\cs_set_nopar:Npn \_siunitx_unit_mathsf: { } +\cs_set_nopar:Npn \_siunitx_unit_mathtt: { } +\cs_set_nopar:Npn \_siunitx_unit_textrm: { } +\cs_set_nopar:Npn \_siunitx_unit_textsf: { } +\cs_set_nopar:Npn \_siunitx_unit_texttt: { } +\keys_define:nn { siunitx } { + unit-color .tl_set:N = \_l_siunitx_unit_color_tl, + unit-math-rm .code:n = + { \cs_set_nopar:Npn \_siunitx_unit_mathrm:n ##1 { #1 {##1} } }, + unit-math-sf .code:n = + { \cs_set_nopar:Npn \_siunitx_unit_mathsf:n ##1 { #1 {##1} } }, + unit-math-tt .code:n = + { \cs_set_nopar:Npn \_siunitx_unit_mathtt:n ##1 { #1 {##1} } }, + unit-mode .choice:, + unit-mode / math .code:n = + { \bool_set_true:N \_l_siunitx_unit_math_mode_bool }, + unit-mode / text .code:n = + { \bool_set_false:N \_l_siunitx_unit_math_mode_bool }, + unit-text-rm .code:n = + { \cs_set_nopar:Npn \_siunitx_unit_textrm: {#1} }, + unit-text-sf .code:n = + { \cs_set_nopar:Npn \_siunitx_unit_textsf: {#1} }, + unit-text-tt .code:n = + { \cs_set_nopar:Npn \_siunitx_unit_texttt: {#1} } +} +\keys_define:nn { siunitx } { + color .meta:n = + { + number-color = #1, + unit-color = #1 + }, + math-rm .meta:n = + { + number-math-rm = #1, + unit-math-rm = #1 + }, + math-sf .meta:n = + { + number-math-sf = #1, + unit-math-sf = #1 + }, + math-tt .meta:n = + { + number-math-tt = #1, + unit-math-tt = #1 + }, + mode .choice:, + mode / math .meta:n = + { + number-mode = math, + unit-mode = math + }, + mode / text .meta:n = + { + number-mode = text, + unit-mode = text + }, + text-rm .meta:n = + { + number-text-rm = #1, + unit-text-rm = #1 + }, + text-sf .meta:n = + { + number-text-sf = #1, + unit-text-sf = #1 + }, + text-tt .meta:n = + { + number-text-tt = #1, + unit-text-tt = #1 + } +} +\keys_set:nn { siunitx } { + math-rm = \mathrm, + math-sf = \mathsf, + math-tt = \mathtt, + number-mode = math, + text-rm = \rmfamily, + text-sf = \sffamily, + text-tt = \ttfamily, +} +\AtBeginDocument { + \tl_set:Nx \_l_siunitx_tmpa_tl { \familydefault } + \tl_if_eq:NNT \_l_siunitx_tmpa_tl \_c_siunitx_textsf_tl + { + \@ifpackageloaded { cmbright } { } + { \keys_set:nn { siunitx } { math-rm = \mathsf } } + \keys_set:nn { siunitx } { text-rm = \sffamily } + } + \tl_if_eq:NNT \_l_siunitx_tmpa_tl \_c_siunitx_texttt_tl + { + \keys_set:nn { siunitx } + { + math-rm = \mathtt, + text-rm = \ttfamily + } + } +} +\tl_new:N \_l_siunitx_print_arg_tl +\tl_new:N \_l_siunitx_print_type_tl +\cs_set_protected:Npn \_siunitx_print:nn #1#2 { + \group_begin: + \tl_set:Nn \_l_siunitx_print_type_tl {#1} + \tl_set:Nn \_l_siunitx_print_arg_tl {#2} + \_siunitx_detect_font: + \bool_if:NF \_l_siunitx_detect_mode_bool + { + \bool_if:cTF { _l_siunitx_ #1 _math_mode_bool } + { \bool_set_true:N \_l_siunitx_font_math_mode_bool } + { \bool_set_false:N \_l_siunitx_font_math_mode_bool } + } + \_siunitx_print_aux: + \group_end: +} +\cs_generate_variant:Nn \_siunitx_print:nn { nV } +\cs_set_protected_nopar:Npn \_siunitx_print_aux: { + \text + { + \_siunitx_print_color: + \_siunitx_font_weight: + \_siunitx_font_italic: + \use:c + { + _siunitx_ \_l_siunitx_print_type_tl _ + text \_l_siunitx_font_family_tl : + } + \bool_if:NTF \_l_siunitx_font_math_mode_bool + { \_siunitx_print_math: } + { \_siunitx_print_text: } + } +} +\cs_set_protected_nopar:Npn \_siunitx_print_color: { + \tl_if_empty:cF { _l_siunitx_ \_l_siunitx_print_type_tl _color_tl } + { + \color + { + \tl_use:c { _l_siunitx_ \_l_siunitx_print_type_tl _color_tl } + } + } +} +\AtBeginDocument { + \@ifpackageloaded { color } { } + { \cs_set_eq:NN \_siunitx_print_color: \scan_stop: } +} +\group_begin: + \char_set_lccode:nn { `\@ } { `\_ } + \char_make_math_subscript:N \@ + \char_set_lccode:nn { `\! } { `\_ } + \char_make_active:N \! +\tl_to_lowercase:n { + \group_end: + \cs_set_protected_nopar:Npn \_siunitx_print_math: + { + \ensuremath + { + \use:c + { + _siunitx_ \_l_siunitx_print_type_tl _ + math \_l_siunitx_font_family_tl :n + } + { \_l_siunitx_print_arg_tl } + } + } + \cs_set_protected_nopar:Npn \_siunitx_print_text: + { + \tl_replace_all_in:Nnn \_l_siunitx_print_arg_tl { @ } + { \_siunitx_print_text_sub:n } + \tl_replace_all_in:Nnn \_l_siunitx_print_arg_tl { ! } + { \_siunitx_print_text_sub:n } + \tl_replace_all_in:Nnn \_l_siunitx_print_arg_tl { ^ } + { \_siunitx_print_text_super:n } + \_l_siunitx_print_arg_tl + } +} +\group_begin: + \char_set_lccode:nn { `\@ } { `\_ } + \char_make_math_subscript:N \@ +\tl_to_lowercase:n { + \group_end: + \cs_set_protected:Npn \_siunitx_print_text_sub:n #1 + { + \cs_set:Npn \_siunitx_print_text_sub_super:n ##1 + { + \ensuremath + { + @ { \text {#1} } + ^ { \text {##1} } + } + } + \peek_meaning_remove:NTF \_siunitx_print_text_super:n + { \_siunitx_print_text_sub_super:n } + { \ensuremath { @ { \text {#1} } } } + } +} +\cs_set_protected:Npn \_siunitx_print_text_sub_super:n { } +\cs_set_protected:Npn \_siunitx_print_text_super:n #1 { + \tl_set:Nn \_l_siunitx_tmpa_tl {#1} + \tl_replace_all_in:Nnn \_l_siunitx_tmpa_tl { - } + { \_c_siunitx_minus_tl } + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \exp_not:N \ensuremath + { + ^ { \exp_not:N \text { \exp_not:V \_l_siunitx_tmpa_tl } } + } + } + \_l_siunitx_tmpa_tl +} +\keys_define:nn { siunitx } { + input-product .tl_set:N = \_l_siunitx_input_product_tl, + input-quotient .tl_set:N = \_l_siunitx_input_quotient_tl, +} +\keys_set:nn { siunitx } { + input-product = x, + input-quotient = / +} +\tl_new:N \_l_siunitx_number_arg_tl +\tl_new:N \_l_siunitx_number_next_tl +\tl_new:N \_l_siunitx_number_multi_tl +\tl_new:N \_l_siunitx_number_denominator_tl +\tl_new:N \_l_siunitx_number_numerator_tl +\cs_set_protected:Npn \_siunitx_number_preprocess:n #1 { + \_siunitx_number_preprocess_init: + \tl_set:Nn \_l_siunitx_number_arg_tl {#1} + \_siunitx_number_preprocess_product: + \tl_if_empty:NT \_l_siunitx_number_multi_tl + { \_siunitx_number_preprocess_quotient: } +} +\cs_generate_variant:Nn \_siunitx_number_preprocess:n { V } +\cs_set_protected_nopar:Npn \_siunitx_number_preprocess_init: { + \bool_set_false:N \_l_siunitx_error_bool + \tl_clear:N \_l_siunitx_number_multi_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_preprocess_product: { + \tl_map_function:NN \_l_siunitx_input_product_tl + \_siunitx_number_preprocess_product_aux:N +} +\cs_set_protected:Npn \_siunitx_number_preprocess_product_aux:N #1 { + \tl_if_in:NnT \_l_siunitx_number_arg_tl {#1} + { + \cs_set:Npn \_siunitx_tmp:w ##1 #1 ##2 \q_stop + { + \tl_set:Nn \_l_siunitx_number_arg_tl {##1} + \tl_set:Nn \_l_siunitx_number_next_tl {##2} + \tl_set:Nn \_l_siunitx_number_multi_tl { product } + } + \exp_after:wN \_siunitx_tmp:w \_l_siunitx_number_arg_tl \q_stop + \tl_if_empty:NT \_l_siunitx_number_arg_tl + { \_siunitx_error:n { starting-product-token } } + \tl_if_empty:NT \_l_siunitx_number_next_tl + { \_siunitx_error:n { ending-product-token } } + \tl_map_break: + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_preprocess_quotient: { + \tl_map_function:NN \_l_siunitx_input_quotient_tl + \_siunitx_number_preprocess_quotient_aux:N +} +\cs_set_protected:Npn \_siunitx_number_preprocess_quotient_aux:N #1 { + \tl_if_in:NnT \_l_siunitx_number_arg_tl {#1} + { + \cs_set:Npn \_siunitx_tmp:w ##1 #1 ##2 \q_stop + { + \tl_set:Nn \_l_siunitx_number_numerator_tl {##1} + \tl_set:Nn \_l_siunitx_number_denominator_tl {##2} + \tl_set:Nn \_l_siunitx_number_multi_tl { quotient } + } + \exp_after:wN \_siunitx_tmp:w \_l_siunitx_number_arg_tl \q_stop + \tl_if_empty:NT \_l_siunitx_number_numerator_tl + { \_siunitx_error:n { starting-quotient-token } } + \tl_if_empty:NT \_l_siunitx_number_denominator_tl + { \_siunitx_error:n { ending-quotient-token } } + \tl_if_in:NnT \_l_siunitx_number_denominator_tl {#1} + { \_siunitx_error:n { duplicate-quotient-token } } + \tl_map_break: + } +} +\tl_new:N \_c_siunitx_number_part_complex_tl +\tl_set:Nn \_c_siunitx_number_part_complex_tl { complex } +\bool_new:N \_l_siunitx_number_in_complex_bool +\bool_new:N \_l_siunitx_number_in_complex_root_bool +\bool_new:N \_l_siunitx_number_in_decimal_bool +\bool_new:N \_l_siunitx_number_in_exponent_bool +\bool_new:N \_l_siunitx_number_in_first_bool +\bool_new:N \_l_siunitx_number_in_sign_bool +\bool_new:N \_l_siunitx_number_in_uncert_bool +\bool_new:N \_l_siunitx_number_in_value_bool +\prop_new:N \_l_siunitx_number_in_prop +\tl_new:N \_l_siunitx_number_parsed_tl +\tl_new:N \_l_siunitx_number_part_tl +\tl_new:N \_l_siunitx_number_part_decimal_tl +\tl_new:N \_l_siunitx_number_part_decimal_marker_tl +\tl_new:N \_l_siunitx_number_part_integer_tl +\tl_new:N \_l_siunitx_number_part_sign_tl +\tl_new:N \_l_siunitx_number_part_uncert_tl +\keys_define:nn { siunitx } { + input-close-uncertainty .tl_set:N = \_l_siunitx_input_uncert_close_tl, + input-complex-roots .tl_set:N = \_l_siunitx_input_complex_tl, + input-decimal-markers .tl_set:N = \_l_siunitx_input_decimal_tl, + input-digits .tl_set:N = \_l_siunitx_input_digit_tl, + input-exponent-markers .tl_set:N = \_l_siunitx_input_exponent_tl, + input-ignore .tl_set:N = \_l_siunitx_input_ignore_tl, + input-open-uncertainty .tl_set:N = \_l_siunitx_input_uncert_open_tl, + input-protect-tokens .tl_set:N = \_l_siunitx_input_protect_tl, + input-signs .tl_set:N = \_l_siunitx_input_sign_tl, + input-symbols .tl_set:N = \_l_siunitx_input_symbol_tl, +} +\keys_set:nn { siunitx } { % ( + input-close-uncertainty = ), + input-complex-roots = ij, + input-decimal-markers = {.,}, + input-digits = 0123456789, + input-exponent-markers = dDeE, + input-open-uncertainty = (, % ) + input-protect-tokens = \mp\pi\pm, + input-signs = +-\mp\pm, + input-symbols = \pi, +} +\cs_set_protected:Npn \_siunitx_number_in_parse:n #1 { + \tl_if_empty:nF {#1} + { + \_siunitx_number_in_init: + \cs_set_eq:NN \_siunitx_number_in_parse_more:N + \_siunitx_number_in_parse_mantissa_aux:N + \_siunitx_number_in_parse_aux:n {#1} + } +} +\cs_generate_variant:Nn \_siunitx_number_in_parse:n { V } +\cs_set_protected:Npn \_siunitx_number_in_parse_aux:n #1 { + \tl_set_rescan:Nnx \_l_siunitx_number_arg_tl + { + \_siunitx_number_in_protect: + \char_make_ignore:N \~ + \char_make_other:N \, + \char_make_other:N \. + \cs_set_eq:NN \, \prg_do_nothing: + } + {#1} + \_siunitx_number_in_sign_replace:N \_l_siunitx_number_arg_tl + \tl_map_function:NN \_l_siunitx_number_arg_tl + \_siunitx_number_in_parse_loop:N + \tl_if_empty:NF \_l_siunitx_number_parsed_tl + { + \bool_if:NTF \_l_siunitx_number_in_uncert_bool + { \_siunitx_error:nx { invalid-number } {#1} } + { + \prop_put:NVn \_l_siunitx_number_in_prop + \_l_siunitx_number_part_tl { true } + \bool_if:NTF \_l_siunitx_number_in_decimal_bool + { + \prop_put:NVV \_l_siunitx_number_in_prop + \_l_siunitx_number_part_decimal_tl + \_l_siunitx_number_parsed_tl + } + { + \prop_put:NVV \_l_siunitx_number_in_prop + \_l_siunitx_number_part_integer_tl + \_l_siunitx_number_parsed_tl + } + } + } + \_siunitx_number_in_check:n {#1} +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_init: { + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_mantissa:N + \cs_set_eq:NN \_siunitx_number_in_check:n + \_siunitx_number_in_check_short:n + \tl_clear:N \_l_siunitx_number_parsed_tl + \prop_clear:N \_l_siunitx_number_in_prop + \bool_set_false:N \_l_siunitx_error_bool + \bool_set_false:N \_l_siunitx_number_in_complex_bool + \bool_set_false:N \_l_siunitx_number_in_complex_root_bool + \bool_set_false:N \_l_siunitx_number_in_exponent_bool + \bool_set_false:N \_l_siunitx_number_in_uncert_bool + \_siunitx_number_in_init_part:n { mantissa } +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_init_part:n #1 { + \bool_set_false:N \_l_siunitx_number_in_decimal_bool + \bool_set_true:N \_l_siunitx_number_in_first_bool + \bool_set_false:N \_l_siunitx_number_in_sign_bool + \bool_set_false:N \_l_siunitx_number_in_value_bool + \tl_set:Nn \_l_siunitx_number_part_tl {#1} + \tl_set:Nn \_l_siunitx_number_part_decimal_tl { #1 -decimal } + \tl_set:Nn \_l_siunitx_number_part_decimal_marker_tl + { #1 -decimal-marker } + \tl_set:Nn \_l_siunitx_number_part_integer_tl { #1 -integer } + \tl_set:Nn \_l_siunitx_number_part_sign_tl { #1 -sign } + \tl_set:Nn \_l_siunitx_number_part_uncert_tl { #1 -uncertainty } +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_protect: { + \tl_map_function:NN \_l_siunitx_input_protect_tl + \_siunitx_number_in_protect_aux:N +} +\cs_set_protected:Npn \_siunitx_number_in_protect_aux:N #1 { + \cs_set_eq:NN #1 \scan_stop: +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_sign_replace:N #1 { + \tl_replace_all_in:Nnn #1 { -+ } { \mp } + \tl_replace_all_in:Nnn #1 { +- } { \pm } +} +\cs_set_protected:Npn \_siunitx_number_in_parse_error:nx #1#2 { + \_siunitx_error:nx {#1} { \exp_not:n {#2} } + \tl_map_break: +} +\cs_generate_variant:Nn \_siunitx_number_in_parse_error:nx { nV } +\cs_set_protected:Npn \_siunitx_number_in_parse_loop:N #1 { } +\cs_set_protected:Npn \_siunitx_number_in_parse_more:N #1 { } +\cs_set_protected:Npn \_siunitx_number_in_parse_restricted:N #1 { + \tl_if_in:NnTF \_l_siunitx_input_exponent_tl {#1} + { + \_siunitx_number_in_parse_error:nx + { restricted-number } {#1} + } + { + \tl_if_in:NnTF \_l_siunitx_input_uncert_open_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { restricted-number } \_l_siunitx_number_arg_tl + } + { + \tl_if_in:NnTF \_l_siunitx_input_uncert_close_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { restricted-number } \_l_siunitx_number_arg_tl + } + { + \tl_if_in:NnTF \_l_siunitx_input_complex_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { restricted-number } \_l_siunitx_number_arg_tl + } + { + \_siunitx_number_in_parse_error:nx + { restricted-number } {#1} + } + } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_parse_complex:N #1 { + \tl_if_in:NnTF \_l_siunitx_input_exponent_tl {#1} + { + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_mantissa:N + \_siunitx_number_in_exponent:N #1 + } + { + \tl_if_in:NnF \_l_siunitx_input_ignore_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { misplaced-complex-root-token } + \_l_siunitx_number_arg_tl + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_parse_exponent:N #1 { + \tl_if_in:NnTF \_l_siunitx_input_exponent_tl {#1} + { + \_siunitx_number_in_parse_error:nx + { duplicate-exponent-token } { \token_to_str:N #1 } + } + { + \tl_if_in:NnTF \_l_siunitx_input_uncert_open_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { invalid-token-in-exponent } \_l_siunitx_number_arg_tl + } + { + \tl_if_in:NnTF \_l_siunitx_input_uncert_close_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { invalid-token-in-exponent } \_l_siunitx_number_arg_tl + } + { + \tl_if_in:NnTF \_l_siunitx_input_complex_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { invalid-token-in-exponent } + \_l_siunitx_number_arg_tl + } + { + \_siunitx_number_in_parse_error:nx + { invalid-token-in-number } {#1} + } + } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_parse_mantissa:N #1 { + \tl_if_in:NnTF \_l_siunitx_input_digit_tl {#1} + { \_siunitx_number_in_digit:N #1 } + { + \tl_if_in:NnTF \_l_siunitx_input_decimal_tl {#1} + { \_siunitx_number_in_decimal:N #1 } + { + \tl_if_in:NnTF \_l_siunitx_input_sign_tl {#1} + { \_siunitx_number_in_sign:N #1 } + { + \tl_if_in:NnTF \_l_siunitx_input_symbol_tl {#1} + { + \prop_put:Nnn \_l_siunitx_number_in_prop { symbolic } + { true } + \_siunitx_number_in_digit:N #1 + } + { + \tl_if_in:NnF \_l_siunitx_input_ignore_tl {#1} + { \_siunitx_number_in_parse_more:N #1 } + } + } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_parse_mantissa_aux:N #1 { + \tl_if_in:NnTF \_l_siunitx_input_exponent_tl {#1} + { \_siunitx_number_in_exponent:N #1 } + { + \tl_if_in:NnTF \_l_siunitx_input_uncert_open_tl {#1} + { \_siunitx_number_in_uncert_open:N #1 } + { + \tl_if_in:NnTF \_l_siunitx_input_uncert_close_tl {#1} + { + \_siunitx_number_in_parse_error:nx + { misplaced-uncertainty-token } {#1} + } + { + \tl_if_in:NnTF \_l_siunitx_input_complex_tl {#1} + { \_siunitx_number_in_complex:N #1 } + { + \_siunitx_number_in_parse_error:nx + { invalid-token-in-number } {#1} + } + } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_parse_uncert:N #1 { + \tl_if_in:NnTF \_l_siunitx_input_digit_tl {#1} + { \_siunitx_number_in_digit:N #1 } + { + \tl_if_in:NnTF \_l_siunitx_input_decimal_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { invalid-token-in-uncertainty } + \_l_siunitx_number_arg_tl + } + { + \tl_if_in:NnTF \_l_siunitx_input_sign_tl {#1} + { + \_siunitx_number_in_parse_error:nV + { invalid-token-in-uncertainty } + \_l_siunitx_number_arg_tl + } + { + \tl_if_in:NnTF \_l_siunitx_input_symbol_tl {#1} + { + \prop_put:Nnn \_l_siunitx_number_in_prop { symbolic } + { true } + \_siunitx_number_in_digit:N #1 + } + { + \tl_if_in:NnF \_l_siunitx_input_ignore_tl {#1} + { + \tl_if_in:NnTF \_l_siunitx_input_uncert_close_tl + {#1} + { \_siunitx_number_in_uncert_close:N #1 } + { + \_siunitx_number_in_parse_error:nV + { invalid-token-in-uncertainty } + \_l_siunitx_number_arg_tl + } + } + } + } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_parse_uncert_after:N #1 { + \tl_if_in:NnTF \_l_siunitx_input_exponent_tl {#1} + { + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_mantissa:N + \_siunitx_number_in_exponent:N #1 + } + { + \tl_if_in:NnTF \_l_siunitx_input_sign_tl {#1} + { + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_mantissa:N + \_siunitx_number_in_sign:N #1 + } + { + \tl_if_in:NnF \_l_siunitx_input_ignore_tl {#1} + { + \tl_if_in:NnTF \_l_siunitx_input_complex_tl {#1} + { + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_mantissa:N + \_siunitx_number_in_complex:N #1 + } + { + \_siunitx_number_in_parse_error:nV { invalid-number } + \_l_siunitx_number_arg_tl + } + } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_complex:N #1 { + \bool_set_false:N \_l_siunitx_number_in_first_bool + \bool_if:NTF \_l_siunitx_number_in_complex_root_bool + { + \_siunitx_number_in_parse_error:nx + { duplicate-complex-root-token } { \token_to_str:N #1 } + } + { + \cs_set_eq:NN \_siunitx_number_in_check:n + \_siunitx_number_in_check_full:n + \bool_set_true:N \_l_siunitx_number_in_complex_root_bool + \prop_put:Nnn \_l_siunitx_number_in_prop { complex-root } {#1} + \tl_if_empty:NF \_l_siunitx_number_parsed_tl + { + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_complex:N + } + \bool_if:NT \_l_siunitx_number_in_decimal_bool + { + \bool_if:NF \_l_siunitx_number_in_complex_bool + { + \prop_if_in:NnT \_l_siunitx_number_in_prop + { mantissa-uncertainty } + { + \_siunitx_number_in_complex_aux:nn + { mantissa-decimal } { complex-decimal } + \_siunitx_number_in_complex_aux:nn + { mantissa-uncertainty } { complex-uncertainty } + } + \_siunitx_number_in_complex_aux:nn { mantissa-integer } + { complex-integer } + \_siunitx_number_in_complex_aux:nn + { mantissa-decimal-marker } { complex-decimal-marker } + \prop_del:Nn \_l_siunitx_number_in_prop { mantissa } + \prop_put:Nnn \_l_siunitx_number_in_prop { complex } + { true } + } + } + \prop_if_in:NnF \_l_siunitx_number_in_prop { mantissa } + { + \prop_if_in:NnT \_l_siunitx_number_in_prop { mantissa-sign } + { + \_siunitx_number_in_complex_aux:nn { mantissa-sign } + { complex-sign } + } + } + \bool_set_true:N \_l_siunitx_number_in_complex_bool + \bool_set_false:N \_l_siunitx_number_in_first_bool + \_siunitx_number_in_init_part:n { complex } + \prop_if_in:NnT \_l_siunitx_number_in_prop + { complex-decimal-marker } + { \bool_set_true:N \_l_siunitx_number_in_decimal_bool } + \prop_if_in:NnT \_l_siunitx_number_in_prop + { complex-sign } + { \bool_set_true:N \_l_siunitx_number_in_sign_bool } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_complex_aux:nn #1#2 { + \prop_get:NnN \_l_siunitx_number_in_prop {#1} \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \prop_del:Nn \_l_siunitx_number_in_prop {#1} + \prop_put:NnV \_l_siunitx_number_in_prop {#2} \_l_siunitx_tmpa_tl + } +} +\cs_set_protected:Npn \_siunitx_number_in_decimal:N #1 { + \bool_set_false:N \_l_siunitx_number_in_first_bool + \bool_if:NTF \_l_siunitx_number_in_decimal_bool + { + \_siunitx_number_in_parse_error:nx { duplicate-decimal-token } + { \token_to_str:N #1 } + } + { + \bool_set_true:N \_l_siunitx_number_in_decimal_bool + \tl_if_empty:NF \_l_siunitx_number_parsed_tl + { + \prop_put:NVn \_l_siunitx_number_in_prop + \_l_siunitx_number_part_tl { true } + \prop_put:NVV \_l_siunitx_number_in_prop + \_l_siunitx_number_part_integer_tl + \_l_siunitx_number_parsed_tl + \tl_clear:N \_l_siunitx_number_parsed_tl + } + \prop_put:NVn \_l_siunitx_number_in_prop + \_l_siunitx_number_part_decimal_marker_tl {#1} + } +} +\cs_set_protected:Npn \_siunitx_number_in_digit:N #1 { + \bool_set_false:N \_l_siunitx_number_in_first_bool + \bool_if:NTF \_l_siunitx_number_in_uncert_bool + { \tl_put_right:Nn \_l_siunitx_number_parsed_tl {#1} } + { + \bool_if:NTF \_l_siunitx_number_in_decimal_bool + { + \tl_put_right:Nn \_l_siunitx_number_parsed_tl {#1} + \tl_if_eq:nnF {#1} { 0 } + { \bool_set_true:N \_l_siunitx_number_in_value_bool } + } + { + \tl_if_eq:nnTF {#1} { 0 } + { + \prop_put:NVn \_l_siunitx_number_in_prop + \_l_siunitx_number_part_tl { true } + \prop_put:NVn \_l_siunitx_number_in_prop + \_l_siunitx_number_part_integer_tl { 0 } + } + { \bool_set_true:N \_l_siunitx_number_in_value_bool } + \bool_if:NT \_l_siunitx_number_in_value_bool + { \tl_put_right:Nn \_l_siunitx_number_parsed_tl {#1} } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_exponent:N #1 { + \bool_if:NTF \_l_siunitx_number_in_exponent_bool + { + \_siunitx_number_in_parse_error:nx { duplicate-exponent-token } + { \token_to_str:N #1 } + } + { + \cs_set_eq:NN \_siunitx_number_in_parse_more:N + \_siunitx_number_in_parse_exponent:N + \tl_if_empty:NF \_l_siunitx_number_parsed_tl + { \_siunitx_number_in_store: } + \bool_set_true:N \_l_siunitx_number_in_exponent_bool + \_siunitx_number_in_init_part:n { exponent } + } +} +\cs_set_protected:Npn \_siunitx_number_in_sign:N #1 { + \bool_if:NTF \_l_siunitx_number_in_first_bool + { + \bool_set_false:N \_l_siunitx_number_in_first_bool + \bool_set_true:N \_l_siunitx_number_in_sign_bool + \prop_put:NVn \_l_siunitx_number_in_prop + \_l_siunitx_number_part_sign_tl {#1} + } + { + \bool_if:NTF \_l_siunitx_number_in_exponent_bool + { + \_siunitx_number_in_parse_error:nx { misplaced-sign-token } + {#1} + } + { + \bool_if:NTF \_l_siunitx_number_in_complex_bool + { + \_siunitx_number_in_parse_error:nx + { misplaced-sign-token } {#1} + } + { + \tl_if_empty:NF \_l_siunitx_number_parsed_tl + { \_siunitx_number_in_store: } + \cs_set_eq:NN \_siunitx_number_in_check:n + \_siunitx_number_in_check_full:n + \_siunitx_number_in_init_part:n { complex } + \prop_put:Nnn \_l_siunitx_number_in_prop + { complex-sign } {#1} + \bool_set_true:N \_l_siunitx_number_in_complex_bool + } + } + } +} +\cs_set_protected:Npn \_siunitx_number_in_uncert_open:N #1 { + \bool_set_false:N \_l_siunitx_number_in_first_bool + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_uncert:N + \bool_set_true:N \_l_siunitx_number_in_uncert_bool + \tl_if_empty:NTF \_l_siunitx_number_parsed_tl + { + \prop_if_in:NVF \_l_siunitx_number_in_prop + \_l_siunitx_number_part_integer_tl + { + \_siunitx_number_in_parse_error:nV { invalid-number } + \_l_siunitx_number_arg_tl + } + } + { \_siunitx_number_in_store: } +} +\cs_set_protected:Npn \_siunitx_number_in_uncert_close:N #1 { + \bool_set_false:N \_l_siunitx_number_in_uncert_bool + \tl_if_empty:NTF \_l_siunitx_number_parsed_tl + { + \_siunitx_number_in_parse_error:nV { empty-uncertainty } + \_l_siunitx_number_arg_tl + } + { + \prop_put:NVV \_l_siunitx_number_in_prop + \_l_siunitx_number_part_uncert_tl \_l_siunitx_number_parsed_tl + \prop_put:Nnn \_l_siunitx_number_in_prop + { uncertainty } { true } + \tl_clear:N \_l_siunitx_number_parsed_tl + \cs_set_eq:NN \_siunitx_number_in_parse_loop:N + \_siunitx_number_in_parse_uncert_after:N + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_store: { + \prop_put:NVn \_l_siunitx_number_in_prop \_l_siunitx_number_part_tl + { true } + \bool_if:NTF \_l_siunitx_number_in_decimal_bool + { + \prop_put:NVV \_l_siunitx_number_in_prop + \_l_siunitx_number_part_decimal_tl \_l_siunitx_number_parsed_tl + } + { + \prop_put:NVV \_l_siunitx_number_in_prop + \_l_siunitx_number_part_integer_tl \_l_siunitx_number_parsed_tl + } + \tl_clear:N \_l_siunitx_number_parsed_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_check:n #1 { } +\cs_set_protected_nopar:Npn \_siunitx_number_in_check_short:n #1 { + \prop_if_in:NVF \_l_siunitx_number_in_prop + \_l_siunitx_number_part_integer_tl + { + \prop_if_in:NVF \_l_siunitx_number_in_prop + \_l_siunitx_number_part_decimal_tl + { \_siunitx_error:nx { invalid-number } {#1} } + } + \bool_if:NF \_l_siunitx_number_in_value_bool + { + \tl_if_eq:NNF \_l_siunitx_number_part_tl + \_c_siunitx_number_part_complex_tl + { + \prop_get:NVN \_l_siunitx_number_in_prop + \_l_siunitx_number_part_sign_tl \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \tl_set:Nx \_l_siunitx_tmpb_tl + { \_l_siunitx_number_part_sign_tl -deleted } + \prop_put:NVV \_l_siunitx_number_in_prop + \_l_siunitx_tmpb_tl \_l_siunitx_tmpa_tl + } + \prop_del:NV \_l_siunitx_number_in_prop + \_l_siunitx_number_part_sign_tl + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_in_check_full:n #1 { + \tl_if_eq:NNF \_l_siunitx_number_part_tl + \_c_siunitx_number_part_complex_tl + { \_siunitx_number_in_check_short:n {#1} } + \bool_if:NF \_l_siunitx_number_in_complex_root_bool + { + \prop_get:NnN \_l_siunitx_number_in_prop { complex-sign } + \_l_siunitx_tmpa_tl + \_siunitx_error:nV { misplaced-sign-token } \_l_siunitx_tmpa_tl + } + \prop_get:NnN \_l_siunitx_number_in_prop { mantissa-sign } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \prop_if_in:NnF \_l_siunitx_number_in_prop { mantissa } + { + \prop_del:Nn \_l_siunitx_number_in_prop { mantissa-sign } + \prop_put:NnV \_l_siunitx_number_in_prop { complex-sign } + \_l_siunitx_tmpa_tl + } + } +} +\int_new:N \_l_siunitx_round_int +\tl_new:N \_l_siunitx_round_tl +\bool_new:N \_l_siunitx_round_bool +\tl_new:N \_l_siunitx_round_decimal_in_tl +\tl_new:N \_l_siunitx_round_decimal_out_tl +\tl_new:N \_l_siunitx_round_integer_in_tl +\tl_new:N \_l_siunitx_round_integer_out_tl +\int_new:N \_l_siunitx_process_decimal_int +\int_new:N \_l_siunitx_process_uncertainty_int +\tl_new:N \_l_siunitx_uncertainty_decimal_tl +\tl_new:N \_l_siunitx_uncertainty_integer_tl +\keys_define:nn { siunitx } { + add-decimal-zero .bool_set:N = \_l_siunitx_process_decimal_zero_bool, + add-integer-zero .bool_set:N = \_l_siunitx_process_integer_zero_bool, + explicit-sign .tl_set:N = \_l_siunitx_process_sign_tl, + retain-explicit-plus .bool_set:N = \_l_siunitx_process_plus_tl, + retain-unity-mantissa .bool_set:N = + \_l_siunitx_process_unity_mantissa_bool, + retain-zero-exponent .bool_set:N = + \_l_siunitx_process_zero_exponent_bool, + round-mode .choice: , + round-mode / figures .code:n = + { \tl_set:Nn \_l_siunitx_round_tl { figures } }, + round-mode / off .code:n = { \tl_clear:N \_l_siunitx_round_tl }, + round-mode / places .code:n = + { \tl_set:Nn \_l_siunitx_round_tl { places } }, + round-precision .int_set:N = \_l_siunitx_process_precision_int, +} +\keys_set:nn { siunitx } { + add-decimal-zero = true, + add-integer-zero = true, + retain-unity-mantissa = true, + round-precision = 2, +} +\cs_set_protected_nopar:Npn \_siunitx_number_process: { + \_siunitx_number_process_sign: + \_siunitx_number_process_zero_fill: + \_siunitx_number_process_mantissa: + \prop_if_in:NnF \_l_siunitx_number_in_prop { symbolic } + { + \_siunitx_number_process_exponent: + \_siunitx_number_process_uncertainty: + \prop_if_in:NnF \_l_siunitx_number_in_prop { uncertainty } + { \_siunitx_number_process_round: } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_exponent: { + \bool_if:NF \_l_siunitx_process_zero_exponent_bool + { + \prop_if_in:NnT \_l_siunitx_number_in_prop { exponent } + { + \bool_set_false:N \_l_siunitx_tmp_bool + \_siunitx_number_process_exponent_aux:n { integer } + \bool_if:NF \_l_siunitx_tmp_bool + { \_siunitx_number_process_exponent_aux:n { decimal } } + \bool_if:NF \_l_siunitx_tmp_bool + { + \prop_del:Nn \_l_siunitx_number_in_prop { exponent } + \prop_del:Nn \_l_siunitx_number_in_prop + { exponent-integer } + \prop_del:Nn \_l_siunitx_number_in_prop + { exponent-decimal } + } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_exponent_aux:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop { exponent- #1 } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \intexpr_compare:nNnF + { \_l_siunitx_tmpa_tl } = { 0 } + { \bool_set_true:N \_l_siunitx_tmp_bool } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_figures:n #1 { + \prop_if_in:NnT \_l_siunitx_number_in_prop {#1} + { \_siunitx_number_process_figures_aux:n {#1} } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_figures_aux:n #1 { + \_siunitx_number_process_figures_init:n {#1} + \_siunitx_number_process_figures_count:n { integer } + \_siunitx_number_process_figures_count:n { decimal } + \bool_if:NTF \_l_siunitx_round_bool + { + \bool_set_false:N \_l_siunitx_round_bool + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_round_int } > + { \int_use:N \_l_siunitx_process_precision_int } + { + \_siunitx_number_process_figures_round: + \_siunitx_number_process_round_tidy:n {#1} + } + { \_siunitx_number_process_figures_pad:n {#1} } + } + { + \prop_put:Nnn \_l_siunitx_number_in_prop { #1 -integer } { 0 } + \prop_del:Nn \_l_siunitx_number_in_prop { #1 -decimal } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_figures_init:n #1 { + \int_zero:N \_l_siunitx_round_int + \bool_set_false:N \_l_siunitx_round_bool + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -decimal } + \_l_siunitx_round_decimal_in_tl + \quark_if_no_value:NT \_l_siunitx_round_decimal_in_tl + { \tl_clear:N \_l_siunitx_round_decimal_in_tl } + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -integer } + \_l_siunitx_round_integer_in_tl + \quark_if_no_value:NT \_l_siunitx_round_integer_in_tl + { \tl_clear:N \_l_siunitx_round_integer_in_tl } + \tl_clear:N \_l_siunitx_round_decimal_out_tl + \tl_clear:N \_l_siunitx_round_integer_out_tl +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_figures_count:n #1 { + \tl_if_empty:cF { _l_siunitx_round_ #1 _in_tl } + { + \prop_if_in:NnF \_l_siunitx_number_in_prop { #1 -uncertainty } + { \_siunitx_number_process_figures_count_aux:n {#1} } + } +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_figures_count_aux:n #1 { + \int_set:Nn \_l_siunitx_tmp_int + { \exp_args:Nv \tl_head_i:n { _l_siunitx_round_ #1 _in_tl } } + \tl_set:cx { _l_siunitx_round_ #1 _in_tl } + { \exp_args:Nv \tl_tail:n { _l_siunitx_round_ #1 _in_tl } } + \tl_put_left:cV { _l_siunitx_round_ #1 _out_tl } \_l_siunitx_tmp_int + \bool_if:NF \_l_siunitx_round_bool + { + \intexpr_compare:nNnF + { \_l_siunitx_tmp_int } = { 0 } + { \bool_set_true:N \_l_siunitx_round_bool } + } + \bool_if:NT \_l_siunitx_round_bool + { \int_incr:N \_l_siunitx_round_int } + \tl_if_empty:cTF { _l_siunitx_round_ #1 _in_tl } + { + \tl_set_eq:cc { _l_siunitx_round_ #1 _in_tl } + { _l_siunitx_round_ #1 _out_tl } + \tl_clear:c { _l_siunitx_round_ #1 _out_tl } + } + { \_siunitx_number_process_figures_count_aux:n {#1} } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_figures_round: { + \int_set:Nn \_l_siunitx_round_int + { \_l_siunitx_round_int - \_l_siunitx_process_precision_int } + \tl_if_empty:NF \_l_siunitx_round_decimal_in_tl + { \_siunitx_number_process_figures_round_loop: } + \tl_if_empty:NF \_l_siunitx_round_integer_in_tl + { \_siunitx_number_process_figures_integer: } + \bool_if:NT \_l_siunitx_round_bool + { + \tl_put_left:Nn \_l_siunitx_round_integer_out_tl { 1 } + \tl_if_empty:NF \_l_siunitx_round_decimal_out_tl + { + \tl_reverse:N \_l_siunitx_round_decimal_out_tl + \tl_set:Nx \_l_siunitx_round_decimal_out_tl + { \tl_tail:n \_l_siunitx_round_decimal_out_tl } + \tl_reverse:N \_l_siunitx_round_decimal_out_tl + } + } +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_figures_round_loop: { + \_siunitx_number_process_round_decimal: + \tl_if_empty:NF \_l_siunitx_round_decimal_in_tl + { \_siunitx_number_process_figures_round_loop: } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_figures_integer: { + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_round_int } > { 0 } + { \tl_put_left:Nn \_l_siunitx_round_integer_out_tl { 0 } } + \intexpr_compare:nNnF + { \int_use:N \_l_siunitx_round_int } > { 1 } + { + \int_set:Nn \_l_siunitx_tmp_int + { \exp_args:NV \tl_head_i:n \_l_siunitx_round_integer_in_tl } + \bool_if:NT \_l_siunitx_round_bool + { \int_incr:N \_l_siunitx_tmp_int } + \bool_set_false:N \_l_siunitx_round_bool + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_round_int } = { 1 } + { + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_tmp_int } > { 4 } + { \bool_set_true:N \_l_siunitx_round_bool } + } + { + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_tmp_int } > { 10 } + { + \bool_set_true:N \_l_siunitx_round_bool + \int_zero:N \_l_siunitx_tmp_int + } + \tl_put_left:NV \_l_siunitx_round_integer_out_tl + \_l_siunitx_tmp_int + } + } + \int_decr:N \_l_siunitx_round_int + \tl_set:Nx \_l_siunitx_round_integer_in_tl + { \exp_args:NV \tl_tail:n \_l_siunitx_round_integer_in_tl } + \tl_if_empty:NF \_l_siunitx_round_integer_in_tl + { \_siunitx_number_process_figures_integer: } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_figures_pad:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -integer } + \_l_siunitx_round_integer_in_tl + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -decimal } + \_l_siunitx_round_decimal_in_tl + \int_set:Nn \_l_siunitx_round_int + { \_l_siunitx_process_precision_int - \_l_siunitx_round_int } + \_siunitx_number_process_pad:n {#1} +} +\tl_new:N \_c_siunitx_unity_tl +\tl_set:Nn \_c_siunitx_unity_tl { 1 } +\cs_set_protected_nopar:Npn \_siunitx_number_process_mantissa: { + \bool_if:NF \_l_siunitx_process_unity_mantissa_bool + { + \prop_if_in:NnT \_l_siunitx_number_in_prop { exponent } + { + \prop_get:NnN \_l_siunitx_number_in_prop { mantissa-integer } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \tl_if_eq:NNT \_c_siunitx_unity_tl \_l_siunitx_tmpa_tl + { + \prop_if_in:NnF \_l_siunitx_number_in_prop + { mantissa-decimal-marker } + { + \prop_del:Nn \_l_siunitx_number_in_prop + { mantissa } + \prop_del:Nn \_l_siunitx_number_in_prop + { mantissa-integer } + } + } + } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_pad:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -decimal } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \intexpr_while_do:nNnn + { \int_use:N \_l_siunitx_round_int } > { 0 } + { + \tl_put_right:Nn \_l_siunitx_tmpa_tl { 0 } + \int_decr:N \_l_siunitx_round_int + } + \prop_put:NnV \_l_siunitx_number_in_prop { #1 -decimal } + \_l_siunitx_tmpa_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_places:n #1 { + \prop_if_in:NnT \_l_siunitx_number_in_prop {#1} + { + \prop_if_in:NnF \_l_siunitx_number_in_prop { #1 -uncertainty } + { \_siunitx_number_process_places_aux_i:n {#1} } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_places_aux_i:n #1 { + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_process_precision_int } = { 0 } + { \prop_del:Nn \_l_siunitx_number_in_prop { #1 -decimal } } + { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -decimal } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \tl_if_empty:NT \_l_siunitx_tmpa_tl + { \tl_set:Nn \_l_siunitx_tmpa_tl { 0 } } + \intexpr_compare:nNnTF + { \_l_siunitx_tmpa_tl } = { 0 } + { + \prop_put:Nnn \_l_siunitx_number_in_prop { #1 -decimal } + { } + \int_set:Nn \_l_siunitx_round_int + { \_l_siunitx_process_precision_int } + \_siunitx_number_process_pad:n {#1} + } + { + \int_set:Nn \_l_siunitx_round_int + { \tl_elt_count:N \_l_siunitx_tmpa_tl } + \_siunitx_number_process_places_aux_ii:n {#1} + } + } + } +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_places_aux_ii:n #1 { + \int_sub:Nn \_l_siunitx_round_int + { \_l_siunitx_process_precision_int } + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_round_int } < { 0 } + { + \int_set:Nn \_l_siunitx_round_int { - \_l_siunitx_round_int } + \_siunitx_number_process_pad:n {#1} + } + { + \_siunitx_number_process_places_init:n {#1} + \_siunitx_number_process_places_loop:n {#1} + \_siunitx_number_process_round_tidy:n {#1} + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_places_init:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -integer } + \_l_siunitx_round_integer_in_tl + \quark_if_no_value:NT \_l_siunitx_round_integer_in_tl + { \tl_clear:N \_l_siunitx_round_integer_in_tl } + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -decimal } + \_l_siunitx_round_decimal_in_tl + \tl_reverse:N \_l_siunitx_round_integer_in_tl + \tl_reverse:N \_l_siunitx_round_decimal_in_tl + \tl_clear:N \_l_siunitx_round_integer_out_tl + \tl_clear:N \_l_siunitx_round_decimal_out_tl + \bool_set_false:N \_l_siunitx_round_bool +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_places_loop:n #1 { + \tl_if_empty:NTF \_l_siunitx_round_decimal_in_tl + { + \tl_if_empty:NF \_l_siunitx_round_integer_in_tl + { + \_siunitx_number_process_places_integer:n {#1} + \_siunitx_number_process_places_loop:n {#1} + } + \bool_if:NT \_l_siunitx_round_bool + { + \tl_put_left:Nn \_l_siunitx_round_integer_out_tl { 1 } + \bool_set_false:N \_l_siunitx_round_bool + } + } + { + \_siunitx_number_process_round_decimal: + \_siunitx_number_process_places_loop:n {#1} + } +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_places_integer:n #1 { + \int_set:Nn \_l_siunitx_tmp_int + { \exp_args:NV \tl_head_i:n \_l_siunitx_round_integer_in_tl } + \tl_set:Nx \_l_siunitx_round_integer_in_tl + { \exp_args:NV \tl_tail:n \_l_siunitx_round_integer_in_tl } + \bool_if:NT \_l_siunitx_round_bool + { \int_incr:N \_l_siunitx_tmp_int } + \bool_set_false:N \_l_siunitx_round_bool + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_tmp_int } = { 10 } + { + \int_zero:N \_l_siunitx_tmp_int + \bool_set_true:N \_l_siunitx_round_bool + } + \tl_put_left:NV \_l_siunitx_round_integer_out_tl \_l_siunitx_tmp_int +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_round: { + \tl_if_empty:NF \_l_siunitx_round_tl + { + \cs_set_nopar:Npx \_siunitx_tmp:w + { + \exp_not:N \clist_map_function:nN + { mantissa , complex } + \exp_not:c + { _siunitx_number_process_ \_l_siunitx_round_tl :n } + } + \_siunitx_tmp:w + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_round_decimal: { + \intexpr_compare:nNnF + { \int_use:N \_l_siunitx_round_int } > { 1 } + { \_siunitx_number_process_round_decimal_aux: } + \tl_set:Nx \_l_siunitx_round_decimal_in_tl + { \exp_args:NV \tl_tail:n \_l_siunitx_round_decimal_in_tl } + + \int_decr:N \_l_siunitx_round_int +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_round_decimal_aux: { + \int_set:Nn \_l_siunitx_tmp_int + { \exp_args:NV \tl_head_i:n \_l_siunitx_round_decimal_in_tl } + \bool_if:NT \_l_siunitx_round_bool + { \int_incr:N \_l_siunitx_tmp_int } + \bool_set_false:N \_l_siunitx_round_bool + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_round_int } = { 1 } + { + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_tmp_int } > { 4 } + { \bool_set_true:N \_l_siunitx_round_bool } + } + { + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_tmp_int } = { 10 } + { + \bool_set_true:N \_l_siunitx_round_bool + \int_zero:N \_l_siunitx_tmp_int + } + \tl_put_left:NV \_l_siunitx_round_decimal_out_tl + \_l_siunitx_tmp_int + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_round_tidy:n #1 { + \prop_put:NnV \_l_siunitx_number_in_prop { #1 -integer } + \_l_siunitx_round_integer_out_tl + \prop_put:NnV \_l_siunitx_number_in_prop { #1 -decimal } + \_l_siunitx_round_decimal_out_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_sign: { + \bool_if:NF \_l_siunitx_process_plus_tl + { + \prop_if_in:NnTF \_l_siunitx_number_in_prop { mantissa-sign } + { \_siunitx_number_process_sign_plus:n { mantissa } } + { + \prop_if_in:NnT \_l_siunitx_number_in_prop { complex-sign } + { + \prop_if_in:NnF \_l_siunitx_number_in_prop { mantissa } + { \_siunitx_number_process_sign_plus:n { complex } } + } + } + \prop_if_in:NnT \_l_siunitx_number_in_prop { exponent-sign } + { \_siunitx_number_process_sign_plus:n { exponent } } + } + \tl_if_empty:NF \_l_siunitx_process_sign_tl + { + \prop_if_in:NnTF \_l_siunitx_number_in_prop { mantissa } + { \_siunitx_number_process_sign_add:n { mantissa } } + { + \prop_if_in:NnT \_l_siunitx_number_in_prop { complex } + { \_siunitx_number_process_sign_add:n { complex } } + } + \prop_if_in:NnT \_l_siunitx_number_in_prop { exponent } + { \_siunitx_number_process_sign_add:n { exponent } } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_sign_add:n #1 { + \prop_if_in:NnF \_l_siunitx_number_in_prop { #1 -sign } + { + \prop_if_in:NnF \_l_siunitx_number_in_prop { #1 -had-sign } + { + \prop_get:NnN \_l_siunitx_number_in_prop {#1} + \_l_siunitx_tmpa_tl + \tl_if_empty:NTF \_l_siunitx_tmpa_tl + { + \prop_put:NnV \_l_siunitx_number_in_prop { sign } + \_l_siunitx_process_sign_tl + } + { + \prop_put:NnV \_l_siunitx_number_in_prop { #1 -sign } + \_l_siunitx_process_sign_tl + } + } + } +} +\tl_new:N \_c_siunitx_plus_tl +\tl_set:Nn \_c_siunitx_plus_tl { + } +\cs_set_protected_nopar:Npn \_siunitx_number_process_sign_plus:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -sign } + \_l_siunitx_tmpa_tl + \tl_if_eq:NNT \_c_siunitx_plus_tl \_l_siunitx_tmpa_tl + { + \prop_del:Nn \_l_siunitx_number_in_prop { #1 -sign } + \prop_put:Nnn \_l_siunitx_number_in_prop { #1 -had-sign } { true } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_uncertainty: { + \clist_map_function:nN { mantissa , complex } + \_siunitx_number_process_uncertainty_aux:n +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_uncertainty_aux:n #1 { + \prop_if_in:NnT \_l_siunitx_number_in_prop { #1 -uncertainty } + { + \prop_if_in:NnTF \_l_siunitx_number_in_prop { #1 -decimal-marker } + { \_siunitx_number_process_uncertainty_decimal:n {#1} } + { \_siunitx_number_process_uncertainty_integer:n {#1} } + } +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_uncertainty_decimal:n #1 { + \_siunitx_number_process_uncertainty_count:nn {#1} { decimal } + \_siunitx_number_process_uncertainty_count:nn {#1} { uncertainty } + \tl_clear:N \_l_siunitx_uncertainty_decimal_tl + \tl_clear:N \_l_siunitx_uncertainty_integer_tl + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_process_uncertainty_int } + > { \int_use:N \_l_siunitx_process_decimal_int } + { \_siunitx_number_process_uncertainty_separate: } + { \_siunitx_number_process_uncertainty_pad: } + \tl_if_empty:NF \_l_siunitx_uncertainty_integer_tl + { + \prop_put:NnV \_l_siunitx_number_in_prop + { #1 -uncertainty-integer } + \_l_siunitx_uncertainty_integer_tl + } + \prop_put:NnV \_l_siunitx_number_in_prop { #1 -uncertainty-decimal } + \_l_siunitx_uncertainty_decimal_tl + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -decimal-marker } + \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_in_prop + { #1 -uncertainty-decimal-marker } \_l_siunitx_tmpa_tl +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_uncertainty_count:nn #1#2 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 - #2 } + \_l_siunitx_tmpa_tl + \int_set:cn { _l_siunitx_process_ #2 _int } + { \tl_elt_count:N \_l_siunitx_tmpa_tl } +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_uncertainty_pad: { + \intexpr_while_do:nNnn + { \int_use:N \_l_siunitx_process_uncertainty_int } + < { \int_use:N \_l_siunitx_process_decimal_int } + { + \tl_put_right:Nn \_l_siunitx_uncertainty_decimal_tl {0} + \int_incr:N \_l_siunitx_process_uncertainty_int + } + \tl_put_right:NV \_l_siunitx_uncertainty_decimal_tl + \_l_siunitx_tmpa_tl +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_uncertainty_separate: { + \tl_map_function:NN \_l_siunitx_tmpa_tl + \_siunitx_number_process_uncertainty_separate_aux:N +} +\cs_set_protected:Npn + \_siunitx_number_process_uncertainty_separate_aux:N #1 { + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_process_uncertainty_int } + > { \int_use:N \_l_siunitx_process_decimal_int } + { \tl_put_right:Nn \_l_siunitx_uncertainty_integer_tl {#1} } + { \tl_put_right:Nn \_l_siunitx_uncertainty_decimal_tl {#1} } + \int_decr:N \_l_siunitx_process_uncertainty_int +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_uncertainty_integer:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -uncertainty } + \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_in_prop { #1 -uncertainty-integer } + \_l_siunitx_tmpa_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_process_zero_fill: { + \_siunitx_number_process_zero_fill_aux:n { integer } + \_siunitx_number_process_zero_fill_aux:n { decimal } +} +\cs_set_nopar:Npn \_siunitx_number_process_zero_fill_aux:n #1 { + \bool_if:cT { _l_siunitx_process_ #1 _zero_bool } + { + \_siunitx_number_process_zero_fill_aux:nn { mantissa } {#1} + \_siunitx_number_process_zero_fill_aux:nn { complex } {#1} + \_siunitx_number_process_zero_fill_aux:nn { exponent } {#1} + } +} +\cs_set_protected_nopar:Npn + \_siunitx_number_process_zero_fill_aux:nn #1#2 { + \prop_if_in:NnT \_l_siunitx_number_in_prop { #1 -decimal-marker } + { + \prop_if_in:NnF \_l_siunitx_number_in_prop { #1 - #2 } + { \prop_put:Nnn \_l_siunitx_number_in_prop { #1 - #2 } { 0 } } + } +} +\prop_new:N \_l_siunitx_number_out_prop +\tl_new:N \_l_siunitx_group_sep_tl +\tl_new:N \_l_siunitx_output_decimal_tl +\bool_new:N \_l_siunitx_complex_after_bool +\keys_define:nn { siunitx } { + bracket-numbers .bool_set:N = \_l_siunitx_brackets_bool, + close-bracket .tl_set:N = \_l_siunitx_bracket_close_tl, + complex-root-position .choice:, + complex-root-position + / after-number .code:n = + { \bool_set_true:N \_l_siunitx_complex_after_bool } , + complex-root-position + / before-number .code:n = + { \bool_set_false:N \_l_siunitx_complex_after_bool } , + copy-decimal-marker .bool_set:N = + \_l_siunitx_output_decimal_copy_bool, + exponent-base .tl_set:N = \_l_siunitx_exponent_base_tl, + exponent-product .tl_set:N = + \_l_siunitx_exponent_product_tl, + group-decimal-digits .bool_set:N = + \_l_siunitx_group_decimal_bool, + group-digits .meta:n = + { + group-decimal-digits = #1, + group-integer-digits = #1 + }, + group-four-digits .bool_set:N = \_l_siunitx_group_four_bool, + group-integer-digits .bool_set:N = + \_l_siunitx_group_integer_bool, + group-separator .code:n = + { + \tl_set:Nn \_l_siunitx_group_sep_tl { {#1} } + }, + negative-color .tl_set:N = \_l_siunitx_negative_color_tl, + open-bracket .tl_set:N = \_l_siunitx_bracket_open_tl, + output-close-uncertainty .tl_set:N = + \_l_siunitx_output_uncert_close_tl, + output-complex-root .tl_set:N = \_l_siunitx_output_complex_tl, + output-decimal-marker .code:n = + { + \tl_set:Nn \_l_siunitx_output_decimal_tl { {#1} } + }, + output-open-uncertainty .tl_set:N = + \_l_siunitx_output_uncert_open_tl, + separate-uncertainty .bool_set:N = \_l_siunitx_uncert_sep_bool, + tight-spacing .bool_set:N = \_l_siunitx_tight_bool, + uncertainty-separator .tl_set:N = \_l_siunitx_uncert_sep_tl, +} +\keys_set:nn { siunitx } { + bracket-numbers = true, % ( + close-bracket = ), + complex-root-position = after-number, + copy-decimal-marker = false, + exponent-base = 10, + exponent-product = \times, + group-decimal-digits = true, + group-integer-digits = true, + group-separator = \,, + open-bracket = (, % ) ( + output-close-uncertainty = ), + output-complex-root = \mathrm { i }, + output-decimal-marker = ., + output-open-uncertainty = (, % ) +} +\cs_set_protected_nopar:Npn \_siunitx_number_format: { + \prop_if_empty:NF \_l_siunitx_number_in_prop + { + \prop_clear:N \_l_siunitx_number_out_prop + \_siunitx_number_format_reassemble: + \_siunitx_number_format_complex: + \_siunitx_number_format_sign:n { mantissa } + \_siunitx_number_format_sign:n { exponent } + \_siunitx_number_format_color: + \_siunitx_number_format_final: + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_brackets:n #1 { + \bool_if:NT \_l_siunitx_brackets_bool + { + \prop_if_in:NnT \_l_siunitx_number_out_prop { #1 -bracket } + { + \_siunitx_number_format_brackets_aux:n {#1} + \prop_del:Nn \_l_siunitx_number_out_prop { #1 -bracket } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_brackets_aux:n #1 { + \prop_get:NnN \_l_siunitx_number_out_prop { #1 -result } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { + \prop_get:NnN \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl + } + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_bracket_open_tl + \_siunitx_tl_put_right_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_bracket_close_tl + \tl_if_eq:nnTF {#1} { result } + { \prop_put:NnV \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl } + { + \prop_put:NnV \_l_siunitx_number_out_prop { #1 -result } + \_l_siunitx_tmpa_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_color: { + \tl_if_empty:NF \_l_siunitx_negative_color_tl + { + \_siunitx_number_format_color_aux:n { mantissa-sign } + \_siunitx_number_format_color_aux:n { sign } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_color_aux:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop {#1} \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \tl_if_eq:nVT { - } \_l_siunitx_tmpa_tl + { + \prop_put:NnV \_l_siunitx_number_out_prop { color } + \_l_siunitx_negative_color_tl + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_complex: { + \prop_if_in:NnT \_l_siunitx_number_in_prop { complex-root } + { + \prop_if_in:NnTF \_l_siunitx_number_out_prop { complex } + { + \_siunitx_number_format_brackets:n { complex } + \_siunitx_number_format_complex_aux:n { complex } + \_siunitx_number_format_complex_aux:n { complex-result } + \prop_if_in:NnT \_l_siunitx_number_out_prop + { complex-uncertainty } + { + \_siunitx_number_format_complex_aux:n + { complex-uncertainty } + } + } + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \exp_not:N \_siunitx_ensuremath:n + { \exp_not:V \_l_siunitx_output_complex_tl } + } + \prop_put:NnV \_l_siunitx_number_out_prop { complex } + \_l_siunitx_tmpa_tl + } + \_siunitx_number_format_join_complex: + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_complex_aux:n #1 { + \prop_get:NnN \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl + \bool_if:NTF \_l_siunitx_complex_after_bool + { + \_siunitx_tl_put_right_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_output_complex_tl + } + { + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_output_complex_tl + } + \prop_put:NnV \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_copy:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop {#1} \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_copy:nn #1#2 { + \prop_get:NnN \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_out_prop {#2} \_l_siunitx_tmpa_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_final: { + \prop_if_in:NnT \_l_siunitx_number_out_prop { complex } + { + \prop_if_in:NnF \_l_siunitx_number_out_prop { mantissa-result } + { + \_siunitx_number_format_copy:nn { complex } + { mantissa-result } + } + } + \prop_if_in:NnTF \_l_siunitx_number_out_prop { exponent } + { + \_siunitx_number_format_final_exponent: + \prop_if_in:NnTF \_l_siunitx_number_out_prop { mantissa-result } + { \_siunitx_number_format_final_combined: } + { \_siunitx_number_format_final_exponent_only: } + } + { \_siunitx_number_format_copy:nn { mantissa-result } { result } } + \prop_if_in:NnT \_l_siunitx_number_out_prop { mantissa-bracket } + { + \prop_put:Nnn \_l_siunitx_number_out_prop { result-bracket } + { true } + \prop_del:Nn \_l_siunitx_number_out_prop { mantissa-bracket } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_final_combined: { + \_siunitx_number_format_brackets:n { mantissa } + \prop_get:NnN \_l_siunitx_number_out_prop { mantissa-result } + \_l_siunitx_tmpa_tl + \tl_set_eq:NN \_l_siunitx_tmpb_tl \_l_siunitx_exponent_product_tl + \bool_if:NT \_l_siunitx_tight_bool + { + \tl_set:Nx \_l_siunitx_tmpb_tl + { { \exp_not:V \_l_siunitx_tmpb_tl } } + } + \_siunitx_tl_put_right_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_tmpb_tl + \prop_get:NnN \_l_siunitx_number_out_prop { exponent-result } + \_l_siunitx_tmpb_tl + \tl_put_right:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop { result } + \_l_siunitx_tmpa_tl + \prop_put:Nnn \_l_siunitx_number_out_prop + { result-bracket-exponent } { true } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_final_exponent: { + \prop_get:NnN \_l_siunitx_number_out_prop { exponent } + \_l_siunitx_tmpa_tl + \tl_set:Nx \_l_siunitx_tmpa_tl + { ^ { \exp_not:V \_l_siunitx_tmpa_tl } } + \tl_put_left:NV \_l_siunitx_tmpa_tl \_l_siunitx_exponent_base_tl + \prop_put:NnV \_l_siunitx_number_out_prop { exponent-result } + \_l_siunitx_tmpa_tl +} +\cs_set_protected_nopar:Npn + \_siunitx_number_format_final_exponent_only: { + \prop_get:NnN \_l_siunitx_number_in_prop { mantissa-sign } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \bool_if:NT \_l_siunitx_tight_bool + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { { \exp_not:V \_l_siunitx_tmpa_tl } } + } + \prop_get:NnN \_l_siunitx_number_out_prop { exponent-result } + \_l_siunitx_tmpb_tl + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpb_tl + \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_out_prop { exponent-result } + \_l_siunitx_tmpb_tl + } + \_siunitx_number_format_copy:nn { exponent-result } { result } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_group:n #1 { + \_siunitx_number_format_group_aux:nn {#1} { integer } + \_siunitx_number_format_group_aux:nn {#1} { decimal } + \prop_if_in:NnTF \_l_siunitx_number_out_prop { #1 -integer } + { \_siunitx_number_format_copy:nn { #1 -integer } {#1} } + { \tl_clear:N \_l_siunitx_tmpa_tl } + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -decimal-marker } + \_l_siunitx_tmpb_tl + \quark_if_no_value:NF \_l_siunitx_tmpb_tl + { + \bool_if:NTF \_l_siunitx_output_decimal_copy_bool + { \tl_set:Nx \_l_siunitx_tmpb_tl { { \_l_siunitx_tmpb_tl } } } + { + \tl_set_eq:NN \_l_siunitx_tmpb_tl + \_l_siunitx_output_decimal_tl + } + \tl_set:Nx \_l_siunitx_tmpb_tl + { + \exp_not:N \_siunitx_ensuremath:n + { \exp_not:V \_l_siunitx_tmpb_tl } + } + \tl_put_right:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop { #1 -decimal-marker } + \_l_siunitx_tmpb_tl + \prop_get:NnN \_l_siunitx_number_out_prop { #1 -decimal } + \_l_siunitx_tmpb_tl + \quark_if_no_value:NT \_l_siunitx_tmpb_tl + { \tl_clear:N \_l_siunitx_tmpb_tl } + \tl_put_right:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_group_aux:nn #1#2 { + \prop_if_in:NnT \_l_siunitx_number_in_prop { #1 - #2 } + { + \prop_if_in:NnTF \_l_siunitx_number_in_prop { symbolic } + { \_siunitx_number_format_copy:n { #1 - #2 } } + { + \bool_if:cTF { _l_siunitx_group_ #2 _bool } + { \_siunitx_number_format_group_four:nn {#1} {#2} } + { \_siunitx_number_format_copy:n { #1 - #2 } } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_group_four:nn #1#2 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 - #2 } + \_l_siunitx_tmpa_tl + \bool_if:NTF \_l_siunitx_group_four_bool + { \_siunitx_number_format_group_four_aux:nn {#1} {#2} } + { + \exp_after:wN \_siunitx_number_format_group_four_aux:NNNNNNw + \_l_siunitx_tmpa_tl \q_no_value \q_no_value \q_no_value + \q_no_value \q_no_value \q_nil + { \_siunitx_number_format_copy:n {#1 - #2} } + { \_siunitx_number_format_group_four_aux:nn {#1} {#2} } + } +} +\cs_set_protected:Npn \_siunitx_number_format_group_four_aux:NNNNNNw + #1#2#3#4#5#6 \q_nil { + \quark_if_no_value:NTF #5 +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_group_four_aux:nn + #1#2 { + \tl_clear:N \_l_siunitx_tmpb_tl + \use:c { _siunitx_number_format_group_ #2 : } + \prop_put:NnV \_l_siunitx_number_out_prop { #1 - #2 } + \_l_siunitx_tmpb_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_group_decimal: { + \tl_if_empty:NF \_l_siunitx_tmpa_tl + { + \exp_after:wN \_siunitx_number_format_group_decimal_aux:NNNN + \_l_siunitx_tmpa_tl { } { } { } + } +} +\cs_set_protected:Npn \_siunitx_number_format_group_decimal_aux:NNNN + #1#2#3#4 { + \tl_if_empty:nTF {#2} + { \tl_put_right:Nn \_l_siunitx_tmpb_tl {#1} } + { + \tl_if_empty:nTF {#3} + { \tl_put_right:Nn \_l_siunitx_tmpb_tl { #1 #2 } } + { + \tl_put_right:Nn \_l_siunitx_tmpb_tl { #1 #2 #3 } + \tl_if_empty:nF {#4} + { + \_siunitx_tl_put_right_math:NV \_l_siunitx_tmpb_tl + \_l_siunitx_group_sep_tl + \_siunitx_number_format_group_decimal_aux:NNNN #4 + } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_group_integer: { + \tl_if_empty:NF \_l_siunitx_tmpa_tl + { + \_siunitx_number_format_group_integer_setup:V \_l_siunitx_tmpa_tl + } +} +\cs_set_protected:Npn \_siunitx_number_format_group_integer_setup:n #1 { + \_siunitx_number_format_group_integer_setup_aux:NNNN + { } #1 { } { } { } +} +\cs_generate_variant:Nn \_siunitx_number_format_group_integer_setup:n + { V } +\cs_set_protected:Npn + \_siunitx_number_format_group_integer_setup_aux:NNNN #1#2#3#4 { + \tl_if_empty:nTF {#2} + { \_siunitx_number_format_group_integer_aux:NNNN #1 \q_nil } + { + \tl_if_empty:nTF {#3} + { + \_siunitx_number_format_group_integer_aux:NNNN { } { } #1#2 + \q_nil + } + { + \tl_if_empty:nTF {#4} + { + \_siunitx_number_format_group_integer_aux:NNNN { } #1#2#3 + \q_nil + } + { + \_siunitx_number_format_group_integer_setup_aux:NNNN + {#1#2#3#4} + } + } + } +} +\cs_set_protected:Npn + \_siunitx_number_format_group_integer_aux:NNNN #1#2#3#4 { + \tl_put_right:Nn \_l_siunitx_tmpb_tl {#1#2#3} + \quark_if_nil:nF {#4} + { + \_siunitx_tl_put_right_math:NV \_l_siunitx_tmpb_tl + \_l_siunitx_group_sep_tl + \_siunitx_number_format_group_integer_aux:NNNN #4 + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_join_complex: { + \_siunitx_number_format_sign_complex: + \prop_if_in:NnT \_l_siunitx_number_out_prop { mantissa } + { + \_siunitx_number_format_brackets:n { mantissa } + \prop_get:NnN \_l_siunitx_number_out_prop { mantissa-result } + \_l_siunitx_tmpa_tl + \prop_get:NnN \_l_siunitx_number_out_prop { complex-result } + \_l_siunitx_tmpb_tl + \quark_if_no_value:NT \_l_siunitx_tmpb_tl + { + \prop_get:NnN \_l_siunitx_number_out_prop { complex } + \_l_siunitx_tmpb_tl + } + \tl_put_right:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop { mantissa-result } + \_l_siunitx_tmpa_tl + \prop_put:Nnn \_l_siunitx_number_out_prop { mantissa-bracket } + { true } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_join_uncert: { + \_siunitx_number_format_join_uncert:n { mantissa } + \_siunitx_number_format_join_uncert:n { complex } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_join_uncert:n #1 { + \prop_get:NnN \_l_siunitx_number_out_prop {#1} + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \prop_get:NnN \_l_siunitx_number_out_prop { #1 -uncertainty } + \_l_siunitx_tmpb_tl + \quark_if_no_value:NTF \_l_siunitx_tmpb_tl + { \_siunitx_number_format_copy:nn {#1} { #1 -result } } + { + \bool_if:NT \_l_siunitx_uncert_sep_bool + { \_siunitx_number_format_join_uncert_pm: } + \tl_put_right:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop { #1 -result } + \_l_siunitx_tmpa_tl + \prop_put:Nnn \_l_siunitx_number_out_prop { #1 -bracket } + { true } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_join_uncert_pm: { + \bool_if:NTF \_l_siunitx_tight_bool + { + \tl_put_left:Nn \_l_siunitx_tmpb_tl + { \_siunitx_ensuremath:n { { \pm } } } + } + { + \tl_put_left:Nn \_l_siunitx_tmpb_tl + { \_siunitx_ensuremath:n { { } \pm { } } } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_reassemble: { + \prop_if_in:NnT \_l_siunitx_number_in_prop { mantissa } + { + \_siunitx_number_format_group:n { mantissa } + \_siunitx_number_format_uncertainty:n { mantissa } + } + \prop_if_in:NnT \_l_siunitx_number_in_prop { complex } + { + \_siunitx_number_format_group:n { complex } + \_siunitx_number_format_uncertainty:n { complex } + } + \prop_if_in:NnT \_l_siunitx_number_in_prop { exponent } + { \_siunitx_number_format_group:n { exponent } } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_sign:n #1 { + \prop_if_in:NnT \_l_siunitx_number_out_prop {#1} + { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -sign } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \bool_if:NT \_l_siunitx_tight_bool + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { { \exp_not:V \_l_siunitx_tmpa_tl } } + } + \tl_clear:N \_l_siunitx_tmpb_tl + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpb_tl + \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_out_prop { #1 -sign } + \_l_siunitx_tmpb_tl + \prop_get:NnN \_l_siunitx_number_out_prop {#1} + \_l_siunitx_tmpa_tl + \tl_put_left:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop {#1} + \_l_siunitx_tmpa_tl + \prop_get:NnN \_l_siunitx_number_out_prop { #1 -result } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \tl_put_left:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop { #1 -result } + \_l_siunitx_tmpa_tl + } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_sign_complex: { + \_siunitx_number_format_sign_complex:n { complex } + \_siunitx_number_format_sign_complex:n { complex-result } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_sign_complex:n #1 { + \prop_if_in:NnT \_l_siunitx_number_out_prop {#1} + { + \prop_get:NnN \_l_siunitx_number_in_prop { complex-sign } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \bool_if:NTF \_l_siunitx_tight_bool + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { { \exp_not:V \_l_siunitx_tmpa_tl } } + } + { + \prop_if_in:NnT \_l_siunitx_number_out_prop { mantissa } + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { { } \exp_not:V \_l_siunitx_tmpa_tl { } } + } + } + \tl_clear:N \_l_siunitx_tmpb_tl + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpb_tl + \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_out_prop { complex-sign } + \_l_siunitx_tmpb_tl + \prop_get:NnN \_l_siunitx_number_out_prop {#1} + \_l_siunitx_tmpa_tl + \tl_put_left:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop {#1} + \_l_siunitx_tmpa_tl + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_format_uncertainty:n #1 { + \prop_if_in:NnTF \_l_siunitx_number_in_prop { #1 -uncertainty } + { + \bool_if:NTF \_l_siunitx_uncert_sep_bool + { \_siunitx_number_format_uncertainty_sep:n {#1} } + { \_siunitx_number_format_uncertainty_joined:n {#1} } + \_siunitx_number_format_join_uncert: + } + { \_siunitx_number_format_copy:nn {#1} { #1 -result } } +} +\cs_set_protected_nopar:Npn + \_siunitx_number_format_uncertainty_joined:n #1 { + \prop_get:NnN \_l_siunitx_number_in_prop { #1 -uncertainty } + \_l_siunitx_tmpa_tl + \prop_del:Nn \_l_siunitx_number_in_prop { #1 -uncertainty } + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_output_uncert_open_tl + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_uncert_sep_tl + \_siunitx_tl_put_right_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_output_uncert_close_tl + \prop_get:NnN \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpb_tl + \tl_put_right:NV \_l_siunitx_tmpb_tl \_l_siunitx_tmpa_tl + \prop_put:NnV \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpb_tl +} +\cs_set_protected_nopar:Npn + \_siunitx_number_format_uncertainty_sep:n #1 { + \prop_if_in:NnT \_l_siunitx_number_out_prop { #1 -integer } + { + \prop_if_in:NnF \_l_siunitx_number_out_prop + { #1 -uncertainty-integer } + { + \prop_put:Nnn \_l_siunitx_number_out_prop + { #1 -uncertainty-integer } { 0 } + } + } + \_siunitx_number_format_group:n { #1 -uncertainty } + \prop_put:NnV \_l_siunitx_number_out_prop { #1 -uncertainty } + \_l_siunitx_tmpa_tl +} +\tl_new:N \_l_siunitx_number_out_tl +\tl_new:N \_l_siunitx_number_out_saved_tl +\tl_new:N \_l_siunitx_number_fraction_tl +\bool_new:N \_l_siunitx_number_compound_bool +\tl_new:N \_l_siunitx_quotient_mode_tl +\cs_set_protected:Npn \_siunitx_fraction:nn { } +\keys_define:nn { siunitx } { + fraction-function .code:n = + { \cs_set_eq:NN \_siunitx_fraction:nn #1 }, + output-product .tl_set:N = \_l_siunitx_output_product_tl, + output-quotient .tl_set:N = \_l_siunitx_output_quotient_tl, + parse-numbers .bool_set:N = \_l_siunitx_number_parse_bool, + quotient-mode .choice:, + quotient-mode / fraction .code:n = + { \tl_set:Nn \_l_siunitx_quotient_mode_tl { fraction } }, + quotient-mode / symbol .code:n = + { \tl_set:Nn \_l_siunitx_quotient_mode_tl { symbol } }, +} +\keys_set:nn { siunitx } { + fraction-function = \frac, + output-product = \times, + output-quotient = /, + parse-numbers = true, + quotient-mode = symbol +} +\cs_set_protected:Npn \_siunitx_number_output:n #1 { + \tl_clear:N \_l_siunitx_unit_tl + \tl_clear:N \_l_siunitx_preunit_tl + \_siunitx_combined_output:n {#1} +} +\cs_generate_variant:Nn \_siunitx_number_output:n { V } +\cs_set_protected_nopar:Npn \_siunitx_number_output_bracket: { + \bool_if:NF \_l_siunitx_error_bool + { + \bool_if:NT \_l_siunitx_number_compound_bool + { \_siunitx_number_format_brackets:n { result } } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_color: { + \prop_if_in:NnT \_l_siunitx_number_out_prop { color } + { + \prop_get:NnN \_l_siunitx_number_out_prop { color } + \_l_siunitx_number_color_tl + } +} +\cs_set_protected:Npn \_siunitx_number_output_parse:n #1 { + \_siunitx_number_preprocess:n {#1} + \bool_if:NF \_l_siunitx_error_bool + { + \tl_if_empty:NTF \_l_siunitx_number_multi_tl + { \_siunitx_number_output_parse_aux: } + { + \use:c + { _siunitx_number_output_ \_l_siunitx_number_multi_tl : } + } + } +} +\cs_generate_variant:Nn \_siunitx_number_output_parse:n { V } +\cs_set_protected_nopar:Npn \_siunitx_number_output_parse_aux: { + \_siunitx_number_in_parse:V \_l_siunitx_number_arg_tl + \bool_if:NF \_l_siunitx_error_bool + { + \_siunitx_number_process: + \prop_if_in:NnT \_l_siunitx_number_in_prop { exponent } + { \bool_set_true:N \_l_siunitx_brackets_bool } + \_siunitx_number_format: + \_siunitx_number_output_color: + \bool_if:NTF \_l_siunitx_brackets_bool + { \_siunitx_number_output_single: } + { + \prop_if_in:NnTF \_l_siunitx_number_out_prop + { result-bracket } + { \_siunitx_number_output_parts: } + { \_siunitx_number_output_single: } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_parts: { + \bool_if:nTF + { + \tl_if_empty_p:N \_l_siunitx_pre_unit_tl && + \tl_if_empty_p:N \_l_siunitx_unit_tl + } + { \_siunitx_number_output_single: } + { \_siunitx_number_output_parts_aux: } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_parts_aux: { + \bool_if:NTF \_l_siunitx_multi_repeat_bool + { + \prop_if_in:NnT \_l_siunitx_number_out_prop { mantissa-result } + { + \_siunitx_number_output_parts_aux:n { mantissa } + \_siunitx_number_output_parts_aux:n { complex } + } + \prop_get:NnN \_l_siunitx_number_out_prop { exponent-result } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \prop_if_in:NnT \_l_siunitx_number_out_prop { mantissa-result } + { + \tl_set_eq:NN \_l_siunitx_tmpb_tl + \_l_siunitx_exponent_product_tl + \bool_if:NT \_l_siunitx_tight_bool + { + \tl_set:Nx \_l_siunitx_tmpb_tl + { { \exp_not:V \_l_siunitx_tmpb_tl } } + } + \_siunitx_tl_put_left_math:NV \_l_siunitx_tmpa_tl + \_l_siunitx_tmpb_tl + \prop_put:NnV \_l_siunitx_number_out_prop { exponent } + \_l_siunitx_tmpa_tl + } + \_siunitx_number_output_parts_print:n { exponent } + } + } + { \_siunitx_number_output_single: } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_parts_aux:n #1 { + \prop_if_in:NnT \_l_siunitx_number_out_prop {#1} + { \_siunitx_number_output_parts_print:n {#1} } + \prop_if_in:NnT \_l_siunitx_number_out_prop { #1 -uncertainty } + { + \bool_if:NTF \_l_siunitx_tight_bool + { + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { { \pm } } } + } + { + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { { } \pm { } } } + } + \_siunitx_number_output_parts_print:n { #1 -uncertainty } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_parts_print:n #1 { + \_siunitx_unit_output_pre_print: + \prop_get:NnN \_l_siunitx_number_out_prop {#1} \_l_siunitx_tmpa_tl + \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl + \_siunitx_unit_output_print: +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_product: { + \bool_if:NTF \_l_siunitx_product_brackets_bool + { + \bool_if:nTF + { + \tl_if_empty_p:N \_l_siunitx_pre_unit_tl && + \tl_if_empty_p:N \_l_siunitx_unit_tl + } + { \_siunitx_number_output_product_aux: } + { \_siunitx_number_output_product_brackets: } + } + { + \bool_if:NTF \_l_siunitx_product_repeat_bool + { \_siunitx_number_output_product_aux: } + { + \_siunitx_unit_output_pre_print: + \tl_set_eq:NN \_l_siunitx_unit_saved_tl \_l_siunitx_unit_tl + \tl_clear:N \_l_siunitx_pre_unit_tl + \tl_clear:N \_l_siunitx_unit_tl + \group_begin: + \_siunitx_number_output_product_aux: + \group_end: + \tl_set_eq:NN \_l_siunitx_unit_tl \_l_siunitx_unit_saved_tl + \_siunitx_unit_output_print: + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_product_brackets: { + \_siunitx_unit_output_pre_print: + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { \_l_siunitx_bracket_open_tl } } + \nobreak + \tl_set_eq:NN \_l_siunitx_unit_saved_tl \_l_siunitx_unit_tl + \tl_clear:N \_l_siunitx_pre_unit_tl + \tl_clear:N \_l_siunitx_unit_tl + \_siunitx_number_output_product_aux: + \nobreak + \tl_set_eq:NN \_l_siunitx_unit_tl \_l_siunitx_unit_saved_tl + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { \_l_siunitx_bracket_close_tl } } + \_siunitx_unit_output_print: +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_product_aux: { + \bool_set_true:N \_l_siunitx_number_compound_bool + \_siunitx_number_preprocess:V \_l_siunitx_number_arg_tl + \bool_if:NF \_l_siunitx_error_bool + { + \tl_if_empty:NTF \_l_siunitx_number_multi_tl + { \_siunitx_number_output_parse_aux: } + { \_siunitx_number_output_quotient: } + \tl_if_empty:NF \_l_siunitx_number_next_tl + { + \bool_if:NTF \_l_siunitx_tight_bool + { + \_siunitx_print:nn { number } + { + \_siunitx_ensuremath:n + { \_l_siunitx_output_product_tl } + } + } + { + \_siunitx_print:nn { number } + { + \_siunitx_ensuremath:n + { { } \_l_siunitx_output_product_tl { } } + } + } + \_siunitx_number_output_parse:V \_l_siunitx_number_next_tl + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_quotient: { + \use:c + { _siunitx_number_output_quotient_ \_l_siunitx_quotient_mode_tl : } +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_quotient_fraction: { + \bool_set_false:N \_l_siunitx_number_compound_bool + \_siunitx_number_output_quotient_aux_i: + \tl_set:Nx \_l_siunitx_number_out_tl + { { \exp_not:V \_l_siunitx_number_numerator_tl } } + \tl_set:Nx \_l_siunitx_tmpa_tl + { { \exp_not:V \_l_siunitx_number_denominator_tl } } + \tl_put_right:NV \_l_siunitx_number_out_tl \_l_siunitx_tmpa_tl + \tl_put_left:Nn \_l_siunitx_number_out_tl { \_siunitx_fraction:nn } + \tl_set:Nx \_l_siunitx_number_out_tl + { + \exp_not:N \ensuremath + { \exp_not:V \_l_siunitx_number_out_tl } + } + \_siunitx_number_output_single_aux: +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_quotient_symbol: { + \bool_set_true:N \_l_siunitx_number_compound_bool + \_siunitx_number_output_quotient_aux_i: + \tl_set_eq:NN \_l_siunitx_number_out_tl + \_l_siunitx_number_numerator_tl + \_siunitx_tl_put_right_math:NV \_l_siunitx_number_out_tl + \_l_siunitx_output_quotient_tl + \tl_put_right:NV \_l_siunitx_number_out_tl + \_l_siunitx_number_denominator_tl + \_siunitx_number_output_single_aux: +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_quotient_aux_i: { + \_siunitx_number_in_parse:V \_l_siunitx_number_numerator_tl + \_siunitx_number_output_quotient_aux_ii: + \_siunitx_number_output_color: + \prop_get:NnN \_l_siunitx_number_out_prop { result } + \_l_siunitx_number_numerator_tl + \_siunitx_number_in_parse:V \_l_siunitx_number_denominator_tl + \_siunitx_number_output_quotient_aux_ii: + \prop_if_in:NnT \_l_siunitx_number_out_prop + { result-bracket-exponent } + { + \prop_put:Nnn \_l_siunitx_number_out_prop { result-bracket } + { true } + } + \_siunitx_number_output_bracket: + \prop_get:NnN \_l_siunitx_number_out_prop { result } + \_l_siunitx_number_denominator_tl +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_quotient_aux_ii: { + \_siunitx_number_process: + \_siunitx_number_format: +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_single: { + \bool_if:nF + { + \tl_if_empty_p:N \_l_siunitx_pre_unit_tl && + \tl_if_empty_p:N \_l_siunitx_unit_tl + } + { + \prop_if_in:NnF \_l_siunitx_number_out_prop { exponent } + { \_siunitx_number_format_brackets:n { result } } + } + \_siunitx_number_output_bracket: + \prop_get:NnN \_l_siunitx_number_out_prop { result } + \_l_siunitx_number_out_tl + \_siunitx_number_output_single_aux: +} +\cs_set_protected_nopar:Npn \_siunitx_number_output_single_aux: { + \_siunitx_unit_output_pre_print: + \_siunitx_print:nV { number } \_l_siunitx_number_out_tl + \_siunitx_unit_output_print: +} +\bool_new:N \_l_siunitx_angle_degree_space_bool +\bool_new:N \_l_siunitx_angle_minute_space_bool +\box_new:N \_l_siunitx_angle_marker_box +\box_new:N \_l_siunitx_angle_unit_box +\dim_new:N \_l_siunitx_angle_marker_dim +\dim_new:N \_l_siunitx_angle_unit_dim +\prop_new:N \_l_siunitx_angle_degree_prop +\prop_new:N \_l_siunitx_angle_minute_prop +\prop_new:N \_l_siunitx_angle_second_prop +\keys_define:nn { siunitx } { + add-arc-degree-zero .bool_set:N = + \_l_siunitx_angle_degree_zero_bool , + add-arc-minute-zero .bool_set:N = + \_l_siunitx_angle_minute_zero_bool , + add-arc-second-zero .bool_set:N = + \_l_siunitx_angle_second_zero_bool , + angle-symbol-over-decimal .bool_set:N = + \_l_siunitx_angle_astronomy_bool , + arc-separator .tl_set:N = + \_l_siunitx_angle_arc_separator_tl , + number-angle-separator .tl_set:N = + \_l_siunitx_angle_unit_separator_tl , +} +\cs_set_protected:Npn \_siunitx_angle_output:nnn #1#2#3 { + \_siunitx_angle_init: + \IfNoValueTF {#2} + { + \bool_set_false:N \_l_siunitx_angle_minute_zero_bool + \bool_set_false:N \_l_siunitx_angle_second_zero_bool + \_siunitx_angle_output_aux:nnn {#1} { } { } + } + { + \IfNoValueTF {#3} + { \_siunitx_error:nn { invalid-arc-format } { #1 ; #2 } } + { \_siunitx_angle_output_aux:nnn {#1} {#2} {#3} } + } +} +\cs_set_protected:Npn \_siunitx_angle_output_aux:nnn #1#2#3 { + \tl_if_empty:nTF { #1#2#3 } + { \_siunitx_error:n { empty-arc } } + { + \bool_if:NTF \_l_siunitx_number_parse_bool + { \_siunitx_angle_parse:nnn {#1} {#2} {#3} } + { \_siunitx_angle_direct:nnn {#1} {#2} {#3} } + } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_init: { + \bool_set_false:N \_l_siunitx_angle_degree_space_bool + \bool_set_false:N \_l_siunitx_angle_minute_space_bool + \prop_clear:N \_l_siunitx_angle_degree_prop + \prop_clear:N \_l_siunitx_angle_minute_prop + \prop_clear:N \_l_siunitx_angle_second_prop + \tl_clear:N \_l_siunitx_preunit_tl + \tl_set_eq:NN \_l_siunitx_number_unit_separator_tl + \_l_siunitx_angle_unit_separator_tl + \cs_set_eq:NN \_siunitx_number_in_parse_more:N + \_siunitx_number_in_parse_restricted:N +} +\cs_set_protected:Npn \_siunitx_angle_direct:nnn #1 { + \tl_if_empty:nTF {#1} + { + \bool_if:NTF \_l_siunitx_angle_degree_zero_bool + { \_siunitx_angle_direct_aux_i:nnn { 0 } } + { \_siunitx_angle_direct_aux_i:nnn { } } + } + { \_siunitx_angle_direct_aux_i:nnn {#1} } + +} +\cs_set_protected:Npn \_siunitx_angle_direct_aux_i:nnn #1#2 { + \tl_if_empty:nTF {#2} + { + \bool_if:NTF \_l_siunitx_angle_minte_zero_bool + { \_siunitx_angle_direct_aux_ii:nnn {#1} { 0 } } + { \_siunitx_angle_direct_aux_ii:nnn {#1} { } } + } + { \_siunitx_angle_direct_aux_ii:nnn {#1} {#2} } + +} +\cs_set_protected:Npn \_siunitx_angle_direct_aux_ii:nnn #1#2#3 { + \tl_if_empty:nTF {#3} + { + \bool_if:NTF \_l_siunitx_angle_second_zero_bool + { \_siunitx_angle_direct_aux_iii:nnn {#1} {#2} { 0 } } + { \_siunitx_angle_direct_aux_iii:nnn {#1} {#2} { } } + } + { \_siunitx_angle_direct_aux_iii:nnn {#1} {#2} {#3} } +} +\cs_set_protected:Npn \_siunitx_angle_direct_aux_iii:nnn #1#2#3 { + \tl_if_empty:nF {#1} + { + \tl_if_empty:nF {#2#3} + { \bool_set_true:N \_l_siunitx_angle_degree_space_bool } + } + \tl_if_empty:nF {#2} + { + \tl_if_empty:nF {#3} + { \bool_set_true:N \_l_siunitx_angle_minute_space_bool } + } + \_siunitx_angle_print_direct:nnn {#1} {#2} {#3} +} +\cs_set_protected:Npn \_siunitx_angle_parse:nnn #1#2#3 { + \_siunitx_angle_parse_aux:nn {#1} { degree } + \_siunitx_angle_parse_aux:nn {#2} { minute } + \_siunitx_angle_parse_aux:nn {#3} { second } + \_siunitx_angle_check_sign: + \_siunitx_angle_zero_fill: + \prop_if_empty:NF \_l_siunitx_angle_degree_prop + { + \prop_if_empty:NF \_l_siunitx_angle_minute_prop + { \bool_set_true:N \_l_siunitx_angle_degree_space_bool } + \prop_if_empty:NF \_l_siunitx_angle_second_prop + { \bool_set_true:N \_l_siunitx_angle_degree_space_bool } + } + \prop_if_empty:NF \_l_siunitx_angle_minute_prop + { + \prop_if_empty:NF \_l_siunitx_angle_second_prop + { \bool_set_true:N \_l_siunitx_angle_minute_space_bool } + } + \_siunitx_angle_print: +} +\cs_set_protected:Npn \_siunitx_angle_parse_aux:nn #1#2 { + \prop_clear:N \_l_siunitx_number_in_prop + \tl_if_empty:nF {#1} + { + \_siunitx_number_in_init: + \_siunitx_number_in_parse_aux:n {#1} + } + \prop_get:NnN \_l_siunitx_number_in_prop { mantissa-sign-deleted } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \prop_put:NnV \_l_siunitx_number_in_prop { mantissa-sign } + \_l_siunitx_tmpa_tl + } + \_siunitx_number_process: + \prop_set_eq:cN { _l_siunitx_angle_ #2 _prop } + \_l_siunitx_number_in_prop +} +\cs_set_protected_nopar:Npn \_siunitx_angle_check_sign: { + \prop_if_empty:NTF \_l_siunitx_angle_degree_prop + { + \prop_if_empty:NF \_l_siunitx_angle_minute_prop + { \_siunitx_angle_check_sign_aux:n { second } } + } + { + \_siunitx_angle_check_sign_aux:n { minute } + \_siunitx_angle_check_sign_aux:n { second } + } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_check_sign_aux:n #1 { + \prop_if_in:cnTF { _l_siunitx_angle_ #1 _prop } + { mantissa-sign } + { \msg_error:nn { siunitx } { bad-arc-sign } } + { + \prop_if_in:cnT { _l_siunitx_angle_ #1 _prop } + { mantissa-sign-deleted } + { \msg_error:nn { siunitx } { bad-arc-sign } } + } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_zero_fill: { + \bool_if:nT + { + \prop_if_empty_p:N \_l_siunitx_angle_second_prop && + \_l_siunitx_angle_second_zero_bool + } + { + \prop_put:Nnn \_l_siunitx_angle_second_prop { mantissa } + { true } + \prop_put:Nnn \_l_siunitx_angle_second_prop { mantissa-integer } + { 0 } + } + \bool_if:nT + { + \prop_if_empty_p:N \_l_siunitx_angle_minute_prop && + \_l_siunitx_angle_minute_zero_bool + } + { + \prop_put:Nnn \_l_siunitx_angle_minute_prop { mantissa } + { true } + \prop_put:Nnn \_l_siunitx_angle_minute_prop { mantissa-integer } + { 0 } + \_siunitx_angle_sign_shuffle:nn { second } { minute } + } + \bool_if:nT + { + \prop_if_empty_p:N \_l_siunitx_angle_degree_prop && + \_l_siunitx_angle_degree_zero_bool + } + { + \prop_put:Nnn \_l_siunitx_angle_degree_prop { mantissa } + { true } + \prop_put:Nnn \_l_siunitx_angle_degree_prop { mantissa-integer } + { 0 } + \_siunitx_angle_sign_shuffle:nn { second } { degree } + \_siunitx_angle_sign_shuffle:nn { minute } { degree } + } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_sign_shuffle:nn #1#2 { + \_siunitx_angle_sign_shuffle_aux:nnn {#1} {#2} { } + \_siunitx_angle_sign_shuffle_aux:nnn {#1} {#2} { -deleted } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_sign_shuffle_aux:nnn + #1#2#3 { + \prop_get:cnN { _l_siunitx_angle_ #1 _prop } { mantissa-sign #3 } + \_l_siunitx_tmpa_tl + \prop_del:cn { _l_siunitx_angle_ #1 _prop } { mantissa-sign #3 } + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \prop_put:cnV { _l_siunitx_angle_ #2 _prop } { mantissa-sign #3 } + \_l_siunitx_tmpa_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print: { + \_siunitx_angle_print_aux:nn { degree } { \SIUnitSymbolDegree } + \bool_if:NT \_l_siunitx_angle_degree_space_bool + { + \nobreak + \_siunitx_ensuremath:n { \_l_siunitx_angle_arc_separator_tl } + } + \_siunitx_angle_print_aux:nn { minute } { \SIUnitSymbolArcminute } + \bool_if:NT \_l_siunitx_angle_minute_space_bool + { + \nobreak + \_siunitx_ensuremath:n { \_l_siunitx_angle_arc_separator_tl } + } + \_siunitx_angle_print_aux:nn { second } { \SIUnitSymbolArcsecond } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print_aux:nn #1#2 { + \prop_if_empty:cF { _l_siunitx_angle_ #1 _prop } + { + \prop_set_eq:Nc \_l_siunitx_number_in_prop + { _l_siunitx_angle_ #1 _prop } + \tl_set:Nn \_l_siunitx_unit_tl {#2} + \tl_clear:N \_l_siunitx_number_out_tl + \_siunitx_number_format: + \_siunitx_number_output_color: + \bool_if:NTF \_l_siunitx_angle_astronomy_bool + { \_siunitx_angle_print_astronomy: } + { \_siunitx_number_output_single: } + } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print_astronomy: { + \prop_if_in:NnTF \_l_siunitx_number_in_prop + { mantissa-decimal-marker } + { \_siunitx_angle_print_astronomy_aux: } + { \_siunitx_number_output_single: } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print_astronomy_aux: { + \prop_get:NnN \_l_siunitx_number_out_prop { mantissa-integer } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl } + \hbox_set:Nn \_l_siunitx_angle_marker_box + { + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { { \_l_siunitx_output_decimal_tl } } } + } + \hbox_set:Nn \_l_siunitx_angle_unit_box + { + \_siunitx_print:nV { unit } \_l_siunitx_unit_tl + \skip_horizontal:n { -\scriptspace } + } + \_siunitx_angle_print_astronomy_aux:n { marker } + \_siunitx_angle_print_astronomy_aux:n { unit } + \hbox_set:Nn \_l_siunitx_angle_marker_box + { + \box_use:N \_l_siunitx_angle_marker_box + \box_use:N \_l_siunitx_angle_unit_box + } + \dim_compare:nNnTF + { \_l_siunitx_angle_marker_dim } > { \_l_siunitx_angle_unit_dim } + { \_siunitx_angle_print_astronomy_marker: } + { \_siunitx_angle_print_astronomy_unit: } + \prop_get:NnN \_l_siunitx_number_out_prop { mantissa-decimal } + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print_astronomy_aux:n #1 { + \dim_set:cn { _l_siunitx_angle_ #1 _dim } + { \box_wd:c { _l_siunitx_angle_ #1 _box } } + \hbox_set_to_wd:cnn { _l_siunitx_angle_ #1 _box } { \c_zero_skip } + { + \tex_hss:D + \hbox_unpack:c { _l_siunitx_angle_ #1_box } + \tex_hss:D + } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print_astronomy_marker: { + \hbox_set_to_wd:Nnn \_l_siunitx_angle_marker_box + { \_l_siunitx_angle_marker_dim } + { + \tex_hss:D + \hbox_unpack_clear:N \_l_siunitx_angle_marker_box + \tex_hss:D + } + \box_use:N \_l_siunitx_angle_marker_box +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print_astronomy_unit: { + \hbox_set_to_wd:Nnn \_l_siunitx_angle_marker_box + { \_l_siunitx_angle_unit_dim } + { + \tex_hss:D + \hbox_unpack_clear:N \_l_siunitx_angle_marker_box + \tex_hss:D + } + \box_use:N \_l_siunitx_angle_marker_box + \skip_horizontal:N \scriptspace +} +\cs_set_protected:Npn \_siunitx_angle_print_direct:nnn #1#2#3 { + \_siunitx_angle_print_direct_aux:nn {#1} { \SIUnitSymbolDegree } + \bool_if:NT \_l_siunitx_angle_degree_space_bool + { + \nobreak + \_siunitx_ensuremath:n { \_l_siunitx_angle_arc_separator_tl } + } + \_siunitx_angle_print_direct_aux:nn {#2} { \SIUnitSymbolArcminute } + \bool_if:NT \_l_siunitx_angle_minute_space_bool + { + \nobreak + \_siunitx_ensuremath:n { \_l_siunitx_angle_arc_separator_tl } + } + \_siunitx_angle_print_direct_aux:nn {#3} { \SIUnitSymbolArcsecond } +} +\cs_set_protected_nopar:Npn \_siunitx_angle_print_direct_aux:nn #1#2 { + \tl_if_empty:nF {#1} + { + \tl_set:Nn \_l_siunitx_unit_tl {#2} + \_siunitx_print:nn { number } { \_siunitx_ensuremath:n {#1} } + \_siunitx_unit_output_print: + } +} +\tl_new:N \_l_siunitx_declare_list_tl +\tl_set:Nn \_l_siunitx_declare_list_tl { \of \per \raiseto \tothe } +\cs_set_protected:Npn \_siunitx_declare_power_after:Nn #1#2 { + \tl_put_right:Nn \_l_siunitx_declare_list_tl {#1} + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _literal:w } + { \textsuperscript {#2} } + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _function:w } + { \_siunitx_unit_parse_power_after:n {#2} } +} +\cs_set_protected:Npn \_siunitx_declare_power_before:Nn #1#2 { + \tl_put_right:Nn \_l_siunitx_declare_list_tl {#1} + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _literal:w } ##1 + { ##1 \textsuperscript {#2} } + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _function:w } + { \_siunitx_unit_parse_power_before:n {#2} } +} +\cs_set_protected:Npn \_siunitx_declare_prefix:Nnnn #1#2#3#4 { + \tl_put_right:Nn \_l_siunitx_declare_list_tl {#1} + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _literal:w } {#2} + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _function:w } + { + \bool_if:NTF \_l_siunitx_prefix_symbols_bool + { \_siunitx_unit_parse_prefix:n {#2} } + { \_siunitx_unit_parse_prefix:nn {#3} {#4} } + } +} +\cs_set_protected:Npn \_siunitx_declare_qualifier:Nn #1#2 { + \tl_put_right:Nn \_l_siunitx_declare_list_tl {#1} + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _literal:w } + { \text { ~ } ( #2 ) } + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _function:w } + { \_siunitx_unit_parse_qualifier:n {#2} } +} +\cs_set_protected:Npn \_siunitx_declare_unit:Nnn #1#2#3 { + \tl_put_right:Nn \_l_siunitx_declare_list_tl {#1} + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _literal:w } {#2} + \cs_set:cpn { _siunitx_ \token_to_str:N #1 _function:w } + { + \cs_if_exist:cTF + { _siunitx_ \_siunitx_unit_first_token:n {#2} _function:w } + {#2} + { \_siunitx_unit_parse_unit:Nn #1 {#2} } + } + \tl_if_empty:nTF {#3} + { + \cs_if_free:cF { _l_siunitx_ \token_to_str:N #1 _options_tl } + { + \cs_gundefine:c { _l_siunitx_ \token_to_str:N #1 _options_tl } + } + } + { + \cs_if_free:cT { _l_siunitx_ \token_to_str:N #1 _options_tl } + { \tl_new:c { _l_siunitx_ \token_to_str:N #1 _options_tl } } + \tl_set:cn { _l_siunitx_ \token_to_str:N #1 _options_tl } {#3} + } +} +\cs_set_protected:Npn \_siunitx_unit_first_token:n #1 { + \exp_after:wN \token_to_str:N \tl_head_i:w #1 \q_nil +} +\cs_set:cpn { _siunitx_ \token_to_str:N \per _literal:w } { / } +\cs_set_protected:cpn { _siunitx_ \token_to_str:N \per _function:w } { + \bool_set_true:N \_l_siunitx_per_bool + \_siunitx_unit_parse_per: +} +\cs_set:cpn { _siunitx_ \token_to_str:N \raiseto _literal:w } #1#2 { + #2 + \textsuperscript {#1} +} +\cs_set_protected:cpn { _siunitx_ \token_to_str:N \raiseto _function:w } + #1 { + \_siunitx_unit_parse_power_before:n {#1} +} +\cs_set:cpn { _siunitx_ \token_to_str:N \tothe _literal:w } #1 { + \textsuperscript {#1} +} +\cs_set_protected:cpn { _siunitx_ \token_to_str:N \tothe _function:w } + #1 { + \_siunitx_unit_parse_power_after:n {#1} +} +\cs_set_protected:cpn { _siunitx_ \token_to_str:N \of _literal:w } #1 { + \text { ~ } ( #1 ) +} +\cs_set_protected:cpn { _siunitx_ \token_to_str:N \of _function:w } #1 { + \_siunitx_unit_parse_qualifier:n {#1} +} +\keys_define:nn { siunitx } { + free-standing-units .bool_set:N = \_l_siunitx_create_free_bool, + overwrite-functions .bool_set:N = + \_l_siunitx_create_overwrite_bool, + space-before-unit .bool_set:N = \_l_siunitx_create_prespace_bool, + unit-optional-argument .bool_set:N = \_l_siunitx_create_optional_bool, + use-xspace .bool_set:N = \_l_siunitx_create_xspace_bool +} +\_siunitx_option_deactivate:n { + free-standing-units, + overwrite-functions, + space-before-unit, + unit-optional-argument, + use-xspace +} +\AtBeginDocument { + \bool_if:NTF \_l_siunitx_create_free_bool + { \_siunitx_unit_create_functions: } + { \_siunitx_unit_create_empty_functions: } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_create_empty_functions: { + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_unit_create_empty_functions_aux:N +} +\cs_set_protected_nopar:Npn + \_siunitx_unit_create_empty_functions_aux:N #1 { + \cs_if_free:NT #1 { \cs_set_protected_nopar:Npn #1 { \ERROR } } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_create_functions: { + \bool_if:NT \_l_siunitx_create_overwrite_bool + { \tl_map_function:NN \_l_siunitx_declare_list_tl \cs_gundefine:N } + \bool_if:NTF \_l_siunitx_create_optional_bool + { + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_unit_create_with_arg:N + } + { + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_unit_create:N + } + \bool_if:NT \_l_siunitx_create_xspace_bool + { \RequirePackage { xspace } } +} +\cs_set_protected:Npn \_siunitx_unit_create:N #1 { + \cs_if_free:NT #1 + { + \cs_set:Npx \_siunitx_tmp:w + { + \ProvideDocumentCommand \exp_not:N #1 { } + { + \bool_if:NT \_l_siunitx_create_prespace_bool + { + \exp_not:n + { + \_siunitx_ensuremath:n + { \_l_siunitx_number_unit_sep_tl } + } + } + \exp_not:n { \_siunitx_unit_in:nn {#1} { } } + \bool_if:NT \_l_siunitx_create_xspace_bool + { \exp_not:N \xspace } + } + } + \_siunitx_tmp:w + } +} +\cs_set_protected:Npn \_siunitx_unit_create_with_arg:N #1 { + \cs_if_free:NT #1 + { + \cs_set:Npx \_siunitx_tmp:w + { + \ProvideDocumentCommand \exp_not:N #1 { o } + { + \exp_not:N \IfNoValueTF {####1} + { \exp_not:n { \_siunitx_unit_in:nn {#1} { } } } + { + \bool_if:NT \_l_siunitx_create_prespace_bool + { + \exp_not:n + { + \_siunitx_ensuremath:n + { \_l_siunitx_number_unit_sep_tl } + } + } + \SI {####1} { \exp_not:N #1 } + } + \bool_if:NT \_l_siunitx_create_xspace_bool + { \exp_not:N \xspace } + } + } + \_siunitx_tmp:w + } +} +\AtBeginDocument { + \tl_map_function:nN { \bar \color \ng \pm } + \_siunitx_protect_symbols:N +} +\cs_set_protected_nopar:Npn \_siunitx_protect_symbols:N #1 { + \cs_if_exist:NT #1 + { + \_siunitx_cs_if_macro:NT #1 + { \cs_set_protected_nopar:Npx #1 { \exp_not:V #1 } } + } +} +\keys_define:nn { siunitx } { + forbid-literal-units .bool_set:N = + \_l_siunitx_unit_forbid_literal_bool, + parse-units .bool_set:N = \_l_siunitx_unit_parse_bool +} +\keys_set:nn { siunitx } { + forbid-literal-units = false, + parse-units = true +} +\cs_set_protected:Npn \_siunitx_unit_in:nn #1#2 { + \bool_if:NTF \_l_siunitx_unit_parse_bool + { + \tl_if_empty:nF {#1} + { + \_siunitx_unit_if_literal:nTF {#1} + { + \bool_if:NTF \_l_siunitx_unit_forbid_literal_bool + { \msg_error:nnx { siunitx } { literal-unit } {#1} } + { \_siunitx_unit_format_literal:n {#1} } + } + { + \bool_if:NT \_l_siunitx_per_auto_bool + { + \tl_set:Nn \_l_siunitx_per_mode_tl { symbol } + \mode_if_inner:F + { + \mode_if_math:T + { + \tl_set:Nn \_l_siunitx_per_mode_tl + { fraction } + } + } + } + \_siunitx_unit_parse:nn {#1} {#2} + \_siunitx_unit_format: + } + } + } + { \_siunitx_unit_format_literal:n {#1} } +} +\cs_generate_variant:Nn \_siunitx_unit_in:nn { Vn } +\cs_set_protected:Npn \_siunitx_unit_if_literal:nTF #1#2#3 { + \group_begin: + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_unit_if_literal_aux:N + \cs_set_eq:NN \of \use_none:n + \cs_set_eq:NN \raiseto \use_none:n + \cs_set_eq:NN \tothe \use_none:n + \protected@edef \_l_siunitx_tmpa_tl {#1} + \exp_args:NNNV \group_end: + \tl_set:Nn \_l_siunitx_tmpa_tl \_l_siunitx_tmpa_tl + \tl_if_empty:NTF \_l_siunitx_tmpa_tl {#3} {#2} +} +\cs_set_protected:Npn \_siunitx_unit_if_literal_aux:N #1 { + \cs_set_eq:NN #1 \prg_do_nothing: +} +\int_new:N \_l_siunitx_unit_int +\prop_new:N \_l_siunitx_unit_prop +\bool_new:N \_l_siunitx_per_bool +\keys_define:nn { siunitx } { + prefixes-as-symbols .bool_set:N = \_l_siunitx_prefix_symbols_bool, + sticky-per .bool_set:N = \_l_siunitx_sticky_per_bool, +} +\keys_set:nn { siunitx } { + prefixes-as-symbols = true +} +\cs_set_protected:Npn \_siunitx_unit_parse:nn #1#2 { + \_siunitx_unit_parse_init: + \_siunitx_unit_parse_options:nn {#1} {#2} + #1 + \cs_set_eq:NN \pm \_siunitx_pm: +} +\cs_set_protected_nopar:Npn \_siunitx_unit_parse_init: { + \prop_clear:N \_l_siunitx_unit_prop + \int_zero:N \_l_siunitx_unit_int + \bool_set_false:N \_l_siunitx_per_bool + \cs_set_eq:NN \_siunitx_pm: \pm + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_unit_parse_init_aux:N +} +\cs_set_protected:Npn \_siunitx_unit_parse_init_aux:N #1 { + \cs_set_eq:Nc #1 { _siunitx_ \token_to_str:N #1 _function:w } +} +\cs_set_protected_nopar:Npn \_siunitx_pm: { } +\cs_set_protected:Npn \_siunitx_unit_parse_options:nn #1#2 { + \cs_if_free:cF + { _l_siunitx_ \_siunitx_unit_first_token:n {#1} _options_tl } + { + \keys_set:nv { siunitx } + { _l_siunitx_ \_siunitx_unit_first_token:n {#1} _options_tl } + \keys_set:nn { siunitx } {#2} + } +} +\cs_set_protected:Npn \_siunitx_unit_parse_power_before:n #1 { + \tl_set:Nx \_l_siunitx_tmpa_tl + { power- \intexpr_eval:n { \_l_siunitx_unit_int + 1 } } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl {#1} +} +\cs_set_protected:Npn \_siunitx_unit_parse_power_after:n #1 { + \tl_set:Nx \_l_siunitx_tmpa_tl + { power- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl {#1} +} +\cs_set_protected:Npn \_siunitx_unit_parse_prefix:n #1 { + \int_incr:N \_l_siunitx_unit_int + \tl_set:Nx \_l_siunitx_tmpa_tl + { prefix- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl {#1} +} +\cs_set_protected:Npn \_siunitx_unit_parse_prefix:nn #1#2 { + \_siunitx_unit_parse_prefix:n {#2} + \tl_set:Nx \_l_siunitx_tmpa_tl + { prefix-base- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl {#1} +} +\cs_set_protected_nopar:Npn \_siunitx_unit_parse_per: { + \tl_set:Nx \_l_siunitx_tmpa_tl + { per- \intexpr_eval:n { \_l_siunitx_unit_int + 1 } } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl { true } + \bool_if:NT \_l_siunitx_sticky_per_bool + { \cs_set_eq:NN \per \_siunitx_unit_parse_per_error: } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_parse_per_error: { + \msg_error:nn { siunitx } { duplicate-sticky-per } +} +\cs_set_protected:Npn \_siunitx_unit_parse_qualifier:n #1 { + \tl_set:Nx \_l_siunitx_tmpa_tl + { symbol- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVF \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { \msg_error:nn { siunitx } { qualifier-before-unit } } + \tl_set:Nx \_l_siunitx_tmpa_tl + { qualifier- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl {#1} +} +\cs_set_protected:Npn \_siunitx_unit_parse_unit:Nn #1#2 { + \tl_set:Nx \_l_siunitx_tmpa_tl + { prefix- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVTF \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { symbol- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVT \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { \int_incr:N \_l_siunitx_unit_int } + } + { \int_incr:N \_l_siunitx_unit_int } + \tl_set:Nx \_l_siunitx_tmpa_tl + { unit- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl {#1} + \tl_set:Nx \_l_siunitx_tmpa_tl + { symbol- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl {#2} + \_siunitx_unit_parse_unit_per: +} +\cs_set_protected_nopar:Npn \_siunitx_unit_parse_unit_per: { + \bool_if:NT \_l_siunitx_sticky_per_bool + { + \bool_if:NT \_l_siunitx_per_bool + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { per- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { true } + } + } +} +\tl_new:N \_l_siunitx_preunit_tl +\tl_new:N \_l_siunitx_unit_tl +\tl_new:N \_l_siunitx_unit_current_tl +\tl_new:N \_l_siunitx_unit_denominator_tl +\tl_new:N \_l_siunitx_unit_numerator_tl +\tl_new:N \_l_siunitx_unit_saved_tl +\int_new:N \_l_siunitx_unit_denominator_int +\int_new:N \_l_siunitx_unit_numerator_int +\int_new:N \_l_siunitx_unit_prefix_int +\int_new:N \_l_siunitx_unit_prefix_base_int +\tl_new:N \_l_siunitx_unit_prefix_current_tl +\int_new:N \_l_siunitx_unit_prefix_gram_int +\bool_new:N \_l_siunitx_per_auto_bool +\bool_new:N \_l_siunitx_per_fraction_bool +\tl_new:N \_l_siunitx_per_mode_tl +\bool_new:N \_l_siunitx_two_parts_bool +\tl_new:N \_l_siunitx_qualifier_mode_tl +\keys_define:nn { siunitx } { + bracket-unit-denominator .bool_set:N + = \_l_siunitx_unit_denominator_bracket_bool, + inter-unit-separator .tl_set:N = \_l_siunitx_unit_separator_tl , + per-mode .choice:, + per-mode / fraction .code:n = + { + \bool_set_false:N \_l_siunitx_per_auto_bool + \bool_set_true:N \_l_siunitx_per_fraction_bool + \bool_set_true:N \_l_siunitx_per_two_parts_bool + \tl_set:Nn \_l_siunitx_per_mode_tl { fraction } + }, + per-mode / power .meta:n = { per-mode = reciprocal } , + per-mode / power-positive-first .meta:n = + { per-mode = reciprocal-positive-first } , + per-mode / reciprocal .code:n = + { + \bool_set_false:N \_l_siunitx_per_auto_bool + \bool_set_false:N \_l_siunitx_per_fraction_bool + \bool_set_false:N \_l_siunitx_per_two_parts_bool + \tl_clear:N \_l_siunitx_per_mode_tl + }, + per-mode / reciprocal-positive-first .code:n = + { + \bool_set_false:N \_l_siunitx_per_auto_bool + \bool_set_false:N \_l_siunitx_per_fraction_bool + \bool_set_true:N \_l_siunitx_per_two_parts_bool + \tl_clear:N \_l_siunitx_per_mode_tl + }, + per-mode / repeated-symbol .code:n = + { + \bool_set_false:N \_l_siunitx_per_auto_bool + \bool_set_false:N \_l_siunitx_per_fraction_bool + \bool_set_false:N \_l_siunitx_per_two_parts_bool + \tl_set:Nn \_l_siunitx_per_mode_tl { repeat } + }, + per-mode / symbol .code:n = + { + \bool_set_false:N \_l_siunitx_per_auto_bool + \bool_set_true:N \_l_siunitx_per_fraction_bool + \bool_set_true:N \_l_siunitx_per_two_parts_bool + \tl_set:Nn \_l_siunitx_per_mode_tl { symbol } + }, + per-mode / symbol-or-fraction .code:n = + { + \bool_set_true:N \_l_siunitx_per_auto_bool + \bool_set_true:N \_l_siunitx_per_fraction_bool + \bool_set_true:N \_l_siunitx_per_two_parts_bool + }, + per-symbol .tl_set:N = \_l_siunitx_per_symbol_tl, + qualifier-mode .choice:, + qualifier-mode / brackets .code:n = + { \tl_set:Nn \_l_siunitx_qualifier_mode_tl { brackets } }, + qualifier-mode / space .code:n = + { \tl_set:Nn \_l_siunitx_qualifier_mode_tl { space } }, + qualifier-mode / subscript .code:n = + { \tl_set:Nn \_l_siunitx_qualifier_mode_tl { subscript } }, +} +\keys_set:nn { siunitx } { + bracket-unit-denominator = true, + inter-unit-separator = \,, + per-mode = reciprocal, + per-symbol = /, + qualifier-mode = subscript +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format: { + \_siunitx_unit_format_init: + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_unit_int } = { 1 } + { + \tl_if_eq:VnT \_l_siunitx_per_mode_tl { symbol } + { + \prop_if_in:NnT \_l_siunitx_unit_prop { per-1 } + { \tl_clear:N \_l_siunitx_number_unit_separator_tl } + } + } + \intexpr_while_do:nNnn + { \int_use:N \_l_siunitx_unit_int } > { 0 } + { + \_siunitx_unit_format_prefix: + \_siunitx_unit_format_symbol: + \_siunitx_unit_format_qualifier: + \_siunitx_unit_format_power: + \_siunitx_unit_format_add: + \int_decr:N \_l_siunitx_unit_int + } + \bool_if:NT \_l_siunitx_per_two_parts_bool + { + \bool_if:NTF \_l_siunitx_per_fraction_bool + { \_siunitx_unit_format_fraction: } + { \_siunitx_unit_format_sorted: } + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_add: { + \bool_if:NTF \_l_siunitx_per_two_parts_bool + { + \tl_set:Nx \_l_siunitx_tmpb_tl + { per- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVTF \_l_siunitx_unit_prop \_l_siunitx_tmpb_tl + { + \_siunitx_unit_format_add_aux:n { _denominator } + \int_incr:N \_l_siunitx_unit_denominator_int + } + { + \_siunitx_unit_format_add_aux:n { _numerator } + \int_incr:N \_l_siunitx_unit_numerator_int + } + } + { \_siunitx_unit_format_add_aux:n { } } + \tl_clear:N \_l_siunitx_unit_current_tl +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_add_aux:n #1 { + \tl_if_empty:cF { _l_siunitx_unit #1 _tl } + { + \tl_if_eq:nVTF { repeat } \_l_siunitx_per_mode_tl + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { per- \intexpr_eval:n { \_l_siunitx_unit_int + 1 } } + \prop_if_in:NVF \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_current_tl + \_l_siunitx_unit_separator_tl + } + } + { + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_current_tl + \_l_siunitx_unit_separator_tl + } + } + \tl_put_left:cV { _l_siunitx_unit #1 _tl } \_l_siunitx_unit_current_tl +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_fraction: { + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_unit_denominator_int } > { 0 } + { + \use:c + { _siunitx_unit_format_fraction_ \_l_siunitx_per_mode_tl : } + } + { \tl_set_eq:NN \_l_siunitx_unit_tl \_l_siunitx_unit_numerator_tl } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_fraction_fraction: { + \tl_if_empty:NT \_l_siunitx_unit_numerator_tl + { \tl_set:Nn \_l_siunitx_unit_numerator_tl { 1 } } + \tl_set:Nx \_l_siunitx_unit_numerator_tl + { { \exp_not:V \_l_siunitx_unit_numerator_tl } } + \tl_put_left:Nn \_l_siunitx_unit_numerator_tl + { \_siunitx_print:nn { unit } } + \tl_set:Nx \_l_siunitx_unit_numerator_tl + { { \exp_not:V \_l_siunitx_unit_numerator_tl } } + \tl_set:Nx \_l_siunitx_unit_denominator_tl + { { \exp_not:V \_l_siunitx_unit_denominator_tl } } + \tl_put_left:Nn \_l_siunitx_unit_denominator_tl + { \_siunitx_print:nn { unit } } + \tl_set:Nx \_l_siunitx_unit_denominator_tl + { { \exp_not:V \_l_siunitx_unit_denominator_tl } } + \tl_set:Nn \_l_siunitx_unit_tl { \_siunitx_fraction:nn } + \tl_put_right:NV \_l_siunitx_unit_tl \_l_siunitx_unit_numerator_tl + \tl_put_right:NV \_l_siunitx_unit_tl \_l_siunitx_unit_denominator_tl + \tl_set:Nx \_l_siunitx_unit_tl + { \exp_not:N \ensuremath { \exp_not:V \_l_siunitx_unit_tl } } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_fraction_symbol: { + \_siunitx_unit_format_fraction_symbol_aux: + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_unit_denominator_int } > { 1 } + { + \bool_if:NT \_l_siunitx_unit_denominator_bracket_bool + { + \_siunitx_tl_put_left_math:NV \_l_siunitx_unit_denominator_tl + \_l_siunitx_bracket_open_tl + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_denominator_tl + \_l_siunitx_bracket_close_tl + } + } + \tl_set_eq:NN \_l_siunitx_unit_tl \_l_siunitx_unit_numerator_tl + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_tl + \_l_siunitx_per_symbol_tl + \tl_put_right:NV \_l_siunitx_unit_tl \_l_siunitx_unit_denominator_tl +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_fraction_symbol_aux: { +} +\cs_set_protected_nopar:Npn + \_siunitx_unit_format_fraction_symbol_aux_alt: { + \tl_if_empty:NT \_l_siunitx_unit_numerator_tl + { \tl_set:Nn \_l_siunitx_unit_numerator_tl { 1 } } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_init: { + \tl_clear:N \_l_siunitx_unit_tl + \tl_clear:N \_l_siunitx_unit_current_tl + \tl_clear:N \_l_siunitx_unit_denominator_tl + \int_zero:N \_l_siunitx_unit_prefix_gram_int + \tl_clear:N \_l_siunitx_unit_numerator_tl + \int_zero:N \_l_siunitx_unit_prefix_base_int + \int_zero:N \_l_siunitx_unit_prefix_int + \int_zero:N \_l_siunitx_unit_denominator_int + \int_zero:N \_l_siunitx_unit_numerator_int +} +\char_make_active:N \~ +\cs_set_protected:Npn \_siunitx_unit_format_literal:n #1 { + \int_zero:N \_l_siunitx_unit_prefix_int + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_unit_print_literal_aux:N + \tl_set:Nn \_l_siunitx_unit_tl {#1} + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \exp_not:N \_siunitx_ensuremath:n + { \exp_not:V \_l_siunitx_unit_separator_tl } + } + \tl_replace_all_in:NnV \_l_siunitx_unit_tl { . } + \_l_siunitx_tmpa_tl + \tl_replace_all_in:NnV \_l_siunitx_unit_tl { ~ } + \_l_siunitx_tmpa_tl + \_siunitx_unit_format_literal_extras: +} +\cs_set_protected:Npn \_siunitx_unit_print_literal_aux:N #1 { + \cs_set_eq:Nc #1 { _siunitx_ \token_to_str:N #1 _literal:w } +} +\char_make_space:N \~ +\cs_set_protected_nopar:Npn \_siunitx_unit_format_literal_extras: { + \_siunitx_unit_format_literal_extras_aux:nN { 176 } + \SIUnitSymbolDegree + \_siunitx_unit_format_literal_extras_aux:nN { 181 } + \SIUnitSymbolMicro + \_siunitx_unit_format_literal_extras_aux:nN { 197 } + \SIUnitSymbolAngstrom +} +\cs_set_protected_nopar:Npn + \_siunitx_unit_format_literal_extras_aux:nN #1#2 { + \char_set_lccode:nn { `\@ } {#1} + \tl_to_lowercase:n + { + \tl_replace_all_in:NnV \_l_siunitx_unit_tl { @ } + \_l_siunitx_unit_tl + } +} +\xetex_if_engine:F { + \AtBeginDocument + { + \@ifpackageloaded { inputenc } + { + \tl_set:Nn \_l_siunitx_tmpa_tl { latin1 , latin5 , latin9 } + \clist_if_in:NVF \_l_siunitx_tmpa_tl \inputencodingname + { + \cs_set_eq:NN \_siunitx_unit_format_literal_extras: + \scan_stop: + } + } + { + \cs_set_eq:NN \_siunitx_unit_format_literal_extras: + \scan_stop: + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_power: { + \tl_set:Nx \_l_siunitx_tmpa_tl + { power- \int_use:N \_l_siunitx_unit_int } + \prop_get:NVN \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + \_l_siunitx_tmpa_tl + \quark_if_no_value:NTF \_l_siunitx_tmpa_tl + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { per- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVT \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { + \tl_set:Nn \_l_siunitx_tmpa_tl { 1 } + \_siunitx_unit_format_power_aux: + } + } + { \_siunitx_unit_format_power_aux: } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_power_aux: { + \tl_if_eq:nVTF { repeat } \_l_siunitx_per_mode_tl + { \_siunitx_unit_format_power_repeat: } + { \_siunitx_unit_format_power_per: } + \tl_if_eq:nVF { 1 } \_l_siunitx_tmpa_tl + { + \_siunitx_unit_format_power_brackets: + \tl_put_right:Nx \_l_siunitx_unit_current_tl + { + ^ + { + \_siunitx_unit_format_power_aux:n + { \exp_not:V \_l_siunitx_tmpa_tl } + } + } + } +} +\cs_set_protected:Npn \_siunitx_unit_format_power_aux:n #1 { + \bool_if:NTF \_l_siunitx_number_math_mode_bool + { \_siunitx_print:nn { number } {#1} } + { + \tl_set:Nn \_l_siunitx_tmpa_tl {#1} + \tl_replace_all_in:Nnn \_l_siunitx_tmpa_tl { - } + { \text { \_c_siunitx_minus_tl } } + \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_power_brackets: { + \tl_set:Nx \_l_siunitx_tmpb_tl + { bracket- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVT \_l_siunitx_unit_prop \_l_siunitx_tmpb_tl + { + \_siunitx_tl_put_left_math:NV \_l_siunitx_unit_current_tl + \_l_siunitx_bracket_open_tl + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_current_tl + \_l_siunitx_bracket_close_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_power_per: { + \tl_set:Nx \_l_siunitx_tmpb_tl + { per- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVT \_l_siunitx_unit_prop \_l_siunitx_tmpb_tl + { + \bool_if:NF \_l_siunitx_per_fraction_bool + { + \tl_if_in:NnTF \_l_siunitx_tmpa_tl { - } + { + \cs_set:Npn \_siunitx_tmp:w ##1 - ##2 \q_stop + { \tl_set:Nn \_l_siunitx_tmpa_tl {##2} } + \exp_afer:wN \_siunitx_tmp:w \_l_siunitx_tmpa_tl \q_stop + } + { \tl_put_left:Nn \_l_siunitx_tmpa_tl { - } } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_power_repeat: { + \tl_set:Nx \_l_siunitx_tmpb_tl + { per- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVT \_l_siunitx_unit_prop \_l_siunitx_tmpb_tl + { + \_siunitx_tl_put_left_math:NV \_l_siunitx_unit_current_tl + \_l_siunitx_per_symbol_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_prefix: { + \tl_set:Nx \_l_siunitx_tmpa_tl + { prefix- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVT \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { + \prop_get:NVN \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + \_l_siunitx_unit_prefix_current_tl + \bool_if:NTF \_l_siunitx_prefix_symbols_bool + { \_siunitx_unit_format_prefix_symbol: } + { \_siunitx_unit_format_prefix_number: } + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_prefix_number: { + \tl_set:Nx \_l_siunitx_tmpa_tl + { prefix-base- \int_use:N \_l_siunitx_unit_int } + \prop_get:NVN \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + \_l_siunitx_tmpa_tl + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_unit_prefix_base_int } = { 0 } + { + \int_set:Nn \_l_siunitx_unit_prefix_base_int + { \_l_siunitx_tmpa_tl } + } + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_unit_prefix_base_int } + = { \_l_siunitx_tmpa_tl } + { \_siunitx_unit_format_prefix_number_calc: } + { \msg_error:nn { siunitx } { prefix-base-mismatch } } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_prefix_number_calc: { + \tl_set:Nx \_l_siunitx_tmpa_tl + { power- \int_use:N \_l_siunitx_unit_int } + \prop_get:NVN \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { \tl_set:Nn \_l_siunitx_tmpa_tl { 1 } } + \tl_set:Nx \_l_siunitx_tmpb_tl + { unit- \int_use:N \_l_siunitx_unit_int } + \prop_get:NVN \_l_siunitx_unit_prop \_l_siunitx_tmpb_tl + \_l_siunitx_tmpb_tl + \tl_if_eq:nVT { \gram } \_l_siunitx_tmpb_tl + { + \tl_set:Nx \_l_siunitx_unit_prefix_current_tl + { \intexpr_eval:n { \_l_siunitx_unit_prefix_current_tl - 3 } } + \tl_set:Nx \_l_siunitx_tmpb_tl + { symbol- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpb_tl { kg } + } + \tl_set:Nx \_l_siunitx_unit_prefix_current_tl + { + \intexpr_eval:n + { \_l_siunitx_unit_prefix_current_tl * \_l_siunitx_tmpa_tl } + } + \tl_set:Nx \_l_siunitx_tmpa_tl + { per- \int_use:N \_l_siunitx_unit_int } + \prop_if_in:NVTF \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + { + \int_set:Nn \_l_siunitx_unit_prefix_int + { + \int_use:N \_l_siunitx_unit_prefix_int + - \_l_siunitx_unit_prefix_current_tl + } + } + { + \int_set:Nn \_l_siunitx_unit_prefix_int + { + \int_use:N \_l_siunitx_unit_prefix_int + + \_l_siunitx_unit_prefix_current_tl + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_prefix_symbol: { + \tl_set_eq:NN \_l_siunitx_unit_current_tl + \_l_siunitx_unit_prefix_current_tl +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_qualifier: { + \tl_set:Nx \_l_siunitx_tmpa_tl + { qualifier- \int_use:N \_l_siunitx_unit_int } + \prop_get:NVN \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + \_l_siunitx_tmpa_tl + \quark_if_no_value:NF \_l_siunitx_tmpa_tl + { + \use:c + { + _siunitx_unit_format_qualifier_ + \_l_siunitx_qualifier_mode_tl : + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_qualifier_brackets: { + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_current_tl + \_l_siunitx_bracket_open_tl + \tl_put_right:NV \_l_siunitx_unit_current_tl \_l_siunitx_tmpa_tl + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_current_tl + \_l_siunitx_bracket_close_tl +} +\char_make_active:N \~ +\cs_set_protected_nopar:Npn \_siunitx_unit_format_qualifier_space: { + \tl_put_right:Nn \_l_siunitx_unit_current_tl { \text { ~ } } + \tl_put_right:NV \_l_siunitx_unit_current_tl \_l_siunitx_tmpa_tl + \tl_set:Nx \_l_siunitx_tmpa_tl + { bracket- \int_use:N \_l_siunitx_unit_int } + \prop_put:NVn \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl { true } +} +\char_make_space:N \~ +\group_begin: + \char_set_lccode:nn { `\@ } { `\_ } + \char_make_math_subscript:N \@ +\tl_to_lowercase:n { + \group_end: + \cs_set_protected_nopar:Npn \_siunitx_unit_format_qualifier_subscript: + { + \tl_put_right:No \_l_siunitx_unit_current_tl + { \exp_after:wN @ \exp_after:wN { \_l_siunitx_tmpa_tl } } + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_sorted: { + \tl_set_eq:NN \_l_siunitx_unit_tl \_l_siunitx_unit_numerator_tl + \tl_if_empty:NF \_l_siunitx_unit_tl + { + \tl_if_empty:NF \_l_siunitx_unit_denominator_tl + { + \_siunitx_tl_put_right_math:NV \_l_siunitx_unit_tl + \_l_siunitx_unit_separator_tl + } + } + \tl_put_right:NV \_l_siunitx_unit_tl \_l_siunitx_unit_denominator_tl +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_symbol: { + \tl_set:Nx \_l_siunitx_tmpa_tl + { symbol- \int_use:N \_l_siunitx_unit_int } + \prop_get:NVN \_l_siunitx_unit_prop \_l_siunitx_tmpa_tl + \_l_siunitx_tmpa_tl + \quark_if_no_value:NTF \_l_siunitx_tmpa_tl + { \_siunitx_unit_format_symbol_aux: } + { + \tl_put_right:NV \_l_siunitx_unit_current_tl \_l_siunitx_tmpa_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_symbol_aux: { + \msg_error:nn { siunitx } { prefix-only } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_format_symbol_aux_alt: { + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_unit_int } = { 1 } + { + \prop_del:Nn \_l_siunitx_unit_prop { prefix-1 } + \prop_if_empty:NF \_l_siunitx_unit_prop + { \msg_error:nn { siunitx } { prefix-only } } + } + { \msg_error:nn { siunitx } { prefix-only } } +} +\bool_new:N \_l_siunitx_multi_brackets_bool +\bool_new:N \_l_siunitx_multi_repeat_bool +\bool_new:N \_l_siunitx_product_brackets_bool +\bool_new:N \_l_siunitx_product_power_bool +\bool_new:N \_l_siunitx_number_unit_repeat_bool +\keys_define:nn { siunitx } { + allow-number-unit-breaks .bool_set:N = + \_l_siunitx_number_unit_breaks_bool, + multi-part-units .choice:, + multi-part-units + / brackets .code:n = + { + \bool_set_true:N \_l_siunitx_multi_brackets_bool + \bool_set_false:N \_l_siunitx_multi_repeat_bool + }, + multi-part-units + / repeat .code:n = + { + \bool_set_false:N \_l_siunitx_multi_brackets_bool + \bool_set_true:N \_l_siunitx_multi_repeat_bool + }, + multi-part-units + / single .code:n = + { + \bool_set_false:N \_l_siunitx_multi_brackets_bool + \bool_set_false:N \_l_siunitx_multi_repeat_bool + }, + number-unit-separator .tl_set:N = + \_l_siunitx_number_unit_separator_tl, + product-units .choice:, + product-units + / brackets .code:n = + { + \bool_set_true:N \_l_siunitx_product_brackets_bool + \bool_set_false:N \_l_siunitx_product_power_bool + \bool_set_false:N \_l_siunitx_product_repeat_bool + }, + product-units + / brackets-power .code:n = + { + \bool_set_true:N \_l_siunitx_product_brackets_bool + \bool_set_true:N \_l_siunitx_product_power_bool + \bool_set_false:N \_l_siunitx_product_repeat_bool + }, + product-units + / power .code:n = + { + \bool_set_false:N \_l_siunitx_product_brackets_bool + \bool_set_true:N \_l_siunitx_product_power_bool + \bool_set_false:N \_l_siunitx_product_repeat_bool + }, + product-units + / repeat .code:n = + { + \bool_set_false:N \_l_siunitx_product_brackets_bool + \bool_set_false:N \_l_siunitx_product_power_bool + \bool_set_true:N \_l_siunitx_product_repeat_bool + }, + product-units + / single .code:n = + { + \bool_set_false:N \_l_siunitx_product_brackets_bool + \bool_set_false:N \_l_siunitx_product_power_bool + \bool_set_false:N \_l_siunitx_product_repeat_bool + }, +} +\keys_set:nn { siunitx } { + multi-part-units = brackets, + number-unit-separator = \,, + product-units = repeat, +} +\cs_set_protected:Npn \_siunitx_unit_output:nn #1#2 { + \cs_set_eq:NN \_siunitx_unit_format_symbol_aux: + \_siunitx_unit_format_symbol_aux_alt: + \cs_set_eq:NN \_siunitx_unit_format_fraction_symbol_aux: + \_siunitx_unit_format_fraction_symbol_aux_alt: + \_siunitx_unit_in:nn {#1} {#2} + \intexpr_compare:nNnF + { \int_use:N\_l_siunitx_unit_prefix_int } = { 0 } + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \int_use:N \_l_siunitx_unit_prefix_base_int + ^ { \int_use:N \_l_siunitx_unit_prefix_int } + } + \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl + \_siunitx_unit_output_number_sep: + } + \_siunitx_print:nV { unit } \_l_siunitx_unit_tl +} +\cs_generate_variant:Nn \_siunitx_unit_output:nn { Vn } +\cs_set_protected_nopar:Npn \_siunitx_unit_output_number_sep: { + \bool_if:NTF \_l_siunitx_number_unit_breaks_bool + { \allowbreak } { \nobreak } + \_siunitx_ensuremath:n { \_l_siunitx_number_unit_separator_tl } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_output_pre_print: { + \tl_if_empty:NF \_l_siunitx_pre_unit_tl + { + \nobreak + \_siunitx_print:nV { unit } \_l_siunitx_pre_unit_tl + } +} +\cs_set_protected_nopar:Npn \_siunitx_unit_output_print: { + \intexpr_compare:nNnF + { \int_use:N \_l_siunitx_unit_prefix_int } = { 0 } + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \bool_if:NTF \_l_siunitx_tight_bool + { { \exp_not:V \_l_siunitx_exponent_product_tl } } + { { } \exp_not:V \_l_siunitx_exponent_product_tl { } } + \int_use:N \_l_siunitx_unit_prefix_base_int + ^ { \int_use:N \_l_siunitx_unit_prefix_int } + } + \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl + } + \tl_if_empty:NF \_l_siunitx_unit_tl + { + \_siunitx_unit_output_number_sep: + \_siunitx_print:nV { unit } \_l_siunitx_unit_tl + } +} +\tl_new:N \_l_siunitx_pre_unit_tl +\int_new:N \_l_siunitx_number_product_int +\cs_set_protected:Npn \_siunitx_combined:nnnn #1#2#3#4 { + \IfNoValueTF {#3} + { \tl_clear:N \_l_siunitx_pre_unit_tl } + { + \_siunitx_unit_in:nn {#3} {#1} + \cs_set_eq:NN \_l_siunitx_pre_unit_tl \_l_siunitx_unit_tl + } + \cs_set_eq:NN \_l_siunitx_brackets_bool + \_l_siunitx_multi_brackets_bool + \_siunitx_combined_unit:nnn {#2} {#4} {#1} + \_siunitx_combined_output:n {#2} +} +\cs_set_protected:Npn \_siunitx_combined_output:n #1 { + \bool_if:NTF \_l_siunitx_number_parse_bool + { + \tl_clear:N \_l_siunitx_number_out_tl + \bool_set_false:N \_l_siunitx_number_compound_bool + \_siunitx_number_output_parse:n {#1} + } + { + \_siunitx_unit_output_pre_print: + \_siunitx_print:nn { number } { \_siunitx_ensuremath:n {#1} } + \_siunitx_unit_output_print: + } +} +\cs_set_protected:Npn \_siunitx_combined_unit:nnn #1#2#3 { + \bool_if:NTF \_l_siunitx_product_power_bool + { + \_siunitx_combined_product_count:n {#1} + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_number_product_int } > { 0 } + { + \int_incr:N \_l_siunitx_number_product_int + \tl_set:Nn \_l_siunitx_tmpa_tl {#2} + \tl_set:Nx \_l_siunitx_tmpb_tl + { \tothe { \exp_not:V \_l_siunitx_number_product_int } } + \tl_put_right:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl + \_siunitx_unit_in:Vn \_l_siunitx_tmpa_tl {#3} + } + { \_siunitx_unit_in:nn {#2} {#3} } + } + { \_siunitx_unit_in:nn {#2} {#3} } +} +\cs_set_protected:Npn \_siunitx_combined_product_count:n #1 { + \int_zero:N \_l_siunitx_number_product_int + \tl_set:Nn \_l_siunitx_tmpa_tl {#1} + \tl_map_function:NN \_l_siunitx_input_product_tl + \_siunitx_combined_product_count_aux:N +} +\cs_set_protected:Npn \_siunitx_combined_product_count_aux:N #1 { + \tl_if_in:NnT \_l_siunitx_tmpa_tl {#1} + { + \int_incr:N \_l_siunitx_number_product_int + \tl_remove_in:Nn \_l_siunitx_tmpa_tl {#1} + \_siunitx_combined_product_count_aux:N #1 + } +} +\bool_new:N \_l_siunitx_list_brackets_bool +\bool_new:N \_l_siunitx_list_repeat_bool +\tl_new:N \_l_siunitx_list_current_tl +\tl_new:N \_l_siunitx_list_tl +\keys_define:nn { siunitx } { + list-final-separator .tl_set:N = \_l_siunitx_list_separator_final_tl, + list-separator .tl_set:N = \_l_siunitx_list_separator_tl, + list-units .choice:, + list-units + / brackets .code:n = + { + \bool_set_true:N \_l_siunitx_list_brackets_bool + \bool_set_false:N \_l_siunitx_list_repeat_bool + }, + list-units + / repeat .code:n = + { + \bool_set_false:N \_l_siunitx_list_brackets_bool + \bool_set_true:N \_l_siunitx_list_repeat_bool + }, + list-units + / single .code:n = + { + \bool_set_false:N \_l_siunitx_list_brackets_bool + \bool_set_false:N \_l_siunitx_list_repeat_bool + }, +} +\keys_set:nn { siunitx } { + list-final-separator = { ~ and ~ }, + list-separator = { , ~ }, + list-units = repeat, +} +\cs_set_protected:Npn \_siunitx_list_numbers:n #1 { + \tl_clear:N \_l_siunitx_unit_tl + \tl_clear:N \_l_siunitx_preunit_tl + \_siunitx_list_numbers_aux_i:n {#1} +} +\cs_set_protected:Npn \_siunitx_list_numbers_aux_i:n #1 { + \tl_clear:N \_l_siunitx_list_tl + \tl_clear:N \_l_siunitx_list_current_tl + \tl_map_function:nN {#1} \_siunitx_list_numbers_aux_ii:n + \tl_put_right:NV \_l_siunitx_list_tl + \_l_siunitx_list_separator_final_tl + \tl_put_right:NV \_l_siunitx_list_tl \_l_siunitx_list_current_tl + \tl_use:N \_l_siunitx_list_tl +} +\cs_set_protected:Npn \_siunitx_list_numbers_aux_ii:n #1 { + \tl_if_empty:NTF \_l_siunitx_list_tl + { \tl_set_eq:NN \_l_siunitx_list_tl \_l_siunitx_list_current_tl } + { + \tl_put_right:NV \_l_siunitx_list_tl + \_l_siunitx_list_separator_tl + \tl_put_right:NV \_l_siunitx_list_tl \_l_siunitx_list_current_tl + } + \tl_set:Nn \_l_siunitx_list_current_tl + { \_siunitx_combined_output:n {#1} } +} +\cs_set_protected:Npn \_siunitx_list_units:nnn #1#2#3 { + \bool_if:NTF \_l_siunitx_list_repeat_bool + { + \_siunitx_unit_in:nn {#2} {#3} + \_siunitx_list_numbers_aux_i:n {#1} + } + { + \bool_if:NT \_l_siunitx_list_brackets_bool + { + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { \_l_siunitx_bracket_open_tl } } + } + \_siunitx_list_numbers:n {#1} + \bool_if:NT \_l_siunitx_list_brackets_bool + { + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { \_l_siunitx_bracket_close_tl } } + } + \_siunitx_unit_output_number_sep: + \_siunitx_unit_output:nn {#2} {#3} + } +} +\bool_new:N \_l_siunitx_range_brackets_bool +\bool_new:N \_l_siunitx_range_repeat_bool +\keys_define:nn { siunitx } { + range-phrase .tl_set:N = \_l_siunitx_range_phrase_tl, + range-units .choice:, + range-units + / brackets .code:n = + { + \bool_set_true:N \_l_siunitx_range_brackets_bool + \bool_set_false:N \_l_siunitx_range_repeat_bool + }, + range-units + / repeat .code:n = + { + \bool_set_false:N \_l_siunitx_range_brackets_bool + \bool_set_true:N \_l_siunitx_range_repeat_bool + }, + range-units + / single .code:n = + { + \bool_set_false:N \_l_siunitx_range_brackets_bool + \bool_set_false:N \_l_siunitx_range_repeat_bool + }, +} +\keys_set:nn { siunitx } { + range-phrase = { ~ to ~ }, + range-units = repeat, +} +\cs_set_protected:Npn \_siunitx_range_numbers:nn #1#2 { + \_siunitx_range_numbers_aux:n {#1} + \text { \_l_siunitx_range_phrase_tl } + \_siunitx_range_numbers_aux:n {#2} +} +\cs_set_protected:Npn \_siunitx_range_numbers_aux:n #1 { + \bool_if:NTF \_l_siunitx_number_parse_bool + { + \tl_clear:N \_l_siunitx_number_out_tl + \tl_clear:N \_l_siunitx_number_out_saved_tl + \bool_set_false:N \_l_siunitx_number_compound_bool + \_siunitx_number_output_parse:n {#1} + \bool_if:NT \_l_siunitx_number_compound_bool + { \msg_error:nnx { siunitx } { multi-part-range } {#1} } + } + { + \_siunitx_unit_output_pre_print: + \_siunitx_print:nn { number } {#1} + \_siunitx_unit_output_print: + } +} +\cs_set_protected:Npn \_siunitx_range_unit:nnnn #1#2#3#4 { + \bool_if:NTF \_l_siunitx_range_repeat_bool + { + \_siunitx_unit_in:nn {#1} {#2} + \_siunitx_range_numbers_aux:n {#3} + \text { \_l_siunitx_range_phrase_tl } + \_siunitx_range_numbers_aux:n {#4} + } + { + \bool_if:NT \_l_siunitx_range_brackets_bool + { + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { \_l_siunitx_bracket_open_tl } } + } + \_siunitx_range_numbers:nn {#3} {#4} + \bool_if:NT \_l_siunitx_range_brackets_bool + { + \_siunitx_print:nn { number } + { \_siunitx_ensuremath:n { \_l_siunitx_bracket_close_tl } } + } + \_siunitx_unit_output_number_sep: + \_siunitx_unit_output:nn {#1} {#2} + } +} +\AtBeginDocument { + \@ifpackageloaded { cellspace } + { + \newcolumntype { C } [1] + { > { \bcolumn #1 \@nil } #1 < { \ecolumn } } + \cs_set:Npn \_siunitx_tmp:w #1 \NC@do S #2 \q_stop + { \toks_set:Nn \NC@list { #1 #2 } } + \exp_last_unbraced:NV \_siunitx_tmp:w \NC@list \q_stop + \cs_gundefine:N \NC@find@S + } + { } +} +\cs_set_protected_nopar:Npn \_siunitx_table_rewrite_create:N #1 { + \tl_set:Nn \_l_siunitx_tmpa_tl { \NC@do #1 } + \tl_put_right:NV \_l_siunitx_tmpa_tl \NC@list + \newcolumntype {#1} { } + \toks_set:NV \NC@list \_l_siunitx_tmpa_tl + \exp_args:NNc \renewcommand * { NC@rewrite@ #1 } [1] [ ] + { + \toks_put_right:Nn \@temptokena + { + > { \_siunitx_table_collect_begin:Nn #1 {##1} } + c + < { \_siunitx_table_print: } + } + \NC@find + } +} +\AtBeginDocument { \_siunitx_table_rewrite_create:N s } +\AtBeginDocument { \_siunitx_table_rewrite_create:N S } +\tl_new:N \_l_siunitx_table_collect_tl +\tl_new:N \_l_siunitx_table_collect_pre_tl +\tl_new:N \_l_siunitx_table_collect_post_tl +\tl_new:N \_l_siunitx_number_valid_tl +\bool_new:N \_l_siunitx_table_collect_pre_bool +\bool_new:N \_l_siunitx_table_collect_post_bool +\cs_set_protected:Npn \_siunitx_table_collect_begin:Nn #1#2 { + \keys_set:nn { siunitx } {#2} + \use:c { _siunitx_table_collect_begin_ #1 : } +} +\cs_set_protected_nopar:Npn \_siunitx_table_collect_begin_s: { + \cs_set_eq:NN \_siunitx_table_collect_token:N + \_siunitx_table_collect_token_s:N + \cs_set_eq:NN \_siunitx_table_print: \_siunitx_table_print_s: + \_siunitx_table_collect_init_s: + \_siunitx_table_collect_get: +} +\cs_set_protected_nopar:Npn \_siunitx_table_collect_begin_S: { + \cs_set_eq:NN \_siunitx_table_collect_token:N + \_siunitx_table_collect_token_S:N + \cs_set_eq:NN \_siunitx_table_print: \_siunitx_table_print_S: + \_siunitx_table_collect_init_S: + \bool_if:NTF \_l_siunitx_number_parse_bool + { \_siunitx_table_collect_get: } + { \_siunitx_table_direct: } +} +\cs_set_protected:Npn \_siunitx_table_collect_braced:n #1 { } +\cs_set_protected:Npn \_siunitx_table_collect_expand:N #1 { + \cs_if_eq:NNTF #1 \color + { + \bool_if:NTF \_l_siunitx_table_collect_pre_bool + { + \tl_clear:N \_l_siunitx_number_color_tl + \tl_clear:N \_l_siunitx_unit_color_tl + \tl_put_right:Nn \_l_siunitx_table_collect_pre_tl {#1} + } + { + \bool_set_true:N \_l_siunitx_table_collect_post_bool + \tl_put_right:Nn \_l_siunitx_table_collect_post_tl {#1} + } + } + { + \_siunitx_cs_if_tl:NTF #1 + { + \tl_use:N \_l_siunitx_table_collect_pre_tl + \tl_clear:N \_l_siunitx_table_collect_pre_tl + \cs_set_nopar:Npx \_siunitx_table_collect_next: + { \exp_not:N \_siunitx_table_collect_get: \exp_not:V #1 } + } + { + \bool_if:NTF \_l_siunitx_table_collect_pre_bool + { \tl_put_right:Nn \_l_siunitx_table_collect_pre_tl {#1} } + { + \bool_set_true:N \_l_siunitx_table_collect_post_bool + \tl_put_right:Nn \_l_siunitx_table_collect_post_tl {#1} + } + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_collect_get: { + \cs_set_eq:NN \_siunitx_table_collect_next: + \_siunitx_table_collect_get: + \cs_set_nopar:Npn \peek_execute_branches: + { + \if_catcode:w \exp_not:N \l_peek_token \c_group_begin_token + \exp_after:wN \_siunitx_table_collect_braced:n + \else: + \exp_after:wN \_siunitx_table_collect_not_braced:N + \fi: + } + \peek_after:NN \peek_ignore_spaces_execute_branches: +} +\cs_set_protected_nopar:Npn \_siunitx_table_collect_init: { + \tl_clear:N \_l_siunitx_table_collect_tl + \tl_clear:N \_l_siunitx_table_collect_pre_tl + \tl_clear:N \_l_siunitx_table_collect_post_tl + \bool_set_false:N \_l_siunitx_table_collect_post_bool +} +\cs_set_protected_nopar:Npn \_siunitx_table_collect_init_s: { + \_siunitx_table_collect_init: + \bool_set_false:N \_l_siunitx_table_collect_pre_bool + \cs_set:Npn \_siunitx_table_collect_braced:n ##1 + { + \tl_put_right:Nn \_l_siunitx_table_collect_tl { {##1} } + \_siunitx_table_collect_next: + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_collect_init_S: { + \_siunitx_number_in_init: + \tl_set:Nx \_l_siunitx_number_valid_tl + { + \exp_not:V \_l_siunitx_input_complex_tl + \exp_not:V \_l_siunitx_input_decimal_tl + \exp_not:V \_l_siunitx_input_digit_tl + \exp_not:V \_l_siunitx_input_exponent_tl + \exp_not:V \_l_siunitx_input_ignore_tl + \exp_not:V \_l_siunitx_input_uncert_close_tl + \exp_not:V \_l_siunitx_input_uncert_open_tl + \exp_not:V \_l_siunitx_input_sign_tl + \exp_not:V \_l_siunitx_input_symbol_tl + } + \bool_set_true:N \_l_siunitx_table_collect_pre_bool + \cs_set:Npn \_siunitx_table_collect_braced:n ##1 + { + \bool_if:NTF \_l_siunitx_table_collect_pre_bool + { \tl_put_right:Nn \_l_siunitx_table_collect_pre_tl { {##1} } } + { + \bool_set_true:N \_l_siunitx_table_collect_post_bool + \tl_put_right:Nn \_l_siunitx_table_collect_post_tl { {##1} } + } + \_siunitx_table_collect_next: + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_collect_next: { } +\cs_set_protected_nopar:Npn \_siunitx_table_collect_newline: { + \_siunitx_table_print: + \cs_set_eq:NN \_siunitx_table_print: \prg_do_nothing: + \tabularnewline +} +\cs_set_protected:Npn \_siunitx_table_collect_not_braced:N #1 { + \token_if_eq_meaning:NNF #1 \tex_ignorespaces:D + { + \token_if_eq_meaning:NNF #1 \tex_unskip:D + { \_siunitx_table_collect_not_braced_aux_i:N #1 } + } + \_siunitx_table_collect_next: +} +\cs_set_protected:Npn \_siunitx_table_collect_not_braced_aux_i:N #1 { + \cs_set:Npn \_siunitx_table_collect_not_braced_aux_ii:N ##1 + { + \token_if_eq_meaning:NNT #1 ##1 + { \cs_set_eq:NN \_siunitx_table_collect_next: ##1 } + } + \tl_map_function:nN + { \cs:w \end \endtabular \scan_stop: \_siunitx_table_print: } + \_siunitx_table_collect_not_braced_aux_ii:N + \token_if_eq_meaning:NNT \_siunitx_table_collect_next: + \_siunitx_table_collect_get: + { + \token_if_eq_meaning:NNTF #1 \tabularnewline + { + \cs_set_eq:NN \_siunitx_table_collect_next: + \_siunitx_table_collect_newline: + } + { \_siunitx_table_collect_token:N #1 } + } +} +\cs_set_protected:Npn \_siunitx_table_collect_not_braced_aux_ii:N #1 { } +\cs_set_protected:Npn \_siunitx_table_collect_token:N #1 { } +\cs_set_protected:Npn \_siunitx_table_collect_token_s:N #1 { + \tl_put_right:Nn \_l_siunitx_table_collect_tl {#1} +} +\cs_set_protected:Npn \_siunitx_table_collect_token_S:N #1 { + \bool_if:NTF \_l_siunitx_table_collect_post_bool + { \tl_put_right:Nn \_l_siunitx_table_collect_post_tl {#1} } + { + \tl_if_in:NnTF \_l_siunitx_number_valid_tl {#1} + { + \bool_set_false:N \_l_siunitx_table_collect_pre_bool + \tl_put_right:Nn \_l_siunitx_table_collect_tl {#1} + } + { \_siunitx_table_collect_expand:N #1 } + } +} +\skip_new:N \_c_siunitx_one_fill_skip +\skip_set:Nn \_c_siunitx_one_fill_skip { \c_zero_skip plus 1 fill } +\skip_new:N \_c_siunitx_table_correction_skip +\AtBeginDocument { + \@ifpackageloaded { colortbl } + { + \skip_set:Nn \_c_siunitx_table_correction_skip + { \c_zero_skip plus -0.5 fill } + } + { + \skip_set:Nn \_c_siunitx_table_correction_skip + { \c_zero_skip } + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_colortbl_correction: { + \skip_horizontal:n { \_c_siunitx_table_correction_skip } + \tex_kern:D \c_zero_skip +} +\cs_set_protected_nopar:Npn \_siunitx_table_align_left:n #1 { + \_siunitx_table_colortbl_correction: + \skip_horizontal:n {#1} + \tex_kern:D \c_zero_skip +} +\cs_set_protected_nopar:Npn \_siunitx_table_align_right:n #1 { + \skip_horizontal:n { \_c_siunitx_one_fill_skip - #1 } + \tex_kern:D \c_zero_skip + \_siunitx_table_colortbl_correction: +} +\skip_new:N \_l_siunitx_table_unit_align_skip +\keys_define:nn { siunitx } { + table-unit-alignment .choice:, + table-unit-alignment / center .code:n = + { + \skip_set:Nn \_l_siunitx_table_unit_align_skip + { \c_zero_skip plus 0.5 fill } + }, + table-unit-alignment / left .code:n = + { + \skip_set:Nn \_l_siunitx_table_unit_align_skip + { \c_zero_skip } + }, + table-unit-alignment / right .code:n = + { + \skip_set:Nn \_l_siunitx_table_unit_align_skip + { \c_zero_skip plus 1 fill } + }, +} +\keys_set:nn { siunitx } { + table-unit-alignment = center +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_s: { + \_siunitx_table_align_left:n { \_l_siunitx_table_unit_align_skip } + \_siunitx_unit_output:Vn \_l_siunitx_table_collect_tl { } + \_siunitx_table_align_right:n { \_l_siunitx_table_unit_align_skip } +} +\bool_new:N \_l_siunitx_table_center_decimal_bool +\box_new:N \_l_siunitx_table_fill_box +\dim_new:N \_l_siunitx_table_fill_dim +\box_new:N \_l_siunitx_table_pre_box +\box_new:N \_l_siunitx_table_post_box +\box_new:N \_l_siunitx_table_result_box +\dim_new:N \_l_siunitx_table_decimal_dim +\dim_new:N \_l_siunitx_table_exponent_dim +\dim_new:N \_l_siunitx_table_integer_dim +\dim_new:N \_l_siunitx_table_mantissa_dim +\dim_new:N \_l_siunitx_table_marker_dim +\dim_new:N \_l_siunitx_table_result_dim +\dim_new:N \_l_siunitx_table_uncert_dim +\dim_new:N \_l_siunitx_table_gap_dim +\prop_new:N \_l_siunitx_table_model_prop +\skip_new:N \_l_siunitx_table_number_align_skip +\skip_new:N \_l_siunitx_table_text_align_skip +\keys_define:nn { siunitx } { + table-align-text-post .bool_set:N + = \_l_siunitx_table_align_post_bool, + table-number-alignment .choice:, + table-number-alignment / + center .code:n = + { + \skip_set:Nn \_l_siunitx_table_number_align_skip + { \c_zero_skip plus 0.5 fill } + \bool_set_false:N \_l_siunitx_table_center_decimal_bool + }, + table-number-alignment / + center-decimal-marker .code:n = + { + \skip_set:Nn \_l_siunitx_table_number_align_skip + { \c_zero_skip plus 0.5 fill } + \bool_set_true:N \_l_siunitx_table_center_decimal_bool + }, + table-number-alignment / + left .code:n = + { + \skip_set:Nn \_l_siunitx_table_number_align_skip + { \c_zero_skip } + \bool_set_false:N \_l_siunitx_table_center_decimal_bool + }, + table-number-alignment / + right .code:n = { - mathsrm = mathtt, - textrm = ttfamily - }% - \fi -} -\AtBeginDocument{\si@fam@detect@default} -\newcommand*{\si@fam@ifbtext}[1]{% - \if b\expandafter\@car\f@series\@nil - #1\fi} -\newcommand*{\si@fam@ifbmaths}[1]{% - \renewcommand*{\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} -\AtBeginDocument{ - \@ifpackageloaded{color} - {\let\si@fam@colourcmd\color} - {\let\si@fam@colourcmd\@gobble}} -\newif\ifsi@fam@set -\newif\ifsi@textmode -\newcommand*{\si@fam@set}{% - \ifsi@out@num - \ifsi@numtextmode - \expandafter\expandafter\expandafter\si@textmodetrue - \else - \expandafter\expandafter\expandafter\si@textmodefalse - \fi - \else - \ifsi@unittextmode - \expandafter\expandafter\expandafter\si@textmodetrue - \else - \expandafter\expandafter\expandafter\si@textmodefalse - \fi - \fi - \ifsi@fam@set\else - \let\si@colourcmd\@gobble - \ifsi@out@num - \let\si@mathsrm\si@valuemathsrm - \let\si@mathssf\si@valuemathssf - \let\si@mathstt\si@valuemathstt - \let\si@textrm\si@valuetextrm - \let\si@textsf\si@valuetextsf - \let\si@texttt\si@valuetexttt - \ifsi@colourvalues - \let\si@colourcmd\si@fam@colourcmd - \fi - \let\si@colour\si@valuecolour - \else - \let\si@mathsrm\si@unitmathsrm - \let\si@mathssf\si@unitmathssf - \let\si@mathstt\si@unitmathstt - \let\si@textrm\si@unittextrm - \let\si@textsf\si@unittextsf - \let\si@texttt\si@unittexttt - \ifsi@colourunits - \let\si@colourcmd\si@fam@colourcmd - \fi - \let\si@colour\si@unitcolour - \fi - \fi - \si@fam@settrue - \edef\si@tempa{\sfdefault}% - \edef\si@tempb{\ttdefault}% - \expandafter\let\expandafter\si@fam@maths - \csname\si@mathsrm\endcsname - \expandafter\let\expandafter\si@fam@text - \csname\si@textrm\endcsname - \ifsi@obeyfamily - \si@log@debug{Font detection: checking font}% - \ifmmode - \ifinner - \si@log@debug{Font detection: inline maths}% - \si@fam@dettext - \else - \si@log@debug{Font detection: display maths}% - \ifsi@detectdisplay - \si@fam@detmaths - \else - \si@fam@dettext - \fi - \fi - \else - \si@log@debug{Font detection: text}% - \si@fam@dettext - \fi - \else - \si@log@debug{Font detection: inactive}% - \fi - \def\si@fam@bold{\unboldmath\mdseries}% - \ifsi@obeybold - \si@log@debug{Weight detection: checking weight}% - \ifmmode - \ifdim\displaywidth>0pt\relax - \ifsi@detectdisplay - \expandafter\si@fam@ifbmaths - \else - \expandafter\si@fam@ifbtext - \fi - \si@fam@setbold - \else - \si@fam@ifbinline\si@fam@setbold - \fi - \else - \si@fam@ifbtext\si@fam@setbold - \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}}% - \fi} -\newcommand*{\si@fam@detmaths}{% - \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@mathsrm\endcsname - \expandafter\let\expandafter\si@fam@text - \csname\si@textrm\endcsname - \fi - \fi} -\newcommand*{\si@fam@dettext}{% - \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@mathsrm\endcsname - \expandafter\let\expandafter\si@fam@text - \csname\si@textrm\endcsname - \fi - \fi} -\newcommand*{\si@fam@setbold}{% - \si@log@debug{Weight detection: bold weight}% - \let\si@fam@bold\si@fam@boldify} -\newcommand*{\si@fam@boldify}{\boldmath\bfseries} -\si@newrobustcmd*{\num}[2][]{% - \begingroup - \sisetup{#1}% - \si@fam@mode - \si@num@intabfalse - \si@log@debug{Processing \string\num\space input `#2'}% - \expandafter\si@out@num\expandafter{\si@num{#2}}% - \endgroup} -\newif\ifsi@num@intab -\newcommand*{\si@num}[1]{% - \si@num@fixpm - \begingroup - \makeatletter - \@makeother{\,}% - \@makeother{\.}% - \@makeother{\+}% - \@makeother{\-}% - \def~{}% - \def\,{}% - \catcode`\~=\active\relax - \catcode`\^=\active\relax - \catcode`\_=12\relax - \everyeof{\noexpand}% - \endlinechar\m@ne - \protected@xdef\si@tempa{\scantokens{#1}}% - \endgroup - \si@ifnotmtarg{\si@tempa} - {\si@num@ifvalid{\si@tempa} - {\si@num@format{\si@tempa}} - {\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\space macro\MessageBreak - (or derivative such as an `s' column)}% - {#1}}}} -\newcommand*{\si@num@fixpm}{% - \let\si@num@pm\pm - \let\si@num@mp\mp - \protected\def\pm{\si@num@pm}% - \protected\def\mp{\si@num@mp}} -\newcommand*{\si@num@ifvalid}[1]{% - \begingroup - \si@switchtrue - \expandafter\si@num@valid#1\@empty\@empty - \ifsi@switch - \aftergroup\@firstoftwo - \else - \aftergroup\@secondoftwo - \fi - \endgroup} -\def\si@num@valid#1#2\@empty{% - \si@str@ifchrstr{#1}{\si@numvalid} - {\ifx\@empty#2\@empty\else - \si@num@valid#2\@empty\@empty\@empty - \fi} - {\si@switchfalse}} -\newcommand*{\si@num@in}{} -\newcommand*{\si@num@out}{} -\newcommand*{\si@num@exp}{} -\newcommand*{\si@num@expsign}{} -\newcommand*{\si@num@mant}{} -\newcommand*{\si@num@mantsign}{} -\newcommand*{\si@num@err}{} -\newcommand*{\si@num@xpart}{} -\newcommand*{\si@num@ambig}{} -\newcommand*{\si@tab@out}{} -\newcommand*{\si@tab@expout}{} -\newif\ifsi@num@erropen -\newcommand*{\si@num@arg}{} -\newcommand*{\si@num@format}[1]{% - \protected@edef\si@num@arg{#1}% - \si@log@debug{Formatting number `\si@num@arg'}% - \renewcommand*{\si@num@in}{}% - \renewcommand*{\si@num@exp}{}% - \renewcommand*{\si@num@expsign}{}% - \renewcommand*{\si@num@mant}{}% - \renewcommand*{\si@num@mantsign}{}% - \renewcommand*{\si@num@err}{}% - \renewcommand*{\si@num@xpart}{}% - \si@switchfalse - \expandafter\si@num@findxpart\si@num@arg\@empty\@empty - \si@switchfalse - \si@num@sepmantexp{\si@num@in}% - \si@num@sepsign{exp}% - \si@num@sepsign{mant}% - \ifx\@empty\si@num@exp\@empty - \ifx\@empty\si@num@expsign\@empty\else - \si@log@warn{Sign but no number for `\si@num@arg'}% - \fi - \let\si@num@expsign\@empty - \fi - \ifx\@empty\si@num@mant\@empty - \ifx\@empty\si@num@mantsign\@empty\else - \ifx\@empty\si@num@exp\@empty - \si@log@warn{Sign but no number for `\si@num@arg'}% - \let\si@num@mantsign\@empty - \fi - \fi - \fi - \renewcommand*{\si@tempa}{{-}}% - \ifx\si@num@mantsign\si@tempa - \ifsi@colourneg - \expandafter\expandafter\expandafter\si@fam@colourcmd - \else - \expandafter\expandafter\expandafter\@gobble - \fi - \else - \expandafter\@gobble - \fi - {\si@negcolour}% - \si@num@procnum{exp}% - \si@num@procnum{mant}% - \si@str@ifonlychrs{\si@num@exp}{0\si@numdecimal} - {\ifsi@allowzeroexp\else - \renewcommand*{\si@num@exp}{}% - \ifx\@empty\si@num@mant\@empty - \renewcommand*{\si@num@mant}{1}% - \fi - \fi}{}% - \ifx\@empty\si@num@exp\@empty\else - \ifsi@trapambigerr - \expandafter\expandafter\expandafter\si@num@ambigerrtrue - \fi - \fi - \protected@edef\si@num@out{% - \ensuremath{{\si@num@mantsign}}\si@num@mant}% - \renewcommand*{\si@tempa}{num}% - \ifsi@num@intab - \protected@edef\si@tab@out{% - \ensuremath{{\si@num@mantsign}}\si@num@predec}% - \protected@edef\si@num@out{\si@num@postdec}% - \renewcommand*{\si@tempa}{tab}% - \fi - \ifx\@empty\si@num@postdec\@empty\else - \renewcommand*{\si@tempa}{num}% - \fi - \ifx\@empty\si@num@err\@empty\else - \ifsi@seperr - \ifsi@num@ambigerr - \protected@edef\si@num@out{% - \ensuremath{\si@openerr}\si@num@out}% - \si@repeatunitsfalse - \expandafter\si@num@erropentrue - \else - \ifsi@trapambigerr\else - \ifx\@empty\si@num@exp\@empty\else - \protected@edef\si@num@err{% - \si@num@err\expandafter\@car\si@numexp\@nil - \si@num@expsign\si@num@exp}% - \ifsi@repeatunits\else - \renewcommand*{\si@num@exp}{}% - \renewcommand*{\si@num@expsign}{}% - \fi - \fi - \fi - \fi - \else - \expandafter\protected@edef\csname - si@\si@tempa @out\endcsname{% - \si@num@out\ensuremath{\si@errspace}\ensuremath - {\si@openerr}\si@num@err\ensuremath{\si@closeerr}}% - \renewcommand*{\si@num@err}{}% - \fi - \fi - \renewcommand*{\si@tempa}{num@out}% - \ifsi@num@erropen - \renewcommand*{\si@tempa}{num@ambig}% - \fi - \ifsi@num@intab - \renewcommand*{\si@tempa}{tab@expout}% - \fi - \ifx\@empty\si@num@exp\@empty - \ifx\@empty\si@num@mant\@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@numdigits')?}% - \renewcommand*\si@num@out{}% - \fi - \else - \ifx\@empty\si@num@mant\@empty\else - \expandafter\protected@edef\csname - si@\si@tempa\endcsname{% - \csname si@\si@tempa\endcsname\ensuremath{{}% - \si@expproduct{}}}% - \fi - \expandafter\protected@edef\csname - si@\si@tempa\endcsname{% - \csname si@\si@tempa\endcsname\si@expbase - \textsuperscript{\ensuremath{\si@num@expsign}% - \si@num@exp}}% - \fi - \ifsi@num@intab\else - \expandafter\si@num@out - \fi - \ifx\@empty\si@num@err\@empty\else - \expandafter\si@num@procerr - \fi - \ifsi@num@erropen - \expandafter\si@out@num\expandafter{% - \ensuremath{\si@closeerr}}% - \ifx\@empty\si@num@ambig\@empty\else - \si@out@num{\si@num@ambig}% - \renewcommand*{\si@num@ambig}{}% - \fi - \fi - \si@num@erropenfalse - \ifx\@empty\si@num@xpart\@empty\else - \expandafter\si@num@sepxpart - \fi} -\def\si@num@findxpart#1#2\@empty{% - \si@str@ifchrstr{#1}{\si@numprod} - {\si@switchtrue\si@seperrfalse}{}% - \ifsi@switch - \protected@edef\si@num@xpart{\si@num@xpart#1}% - \else - \protected@edef\si@num@in{\si@num@in#1}% - \fi - \ifx\@empty#2\@empty\else - \si@num@findxpart#2\@empty - \fi} -\newcommand*{\si@num@sepmantexp}[1]{% - \expandafter\si@num@mantexp#1\@empty\@empty} -\def\si@num@mantexp#1#2\@empty{% - \si@str@ifchrstr{#1}{\si@numgobble} - {\si@log@debug{Gobbling `#1' in \si@num@arg}} - {\si@str@ifchrstr{#1}{\si@numexp} - {\ifsi@switch - \si@log@err{Duplicate exponent marker found} - {Only a single exponent character \MessageBreak - (from the list `\si@numexp')\MessageBreak may - occur in a numerical argument}% - \else - \si@log@debug{Exponent marker `#1' found in - `\si@num@arg'}% - \fi - \si@switchtrue}% - {\ifsi@switch - \expandafter\si@num@addexp - \else - \expandafter\si@num@addmnt - \fi - {#1}}}% - \ifx\@empty#2\@empty - \expandafter\@gobble - \else - \expandafter\si@num@sepmantexp - \fi - {#2}} -\newcommand*{\si@num@addmnt}[1]{% - \si@num@addmntexp{#1}{mant}{mantissa}} -\newcommand*{\si@num@addexp}[1]{% - \si@num@addmntexp{#1}{exp}{exponent}} -\newcommand*{\si@num@addmntexp}[3]{% - \si@log@debug{Adding `#1' to #3 for `\si@num@arg'}% - \expandafter\protected@edef\csname si@num@#2\endcsname{% - \csname si@num@#2\endcsname#1}} -\newcommand*{\si@num@sepsign}[1]{% - \expandafter\ifx\expandafter\@empty - \csname si@num@#1\endcsname\@empty - \expandafter\@gobble - \else - \expandafter\si@num@gensign - \fi - {#1}} -\newcommand*{\si@num@gensign}[1]{% - \expandafter\expandafter\expandafter\si@num@findsign - \csname si@num@#1\endcsname\@empty\@empty - \ifx\@empty\si@num@sign\@empty - \ifx\@empty\si@num@value\@empty - \expandafter\expandafter\expandafter\@gobble - \else - \expandafter\expandafter\expandafter\si@num@addsign - \fi - \else - \expandafter\@gobble - \fi - {#1}% - \expandafter\let\csname si@num@#1sign\endcsname\si@num@sign - \expandafter\let\csname si@num@#1\endcsname\si@num@value} -\newcommand*{\si@num@sign}{} -\def\si@num@findsign#1#2#3\@empty{% - \si@num@delplusfalse - \si@str@ifchrstr{#1}{\si@numsign}{% - \si@str@ifchrstr{#2}{\si@numsign}{% - \if +#1% - \if -#2% - \si@log@debug{Found sign combination +- for - `\si@num@arg'}% - \renewcommand*{\si@num@sign}{{\si@pm}}% - \else - \si@log@inf{Unknown sign combination `#1#2'}% - \renewcommand*{\si@num@sign}{{#1#2}}% - \fi - \else - \if -#1% - \if +#2% - \si@log@debug{Found sign combination -+ for - `\si@num@arg'}% - \renewcommand*{\si@num@sign}{{\mp}}% - \else - \si@log@inf{Unknown sign combination `#1#2'}% - \renewcommand*{\si@num@sign}{{#1#2}}% - \fi - \else - \si@log@inf{Unknown sign combination `#1#2'}% - \renewcommand*{\si@num@sign}{{#1#2}}% - \fi - \fi - \protected@edef\si@num@value{#3}}% - {\si@log@debug{Found single sign character `#1' for - `\si@num@arg'}% - \renewcommand*{\si@num@sign}{{#1}}% - \if +#1% - \ifsi@retainplus\else - \expandafter\expandafter\expandafter\si@num@killsign - \fi - \fi - \protected@edef\si@num@value{#2#3}}}% - {\si@log@debug{No sign found for `\si@num@arg'}% - \renewcommand*{\si@num@sign}{}% - \protected@edef\si@num@value{#1#2#3}}} -\newif\ifsi@num@delplus -\newcommand*{\si@num@killsign}{% - \si@num@delplustrue - \renewcommand*{\si@num@sign}{}} -\newcommand*{\si@num@addsign}[1]{% - \begingroup - \renewcommand*{\si@tempa}{#1}% - \renewcommand*{\si@tempb}{mant}% - \ifx\si@tempa\si@tempb - \aftergroup\@firstoftwo - \else - \aftergroup\@secondoftwo - \fi - \endgroup - {\ifsi@num@signmant - \expandafter\si@num@asign - \else - \expandafter\@gobble - \fi - {mantissa}} - {\ifsi@num@signexp - \expandafter\si@num@asign - \else - \expandafter\@gobble - \fi - {exponent}}} -\newcommand*{\si@num@asign}[1]{% - \let\si@num@sign\si@sign - \si@log@debug{Adding sign \si@sign\space to #1 for - `\si@num@arg'}} -\newcommand*{\si@num@procnum}[1]{% - \expandafter\ifx\expandafter\@empty - \csname si@num@#1\endcsname\@empty - \expandafter\@gobble - \else - \expandafter\si@num@finddigits - \fi - {#1}} -\newcommand*{\si@num@predec}{} -\newcommand*{\si@num@postdec}{} -\newcommand*{\si@num@finddigits}[1]{% - \renewcommand*{\si@num@predec}{}% - \renewcommand*{\si@num@postdec}{}% - \si@switchfalse - \expandafter\expandafter\expandafter\si@num@digits - \csname si@num@#1\endcsname\@empty\@empty - \ifx\@empty\si@num@predec\@empty - \ifsi@num@padlead - \expandafter\expandafter\expandafter\si@num@addprezero - \fi - \fi - \ifx\@empty\si@num@postdec\@empty - \ifsi@num@padtrail - \ifsi@switch - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter - \si@num@addpostzero - \fi - \fi - \fi - \si@num@unsign{#1}% - \ifx\@empty\si@num@predec\@empty - \else - \expandafter\si@num@nozero - \fi - \ifx\@empty\si@num@predec\@empty - \ifx\@empty\si@num@postdec\@empty - \expandafter\expandafter\expandafter\@gobble - \else - \expandafter\expandafter\expandafter\si@num@sepdigits - \fi - \else - \expandafter\si@num@sepdigits - \fi - {#1}} -\def\si@num@digits#1#2\@empty{% - \si@str@ifchrstr{#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'}% - \expandafter\si@switchtrue - \fi} - {\si@str@ifchrstr{#1}{\si@numsign} - {\si@log@err{Misplaced sign character - `#1' in `\si@num@arg'} - {Sign characters `\si@numsign' can only - occur\MessageBreak at the start of a number}} - {\ifsi@switch - \expandafter\si@num@post - \else - \expandafter\si@num@pre - \fi - {#1}}}% - \ifx\@empty#2\@empty\else - \si@num@digits#2\@empty\@empty - \fi} -\newcommand*{\si@num@pre}[1]{% - \si@num@prepost{#1}{pre}{integer}} -\newcommand*{\si@num@post}[1]{% - \si@num@prepost{#1}{post}{decimal}} -\newcommand*{\si@num@prepost}[3]{% - \expandafter\protected@edef\csname si@num@#2dec\endcsname{% - \csname si@num@#2dec\endcsname#1}% - \si@log@debug{Adding `#1' to #3 part for `\si@num@arg'}} -\newcommand*{\si@num@addprezero}{% - \si@num@addpzero{pre}{leading}} -\newcommand*{\si@num@addpostzero}{% - \si@num@addpzero{post}{trailing}} -\newcommand*{\si@num@addpzero}[2]{% - \si@log@debug{Adding #2 zero for `\si@num@arg'}% - \@namedef{si@num@#1dec}{0}} -\newcommand*{\si@num@unsign}[1]{% - \expandafter\ifx\expandafter\@empty - \csname si@num@#1sign\endcsname\@empty - \expandafter\@gobble - \else - \expandafter\si@num@nosign - \fi - {#1}} -\newcommand*{\si@num@nosign}[1]{% - \begingroup - \si@switchtrue - \si@str@ifonlychrs{\si@num@predec\si@num@postdec}{0} - {\si@switchfalse}{}% - \ifsi@switch - \aftergroup\@gobble - \else - \aftergroup\@firstofone - \fi - \endgroup - {\si@log@debug{Zero value: removing any sign}% - \ifsi@ang@sign\else - \@namedef{si@num@#1sign}{}% - \fi}} -\newcommand*{\si@num@nozero}{% - \si@str@ifonlychrs{\si@num@predec}{0} - {\renewcommand*{\si@num@predec}{0}}{}} -\newcommand*{\si@num@decimalhook}{} -\newcommand*{\si@num@sepdigits}[1]{% - \begingroup - \let\si@numextra\si@numaddn - \protected@edef\si@tempa{\si@num@predec\si@num@postdec}% - \si@num@ifextra{\si@tempa} - {\aftergroup\@gobble} - {\aftergroup\@firstofone}% - \endgroup - {\renewcommand*{\si@tempb}{mant}% - \renewcommand*{\si@tempc}{#1}% - \ifx\si@tempb\si@tempc - \expandafter\si@num@checkerr - \fi}% - \protected@edef\si@tempa{\si@num@predec\si@num@postdec}% - \expandafter\si@str@ifonlychrs\expandafter{\si@tempa} - {0123456789} - {\ifx\@empty\si@num@err\@empty - \renewcommand*{\si@tempb}{mant}% - \renewcommand*{\si@tempc}{#1}% - \ifx\si@tempb\si@tempc - \expandafter\expandafter\expandafter\si@num@fixlength - \fi - \fi}{}% - \si@num@ifextra{\si@num@predec}{} - {\expandafter\si@num@int\expandafter{\si@num@predec}}% - \renewcommand*{\si@tempc}{}% - \ifx\@empty\si@num@postdec\@empty\else - \si@num@decimalhook - \renewcommand*{\si@tempc}{% - \ensuremath{{\si@decimalsymbol}}}% - \si@num@ifextra{\si@num@postdec}{} - {\expandafter\si@num@dec\expandafter{\si@num@postdec}}% - \fi - \expandafter\protected@edef\csname si@num@#1\endcsname - {\si@num@predec\si@tempc\si@num@postdec}} -\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'}% - \aftergroup\@firstoftwo - \else - \aftergroup\@secondoftwo - \fi - \endgroup} -\def\si@num@extra#1#2\@empty{% - \ifx\@empty#1\@empty\else - \si@str@ifchrstr{#1}{\si@numextra}{\si@switchtrue}{}% - \ifx\@empty#2\@empty\else - \si@num@extra#2\@empty\@empty - \fi - \fi} -\newif\ifsi@num@ambigerr -\newcommand*{\si@num@checkerr}{% - \ifx\@empty\si@num@postdec\@empty - \expandafter\si@num@preerr - \else - \expandafter\si@num@posterr - \fi} -\newcommand*{\si@num@preerr}{% - \si@num@seperr{pre}% - \ifx\@empty\si@tempb\@empty\else - \expandafter\renewcommand\expandafter*\expandafter - \si@num@err\expandafter{\si@tempb}% - \fi} -\newcommand*{\si@num@posterr}{% - \si@num@seperr{post}% - \ifx\@empty\si@tempb\@empty\else - \ifsi@seperr - \expandafter\expandafter\expandafter\si@num@psterr - \else - \let\si@num@err\si@tempb - \fi - \fi} -\newcommand*{\si@num@psterr}{% - \si@num@cntdigits{\si@tempb}% - \si@tempcntb\si@tempcnta\relax - \si@num@cntdigits{\si@num@postdec}% - \ifnum\si@tempcnta<\si@tempcntb\relax - \expandafter\si@num@largeerr - \else - \expandafter\si@num@smallerr - \fi} -\newcommand*{\si@num@seperr}[1]{% - \si@switchfalse - \renewcommand*{\si@tempa}{}% - \renewcommand*{\si@tempb}{}% - \expandafter\expandafter\expandafter\si@num@finderr - \csname si@num@#1dec\endcsname\@empty\@empty - \ifx\@empty\si@tempb\@empty\else - \expandafter\let\csname si@num@#1dec\endcsname\si@tempa - \fi} -\def\si@num@finderr#1#2\@empty{% - \si@str@ifchrstr{#1}{\si@numopenerr} - {\ifsi@switch - \si@log@err{Invalid error in number} - {The numerical argument \si@num@arg\space has two (or - more)\MessageBreak error-opening characters}% - \else - \expandafter\si@switchtrue - \fi} - {\si@str@ifchrstr{#1}{\si@numcloseerr} - {\ifsi@switch - \ifx\@empty#2\@empty\else - \si@log@err{Invalid error in number} - {The numerical argument \si@num@arg\space has an - error-closing before the last character}% - \fi - \else - \si@log@err{Invalid error in number} - {The numerical argument \si@num@arg\space has an - error-closing character\MessageBreak but no - error-opening one}% - \fi} - {\ifsi@switch - \expandafter\si@num@addtmpb - \else - \expandafter\si@num@addtmpa - \fi - {#1}}}% - \ifx\@empty#2\@empty\else - \si@num@finderr#2\@empty - \fi} -\newcommand*{\si@num@addtmpa}[1]{\si@num@addtmp{a}{#1}} -\newcommand*{\si@num@addtmpb}[1]{\si@num@addtmp{b}{#1}} -\newcommand*{\si@num@addtmp}[2]{% - \expandafter\protected@edef\csname si@temp#1\endcsname{% - \csname si@temp#1\endcsname#2}} -\newcommand*{\si@num@cntdigits}[1]{% - \si@tempcnta\z@\relax - \expandafter\si@num@cntdgt#1\@empty\@empty} -\def\si@num@cntdgt#1#2\@empty{% - \ifx\@empty#1\@empty\else - \advance\si@tempcnta\@ne\relax - \fi - \ifx\@empty#2\@empty\else - \expandafter\si@num@cntdgt#2\@empty - \fi} -\newcommand*{\si@num@smallerr}{% - \si@tempcntb\si@tempcnta\relax - \si@num@serr - \protected@edef\si@num@err{% - \ifsi@num@padlead0\fi\expandafter\@car\si@numdecimal\@nil - \si@tempb}} -\newcommand*{\si@num@serr}{% - \si@num@cntdigits{\si@tempb}% - \ifnum\si@tempcnta=\si@tempcntb\relax\else - \protected@edef\si@tempb{0\si@tempb}% - \expandafter\si@num@serr - \fi} -\newcommand*{\si@num@largeerr}{% - \renewcommand*{\si@tempa}{}% - \si@tempcntb\si@tempcnta\relax - \si@num@lerr - \protected@edef\si@num@err{% - \si@tempa\expandafter\@car\si@numdecimal\@nil\si@tempb}} -\newcommand*{\si@num@lerr}{% - \si@num@cntdigits{\si@tempb}% - \ifnum\si@tempcnta=\si@tempcntb\relax\else - \expandafter\si@num@movedigit\si@tempb\@empty\@empty - \si@num@lerr - \fi} -\def\si@num@movedigit#1#2\@empty{% - \protected@edef\si@tempa{\si@tempa#1}% - \protected@edef\si@tempb{#2}} -\newcommand*{\si@num@fixlength}{% - \ifsi@fixdp - \expandafter\si@num@fixdp - \else - \ifsi@fixsf - \expandafter\expandafter\expandafter\si@num@fixsf - \fi - \fi} -\newcommand*{\si@num@fixdp}{% - \si@num@cntdigits{\si@num@postdec}% - \ifx\@empty\si@num@postdec\@empty - \si@tempcnta\z@\relax - \fi - \ifnum\si@tempcnta>\si@num@dp\relax - \expandafter\si@num@round - \else - \ifnum\si@tempcnta<\si@num@dp\relax - \expandafter\expandafter\expandafter\si@num@pad - \fi - \fi} -\newcommand*{\si@num@pad}{% - \si@log@debug{Padding to \the\si@num@dp\space digits}% - \loop\ifnum\si@tempcnta<\si@num@dp\si@num@pd\repeat} -\newcommand*{\si@num@pd}{% - \advance\si@tempcnta\@ne\relax - \protected@edef\si@num@postdec{\si@num@postdec0}} -\newcount\si@num@rndtarget -\newcommand*{\si@num@prernd}{} -\newcommand*{\si@num@postrnd}{} -\newcommand*{\si@num@round}{% - \si@log@debug{Rounding to \the\si@num@dp\space digits}% - \si@num@rndtarget\si@num@dp\relax - \si@num@rndstart} -\newcommand*{\si@num@rndstart}{% - \si@num@reverse{\si@num@postdec}% - \si@num@reverse{\si@num@predec}% - \let\si@num@prernd\si@num@predec - \let\si@num@postrnd\si@num@postdec - \renewcommand*{\si@num@predec}{}% - \renewcommand*{\si@num@postdec}{}% - \si@switchfalse - \si@num@rnd} -\newcommand*{\si@num@reverse}[1]{% - \renewcommand*{\si@tempa}{}% - \expandafter\si@num@rev#1\@empty\@empty - \let#1\si@tempa} -\def\si@num@rev#1#2\@empty{% - \edef\si@tempa{#1\si@tempa}% - \ifx\@empty#2\@empty\else - \si@num@rev#2\@empty\@empty - \fi} -\newcommand*{\si@num@rnd}{% - \ifx\@empty\si@num@postrnd\@empty - \expandafter\si@num@rndpre - \else - \expandafter\si@num@rndpost - \fi} -\newcommand*{\si@num@rndpre}{% - \expandafter\edef\expandafter\si@tempa\expandafter{% - \expandafter\@car\si@num@prernd\@nil}% - \expandafter\edef\expandafter\si@num@prernd\expandafter{% - \expandafter\@cdr\si@num@prernd\@nil}% - \si@tempcntb\si@tempa\relax - \ifsi@switch - \advance\si@tempcntb\@ne\relax - \fi - \si@switchfalse - \ifnum\si@tempcntb=10\relax - \si@tempcntb\z@\relax - \expandafter\expandafter\expandafter\si@switchtrue - \fi - \edef\si@num@predec{\the\si@tempcntb\si@num@predec}% - \ifx\@empty\si@num@prernd\@empty - \ifsi@switch - \edef\si@num@predec{1\si@num@predec}% - \fi - \else - \expandafter\si@num@rnd - \fi} -\newcommand*{\si@num@rndpost}{% - \expandafter\edef\expandafter\si@tempa\expandafter{% - \expandafter\@car\si@num@postrnd\@nil}% - \expandafter\edef\expandafter\si@num@postrnd\expandafter{% - \expandafter\@cdr\si@num@postrnd\@nil}% - \si@tempcntb\si@tempa\relax - \ifsi@switch - \advance\si@tempcntb\@ne\relax - \fi - \si@switchfalse - \advance\si@num@rndtarget\@ne\relax - \ifnum\si@tempcnta>\si@num@rndtarget\relax - \advance\si@num@rndtarget\m@ne\relax - \else - \advance\si@num@rndtarget\m@ne\relax - \ifnum\si@tempcnta>\si@num@rndtarget\relax - \ifnum\si@tempcntb>4\relax - \expandafter\expandafter\expandafter\si@switchtrue - \fi - \else - \ifnum\si@tempcntb=10\relax - \si@tempcntb\z@\relax - \expandafter\expandafter\expandafter\si@switchtrue - \fi - \edef\si@num@postdec{\the\si@tempcntb\si@num@postdec}% - \fi - \fi - \advance\si@tempcnta\m@ne\relax - \ifnum\si@tempcnta=\m@ne\relax - \si@num@throw - \fi - \si@num@rnd} -\newcommand*{\si@num@throw}{% - \si@num@reverse{\si@num@postdec}% - \edef\si@num@postdec{\expandafter\@cdr\si@num@postdec\@nil}% - \si@num@reverse{\si@num@postdec}} -\newcommand*{\si@num@fixsf}{% - \si@num@cntdigits{\si@num@predec}% - \ifx\@empty\si@num@predec\@empty - \si@tempcnta\z@\relax - \fi - \ifnum\si@tempcnta=\@ne\relax - \renewcommand*{\si@tempa}{0}% - \ifx\si@num@predec\si@tempa - \ifx\@empty\si@num@postdec\@empty\else - \si@tempcnta\z@\relax - \si@switchfalse - \expandafter\si@num@cntpostsf\si@num@postdec - \@empty\@empty - \ifnum\si@tempcnta>\si@num@sf\relax - \si@log@debug{Rounding to \the\si@num@sf\space - figures}% - \si@num@rndtarget\si@num@sf\relax - \si@num@rndstart - \fi - \fi - \else - \si@num@cntprepost - \fi - \else - \ifnum\si@tempcnta<\si@num@sf\relax - \si@num@cntprepost - \else - \advance\si@tempcnta\m@ne\relax - \si@switchfalse - \ifnum\si@tempcnta>\si@num@sf\relax\else - \ifx\@empty\si@num@postdec\@empty\else - \edef\si@num@postdec{\expandafter\@car - \si@num@postdec\@nil}% - \ifnum\si@num@postdec>4\relax - \expandafter\si@switchtrue - \fi - \fi - \fi - \advance\si@tempcnta\@ne\relax - \renewcommand*{\si@num@postdec}{}% - \si@num@reverse{\si@num@predec}% - \let\si@num@prernd\si@num@predec - \renewcommand*{\si@num@predec}{}% - \si@num@sfpre - \ifsi@switch - \edef\si@num@predec{1\si@num@predec}% - \fi - \fi - \fi} -\def\si@num@cntpostsf#1#2\@empty{% - \ifsi@switch - \advance\si@tempcnta\@ne\relax - \else - \if 0#1\relax\else - \si@tempcnta\@ne\relax - \expandafter\expandafter\expandafter\si@switchtrue - \fi - \fi - \ifx\@empty#2\@empty\else - \si@num@cntpostsf#2\@empty\@empty - \fi} -\newcommand*{\si@num@cntprepost}{% - \si@tempcntb\si@tempcnta\relax - \si@num@cntdigits{\si@num@postdec}% - \advance\si@tempcnta\si@tempcntb\relax - \ifnum\si@tempcnta>\si@num@sf - \si@log@debug{Rounding to \the\si@num@sf\space figures}% - \si@num@rndtarget\si@num@sf\relax - \si@num@rndstart - \ifsi@switch - \si@num@throw - \fi - \fi} -\newcommand*{\si@num@sfpre}{% - \expandafter\edef\expandafter\si@tempa\expandafter{% - \expandafter\@car\si@num@prernd\@nil}% - \expandafter\edef\expandafter\si@num@prernd\expandafter{% - \expandafter\@cdr\si@num@prernd\@nil}% - \si@tempcntb\si@tempa\relax - \ifsi@switch - \advance\si@tempcntb\@ne\relax - \fi - \si@switchfalse - \advance\si@num@sf\@ne\relax - \ifnum\si@tempcnta>\si@num@sf\relax - \advance\si@num@sf\m@ne\relax - \edef\si@num@predec{0\si@num@predec}% - \else - \advance\si@num@sf\m@ne\relax - \ifnum\si@tempcnta>\si@num@sf\relax - \ifnum\si@tempcntb>4\relax - \expandafter\expandafter\expandafter\si@switchtrue - \fi - \edef\si@num@predec{0\si@num@predec}% - \else - \ifnum\si@tempcntb=10\relax - \si@tempcntb\z@\relax - \expandafter\expandafter\expandafter\si@switchtrue - \fi - \edef\si@num@predec{\the\si@tempcntb\si@num@predec}% - \fi - \fi - \advance\si@tempcnta\m@ne\relax - \ifx\@empty\si@num@prernd\@empty\else - \expandafter\si@num@sfpre - \fi} -\newcommand*{\si@num@int}[1]{% - \renewcommand*{\si@num@predec}{}% - \ifsi@sepfour - \si@num@intfmt{}#1\@empty\@empty\@empty - \else - \si@num@iffive{#1} - {\si@num@intfmt{}#1\@empty\@empty\@empty} - {\renewcommand*{\si@num@predec}{#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@num@predec{\si@num@predec#1#2#3}% - \if\relax#4\relax\else - \protected@edef\si@num@predec{% - \si@num@predec\ensuremath{\noexpand\si@digitsep}}% - \expandafter\si@num@intsep\expandafter#4% - \fi} -\newcommand*{\si@num@dec}[1]{% - \renewcommand*{\si@num@postdec}{}% - \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@num@postdec{\si@num@postdec#1}}% - \fi} -\newcommand*{\si@num@decfmt}[4]{% - \protected@edef\si@num@postdec{\si@num@postdec#1#2#3}% - \ifx\@empty#4\@empty% - \else - \protected@edef\si@num@postdec{% - \si@num@postdec\ensuremath{\noexpand\si@digitsep}}% - \expandafter\si@num@decfmt\expandafter#4% - \fi} -\newcommand*{\si@num@procerr}{% - \si@num@addunit - \ensuremath{\si@pm}% - \expandafter\si@num\expandafter{\si@num@err}} -\newcommand*{\si@num@sepxpart}{% - \si@num@addunit - \ensuremath{{}\times{}}% - \expandafter\expandafter\expandafter\si@num\expandafter - \expandafter\expandafter{% - \expandafter\@cdr\si@num@xpart\@nil}} -\newcommand*{\si@num@addunit}{% - \si@unt@numtrue - \ifx\@empty\si@unt@unitarg\@empty\else - \ifsi@repeatunits - \begingroup - \si@out@numfalse - \si@fam@setfalse - \si@fam@set - \si@unt@printunit{\si@unt@unitarg}% - \endgroup - \fi - \fi} -\si@newrobustcmd*{\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{% - \let\ifsi@ang@fixdp\ifsi@fixdp - \si@fixdpfalse - \si@ifmtarg{#4} - {\si@log@debug{Angle argument contains no - semi-colons:\MessageBreak decimal angle}% - \si@ang@dec{#1}{}{}} - {\si@log@debug{Angle argument contains - semi-colons:\MessageBreak degree-minute-second angle}% - \renewcommand*{\si@tempa}{#4}% - \renewcommand*{\si@tempb}{;;}% - \ifx\si@tempa\si@tempb\else - \ifsi@strictarc - \renewcommand*{\si@tempb}{;}% - \ifx\si@tempa\si@tempb - \si@log@err{Insufficient semi-colons in argument - of \string\ang}{The argument of - \string\ang\space must contain either no - semi-colons or exactly two}% - \else - \si@log@err{Excess semi-colons in argument of - \string\ang}{The argument of \string\ang\space - must contain either no semi-colons or exactly - two}% - \fi - \fi - \fi - \si@ang@arc{#1}{#2}{#3}}} -\newcommand*{\si@ang@dec}{% - \let\si@ang@fix\@gobble - \ifsi@ang@toarc - \expandafter\si@ang@dectoarc - \else - \sisetup{padangle=none,anglesep=none}\expandafter\si@ang@typeset - \fi} -\newcommand*{\si@ang@arc}{% - \let\si@ang@fix\si@ang@arcfix - \ifsi@ang@todec - \expandafter\si@ang@arctodec - \else - \expandafter\si@ang@typeset - \fi} -\newif\ifsi@ang@fixdp -\newcommand*{\si@ang@fix}[1]{} -\newcommand*{\si@ang@arcfix}[1]{% - \renewcommand*{\si@tempa}{second}% - \renewcommand*{\si@tempb}{#1}% - \ifx\si@tempa\si@tempb - \ifsi@ang@fixdp - \expandafter\expandafter\expandafter\si@fixdptrue - \else - \expandafter\expandafter\expandafter\si@fixdpfalse - \fi - \else - \expandafter\si@fixdpfalse - \fi} -\newcommand*{\si@ang@ifnum}[1]{% - \begingroup - \renewcommand*{\si@numvalid}{0123456789,.+-}% - \ifx\@empty#1\@empty - \aftergroup\@firstoftwo - \else - \si@num@ifvalid{#1} - {\aftergroup\@firstoftwo} - {\aftergroup\@secondoftwo}% - \fi - \endgroup} -\newcommand*{\si@ang@arctodec}[3]{% - \let\si@ang@fix\@gobble - \ifnum\si@num@dp>\thr@@\relax - \si@num@dp\thr@@\relax - \fi - \si@fixdptrue - \si@ang@ifnum{#1} - {\si@ang@ifnum{#2} - {\si@ang@ifnum{#3} - {\si@tempdima\z@\relax - \renewcommand*{\si@tempa}{+}% - \ifx\@empty#1\@empty\else - \si@tempdima #1pt\relax - \fi - \ifdim\si@tempdima<\z@\relax - \renewcommand*{\si@tempa}{-}% - \fi - \ifx\@empty#2\@empty\else - \si@tempdima\dimexpr\si@tempdima\si@tempa - #2pt/60\relax - \fi - \ifdim\si@tempdima<\z@\relax - \renewcommand*{\si@tempa}{-}% - \else - \fi - \ifx\@empty#3\@empty\else - \si@tempdima\dimexpr\si@tempdima\si@tempa - #3pt/3600\relax - \fi - \sisetup{numdecimal=.}% - \expandafter\si@ang@typeset\expandafter{% - \strip@pt\si@tempdima}{}{}} - {\si@ang@notnum{#1}{#2}{#3}}} - {\si@ang@notnum{#1}{#2}{#3}}} - {\si@ang@notnum{#1}{#2}{#3}}} -\newcommand*{\si@ang@dectoarc}[1]{% - \let\si@ang@fix\si@ang@arcfix - \si@ang@fixdptrue - \ifnum\si@num@dp>\@ne\relax - \si@num@dp\@ne\relax - \fi - \si@ang@ifnum{#1} - {\si@tempdima\z@\relax - \ifx\@empty#1\@empty\else - \si@tempdima #1pt\relax - \fi - \si@ang@sepint{deg}% - \si@tempdima\dimexpr\si@tempdima *60\relax - \si@ang@sepint{min}% - \edef\si@tempa{\the\dimexpr\si@tempdima *60\relax}% - \expandafter\newcommand\expandafter*\expandafter{% - \expandafter\si@ang@arcsec\expandafter}\expandafter{% - \expandafter\si@ang@strippt\si@tempa}% - \si@tempdima\z@\relax - \edef\si@tempa{\the\si@tempdima}% - \expandafter\renewcommand\expandafter*\expandafter{% - \expandafter\si@tempa\expandafter}\expandafter{% - \expandafter\si@ang@strippt\si@tempa}% - \ifx\si@tempa\si@ang@arcsec - \renewcommand*{\si@ang@arcsec}{0}% - \fi - \renewcommand*{\si@tempa}{0}% - \ifx\si@ang@arcdeg\si@tempa - \si@temptoks{{}}% - \else - \si@temptoks{{\si@ang@arcdeg}}% - \fi - \ifx\si@ang@arcmin\si@tempa - \si@temptoks\expandafter{\the\si@temptoks{}}% - \else - \si@temptoks\expandafter{\the\si@temptoks{% - \si@ang@arcmin}}% - \fi - \ifx\si@ang@arcsec\si@tempa - \si@temptoks\expandafter{\the\si@temptoks{}}% - \else - \si@temptoks\expandafter{\the\si@temptoks{% - \si@ang@arcsec}}% - \fi - \expandafter\si@ang@typeset\the\si@temptoks} - {\si@ang@notnum{#1}{}{}}} -\newcommand*{\si@ang@sepint}[1]{% - \expandafter\si@ang@sint\the\si@tempdima\@empty - \expandafter\let\csname si@ang@arc#1\endcsname\si@tempa} -\def\si@ang@sint#1.#2\@empty{% - \renewcommand*{\si@tempa}{#1}% - \si@tempdima 0.#2\relax} -\begingroup - \catcode`P=12 - \catcode`T=12 - \lowercase{ - \renewcommand*{\si@tempa}{% - \def\si@ang@strippt##1PT{##1}}} - \expandafter\endgroup -\si@tempa -\newcommand*{\si@ang@notnum}[3]{% - \si@log@warn{Angle `#1;#2;#3' is not a pure - number:\MessageBreak output will be as given}% - \si@ang@typeset{#1}{#2}{#3}} -\newif\ifsi@ang@sign -\newcommand*{\si@ang@typeset}[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@decimalsymbol{\si@decimalsymbol}% - \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'}% - \si@ang@ifnum{#3} - {\ifdim #3 pt=\z@\relax\else - \si@ang@signtrue - \fi}{}% - \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'}% - \si@ang@ifnum{#2} - {\ifdim #2 pt=\z@\relax\else - \si@ang@signtrue - \fi}{}% - \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\fi} -\newcommand*{\si@ang@num}[2]{% - \begingroup - \si@ang@fix{#1}% - \si@ang@movesign{#1}% - \si@num{#2}% - \endgroup} -\newcommand*{\si@ang@signlessnum}[2]{% - \begingroup - \si@ang@fix{#1}% - \si@ang@movesign{#1}% - \sisetup{addsign=none}% - \si@num{#2}% - \endgroup} -\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@decimalsymbol}{% - \setbox\si@tempboxa=\hbox{% - \ensuremath{{\si@ang@decimalsymbol}}}% - \si@tempdima\wd\si@tempboxa\relax - \setbox\si@tempboxb=\hbox to\z@{% - \hss\unhbox\si@tempboxa\hss}% - \setbox\si@tempboxa=\hbox{% - \csname si@sym@#1\endcsname\hskip-\scriptspace}% - \si@tempdimb\wd\si@tempboxa\relax - \setbox\si@tempboxc=\hbox to\z@{% - \hss\unhbox\si@tempboxa\hss}% - \setbox\si@tempboxd=\hbox{% - \usebox\si@tempboxb\usebox\si@tempboxc}% - \ifdim\si@tempdima>\si@tempdimb\relax - \setbox\si@tempboxa=\hbox to\si@tempdima{% - \hss\unhbox\si@tempboxd\hss}% - \else - \setbox\si@tempboxa=\hbox to\si@tempdimb{% - \hss\unhbox\si@tempboxd\hss}% - \fi - \usebox\si@tempboxa% - \ifdim\si@tempdima>\si@tempdimb\relax\else - \hskip\scriptspace - \fi}% - \renewcommand*{\si@num@decimalhook}{\expandafter\aftergroup - \csname si@ang@kill#1\endcsname}}% -\@ifpackageloaded{cellspace} - {\newcolumntype{C}[1]{>{\bcolumn #1\@nil}#1<{\ecolumn}}} - {\AtBeginDocument{ - \@ifpackageloaded{cellspace} - {\newcolumntype{C}[1]{>{\bcolumn #1\@nil}#1<{\ecolumn}}% - \renewcommand*{\NC@rewrite@S}[1][]{% - \edef\si@tempa{\the\@temptokena - >{\noexpand\si@tab@begin@S[#1]}c% - <{\noexpand\si@tab@end@S}}% - \@temptokena\expandafter{\si@tempa}% - \NC@find}} - {}}} -\edef\si@tempa{% - \noexpand\NC@do S\noexpand\NC@do s\the\NC@list} -\newcolumntype{S}{} -\newcolumntype{s}{} -\NC@list\expandafter{\si@tempa} -\newcommand*{\si@tab@corr@colortbl}{\relax} -\AtBeginDocument{ - \@ifpackageloaded{colortbl}{% - \renewcommand*{\si@tab@corr@colortbl}{% - \hskip\stretch{-0.5}\kern\z@ - } - }{} -} -\renewcommand*{\NC@rewrite@S}[1][]{% - \edef\si@tempa{\the\@temptokena - >{\noexpand\si@tab@begin@S[#1]}c% - <{\noexpand\si@tab@end@S}}% - \@temptokena\expandafter{\si@tempa}% - \NC@find} -\renewcommand*{\NC@rewrite@s}[1][]{% - \edef\si@tempa{\the\@temptokena - >{\noexpand\si@tab@begin@s[#1]}c% - <{\noexpand\si@tab@end@s}}% - \@temptokena\expandafter{\si@tempa}% - \NC@find} -\newcommand*{\si@tab@begin@S}[1][]{% - \si@log@debug{Processing S column cell contents}% - \let\si@tab@gettok\si@tab@gettok@S - \si@seperrfalse - \renewcommand*{\si@num@sepxpart}{% - \si@log@err{Multiple numbers not allowed in - tables\MessageBreak Only the first number used} - \@ehb}% - \si@tab@begin[#1]} -\newcommand*{\si@tab@begin@s}[1][]{% - \si@log@debug{Processing s column cell contents}% - \let\si@tab@gettok\si@tab@gettok@s - \si@tab@begin[#1]} -\newtoks\si@tab@toks -\newtoks\si@tab@pretoks -\newtoks\si@tab@posttoks -\newcommand*{\si@tab@begin}[1][]{% - \begingroup - \sisetup{#1}% - \si@tab@toks{}% - \si@tab@pretoks{}% - \si@tab@posttoks{}% - \si@switchfalse - \si@tab@gettok} -\newcommand*{\si@tab@next}{} -\newcommand*{\si@tab@gettok@S}[1]{% - \ifx\tabularnewline#1\relax - \let\si@tab@next\si@tab@newline@S - \else - \ifx\end#1\relax - \let\si@tab@next\end - \else - \ifx\si@tab@end@S#1\relax - \let\si@tab@next\si@tab@end@S - \else - \ifx\endtabular#1\relax - \let\si@tab@next\endtabular - \else - \ifx\csname#1\relax - \let\si@tab@next\csname - \else - \ifx\relax#1\relax - \let\si@tab@next\relax - \else - \let\si@tab@next\si@tab@gettok@S - \ifx\ignorespaces#1\relax - \si@tab@othertok{#1}% - \else - \ifx\unskip#1\relax - \si@tab@othertok{#1}% - \else - \si@str@ifchrstr{#1}{\si@numvalid} - {\si@switchtrue - \si@log@debug{Found numerical cell - contents `#1'}% - \si@tab@toks=\expandafter{% - \the\si@tab@toks#1}} - {\si@tab@ifonechar{#1} - {\futurelet\si@tempa\si@tab@bracetest#1}% - {\si@tab@othertok{#1}}}% - \fi - \fi - \fi - \fi - \fi - \fi - \fi - \fi - \si@tab@next} -\newcommand*{\si@tab@othertok}[1]{% - \si@log@debug{Found other cell contents `\unexpanded{#1}'}% - \ifsi@switch - \si@log@debug{Adding to post-numeral part}% - \si@tab@posttoks=\expandafter{\the\si@tab@posttoks#1}% - \else - \si@log@debug{Adding to pre-numeral part}% - \si@tab@pretoks=\expandafter{\the\si@tab@pretoks#1}% - \fi} -\newcommand*{\si@tab@ifonechar}[1]{\si@tab@onechar#1\@empty} -\def\si@tab@onechar#1#2\@empty{% - \ifx\@empty#2\@empty - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi} -\newcommand*{\si@tab@bracetest}{% - \ifx\si@tempa\bgroup - \expandafter\si@tab@othertok - \else - \expandafter\si@tab@exptest - \fi} -\newcommand*{\si@tab@exptest}[1]{% - \edef\si@tempa{\si@tab@meaning{#1}}% - \ifx\si@tempa\si@tab@macro - \expandafter\si@tab@exptest@aux - \else - \expandafter\si@tab@othertok - \fi - {#1}% -} -\newcommand*{\si@tab@exptest@aux}[1]{% - \ifcsname\expandafter\@gobble\string#1 \endcsname - \si@tab@othertok{#1}% - \else - \si@log@debug{Expanding cell contents `\unexpanded{#1}'}% - \the\si@tab@pretoks - \si@tab@pretoks{}% - \protected@edef\si@tab@next{\noexpand\si@tab@gettok@S#1}% - \fi -} -\newcommand*{\si@tab@meaning}[1]{% - \expandafter\si@tab@strip\meaning#1:->:->\@empty} -\def\si@tab@strip#1:->#2:->#3\@empty{#1} -\newcommand*{\si@tab@macro}{} -\edef\si@tab@macro{\si@tab@meaning{\si@tab@macro}} -\newcommand*{\si@tab@gettok@s}[1]{% - \ifx\tabularnewline#1\relax - \let\si@tab@next\si@tab@newline@s - \else - \ifx\end#1\relax - \let\si@tab@next\end - \else - \ifx\si@tab@end@s#1\relax - \let\si@tab@next\si@tab@end@s - \else - \ifx\endtabular#1\relax - \let\si@tab@next\endtabular - \else - \ifx\csname#1\relax - \let\si@tab@next\csname - \else - \ifx\relax#1\relax - \let\si@tab@next\relax - \else - \let\si@tab@next\si@tab@gettok@s - \ifx\ignorespaces#1\relax\else - \ifx\unskip#1\relax\else - \si@tab@toks=\expandafter{% - \the\si@tab@toks#1}% - \si@log@debug{Found cell contents `#1'}% - \fi - \fi - \fi - \fi - \fi - \fi - \fi - \fi - \si@tab@next} -\newcommand*{\si@tab@end@S}{% - \ifsi@switch - \let\si@tab@lfill\si@tab@lfill@S - \let\si@tab@rfill\si@tab@rfill@S - \else - \let\si@tab@rfill\si@tab@rfill@t - \let\si@tab@lfill\si@tab@lfill@t - \fi - \si@tab@corr@colortbl - \hskip\stretch{\si@tab@lfill}\kern\z@ - \ifsi@switch - \the\si@tab@pretoks - \si@tab@numout - \the\si@tab@posttoks - \else - \the\si@tab@pretoks - \fi - \hskip\stretch{\si@tab@rfill}\kern\z@ - \si@tab@corr@colortbl - \endgroup} -\newcommand*{\si@tab@end@s}{% - \si@tab@corr@colortbl - \hskip\stretch{\si@tab@lfill@s}\kern\z@ - \ignorespaces - \expandafter\si\expandafter{\the\si@tab@toks}% - \unskip - \hskip\stretch{\si@tab@rfill@s}\kern\z@ - \si@tab@corr@colortbl - \endgroup} -\newcommand*{\si@tab@newline@S}{% - \si@tab@end@S - \hfil\relax - \let\si@tab@end\si@tab@end@S - \renewcommand*{\si@tab@end@S}{\let\si@tab@end@S\si@tab@end}% - \tabularnewline} -\newcommand*{\si@tab@newline@s}{% - \si@tab@end@s - \hfil\relax - \let\si@tab@end\si@tab@end@s - \renewcommand*{\si@tab@end@s}{\let\si@tab@end@s\si@tab@end}% - \tabularnewline} -\newcount\si@tempcnta -\newcount\si@tempcntb -\newcommand*{\si@tab@numout}{% - \si@num@intabtrue - \ifsi@tabparseonly\else - \ifsi@tab@fixed - \ifsi@tabautofit - \si@num@dp\si@tab@mantpostcnt\relax - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\si@fixdptrue - \fi - \fi - \fi - \expandafter\si@num\expandafter{\the\si@tab@toks}% - \si@tab@format} -\newbox\si@tab@prebox -\newbox\si@tab@midbox -\newbox\si@tab@postbox -\newbox\si@tab@expbox -\newcommand*{\si@tab@format}{% - \ifsi@tabparseonly - \expandafter\si@tab@outonly - \else - \ifsi@tab@fixed - \expandafter\expandafter\expandafter\si@tab@fixed - \else - \expandafter\expandafter\expandafter\si@tab@unfixed - \fi - \fi - \ifsi@colourvalues - \si@fam@colourcmd{\si@valuecolour}% - \fi - \box\si@tab@prebox\box\si@tab@midbox\box\si@tab@postbox - \box\si@tab@expbox} -\newcommand*{\si@tab@outonly}{% - \si@log@debug{Using non-aligned S column}% - \setbox\si@tab@prebox=\hbox{}% - \setbox\si@tab@midbox=\hbox{}% - \setbox\si@tab@postbox=\hbox{}% - \setbox\si@tab@expbox=\hbox{}% - \protected@edef\si@tempa{% - \si@tab@out - \ifx\@empty\si@num@out\@empty\else - \ensuremath{{\si@decimalsymbol}}% - \fi - \si@num@out - \si@tab@expout}% - \expandafter\si@out@num\expandafter{\si@tempa}} -\newcommand*{\si@tab@unfixed}{% - \si@log@debug{Using variable width S column}% - \ifx\@empty\si@num@out\@empty - \setbox\si@tab@midbox=\hbox - {\phantom{\ensuremath{{\si@decimalsymbol}}}}% - \else - \setbox\si@tab@midbox=\hbox - {\ensuremath{{\si@decimalsymbol}}}% - \fi - \protected@edef\si@num@out{\si@num@out\si@tab@expout}% - \setbox\si@tab@prebox=\hbox{\si@out@num{\si@tab@out}}% - \setbox\si@tab@postbox=\hbox{\si@out@num{\si@num@out}}% - \ifdim\wd\si@tab@prebox>\wd\si@tab@postbox\relax - \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 - \setbox\si@tab@expbox=\hbox{}} -\newdimen\si@tab@predim -\newdimen\si@tab@postdim -\newdimen\si@tab@expdim -\newdimen\si@tempdima -\newdimen\si@tempdimb -\newcommand*{\si@tab@sp}{} -\newcommand*{\si@tab@fixed}{% - \si@log@debug{Using fixed-width S column}% - \let\si@tab@sp\relax - \setbox\si@tab@midbox=\hbox{}% - \setbox\si@tab@expbox=\hbox{}% - \setbox\si@tempboxa=\hbox{\si@out@num{1}}% - \si@tempdima\wd\si@tempboxa\relax - \si@tab@predim\the\si@tab@mantprecnt\si@tempdima\relax - \si@tab@sepcorr{mantpre}{pre}% - \si@tab@postdim\si@tab@mantpostcnt\si@tempdima\relax - \setbox\si@tempboxa=\hbox{\ensuremath{{\si@decimalsymbol}}}% - \ifnum\si@tab@mantpostcnt=\z@\relax\else - \advance\si@tab@postdim\wd\si@tempboxa\relax - \fi - \si@tab@sepcorr{mantpost}{post}% - \setbox\si@tempboxa=\hbox{\si@out@num{^{1}}}% - \si@tempdima\wd\si@tempboxa\relax - \ifnum\si@tab@expprecnt>\z@\relax - \si@tab@expdim\si@tab@expprecnt\si@tempdima\relax - \si@tab@sepcorr{exppre}{exp}% - \fi - \let\si@tab@sp\sp - \ifnum\si@tab@exppostcnt>\z@\relax - \advance\si@tab@expdim\si@tab@exppostcnt\si@tempdima\relax - \setbox\si@tempboxa=\hbox{% - \ensuremath{^{\si@decimalsymbol}}}% - \advance\si@tab@expdim\wd\si@tempboxa\relax - \si@tab@sepcorr{exppost}{exp}% - \fi - \setbox\si@tempboxa=\hbox{\ensuremath{-}}% - \ifsi@tab@mantsign - \advance\si@tab@predim\wd\si@tempboxa\relax - \fi - \setbox\si@tempboxa=\hbox{\ensuremath{^{-}}}% - \ifsi@tab@expsign - \advance\si@tab@expdim\wd\si@tempboxa\relax - \fi - \si@tempcnta\si@tab@expprecnt\relax - \advance\si@tempcnta\si@tab@exppostcnt\relax - \ifnum\si@tempcnta>\z@\relax - \setbox\si@tempboxa=\hbox{\ensuremath{% - {}\si@expproduct{}\si@expbase}}% - \advance\si@tab@expdim\wd\si@tempboxa\relax - \fi - \ifsi@tabalignexp\else - \advance\si@tab@postdim\si@tab@expdim\relax - \fi - \setbox\si@tab@prebox=\hbox to\si@tab@predim{\hss\hfill - \si@out@num{\si@tab@out}}% - \ifx\@empty\si@num@out\@empty - \setbox\si@tab@postbox=\hbox to\si@tab@postdim{\hfil}% - \else - \ifsi@tabalignexp\else - \protected@edef\si@num@out{\si@num@out\si@tab@expout}% - \fi - \setbox\si@tab@postbox=\hbox to\si@tab@postdim - {\ensuremath{{\si@decimalsymbol}}\si@out@num - {\si@num@out}\hfil}% - \fi - \ifx\@empty\si@tab@expout\@empty - \ifsi@tabalignexp - \setbox\si@tab@expbox=\hbox to\si@tab@expdim{\hfil}% - \fi - \else - \ifsi@tabalignexp - \setbox\si@tab@expbox=\hbox to\si@tab@expdim - {\si@out@num{\si@tab@expout}\hfil}% - \fi - \fi} -\newcommand*{\si@tab@sepcorr}[2]{% - \expandafter\si@tempcnta\expandafter\the - \csname si@tab@#1cnt\endcsname\relax - \divide\si@tempcnta\thr@@\relax - \ifsi@sepfour\else - \expandafter\ifnum\expandafter\the - \csname si@tab@#1cnt\endcsname=4\relax - \si@tempcnta\z@\relax - \fi - \fi - \setbox\si@tempboxa=\hbox{% - \ensuremath{\si@tab@sp{\si@digitsep}}}% - \expandafter\advance\csname si@tab@#2dim\endcsname - \si@tempcnta\wd\si@tempboxa} -\si@newrobustcmd*{\SI}[2][]{% - \@ifnextchar[%] - {\si@SI[#1]{#2}} - {\si@SI[#1]{#2}[]}} -\si@newrobustcmd*{\si}[2][]{\si@SI[#1]{}[]{#2}} + \skip_set:Nn \_l_siunitx_table_number_align_skip + { \c_zero_skip plus 1 fill } + \bool_set_false:N \_l_siunitx_table_center_decimal_bool + }, + table-text-alignment .choice:, + table-text-alignment / + center .code:n = + { + \skip_set:Nn \_l_siunitx_table_text_align_skip + { \c_zero_skip plus 0.5 fill } + }, + table-text-alignment / + left .code:n = + { + \skip_set:Nn \_l_siunitx_table_text_align_skip + { \c_zero_skip } + }, + table-text-alignment / + right .code:n = + { + \skip_set:Nn \_l_siunitx_table_text_align_skip + { \c_zero_skip plus 1 fill } + }, + table-auto-round .bool_set:N = \_l_siunitx_table_auto_bool, + table-figures-decimal .int_set:N = \_l_siunitx_table_decimal_int, + table-figures-exponent .int_set:N = + \_l_siunitx_table_exponent_int, + table-figures-integer .int_set:N = \_l_siunitx_table_integer_int, + table-figures-uncertainty .int_set:N = \_l_siunitx_table_uncert_int , + table-parse-only .bool_set:N = + \_l_siunitx_table_parse_only_bool, + table-space-text-pre .tl_set:N = + \_l_siunitx_table_pre_tl, + table-space-text-post .tl_set:N = + \_l_siunitx_table_post_tl, + table-sign-exponent .bool_set:N = + \_l_siunitx_table_sign_exponent_bool, + table-sign-mantissa .bool_set:N = + \_l_siunitx_table_sign_mantissa_bool +} +\keys_set:nn { siunitx } { + table-align-text-post = true, + table-number-alignment = center-decimal-marker, + table-text-alignment = center, + table-figures-decimal = 2, + table-figures-integer = 3 +} +\keys_define:nn { siunitx } { + table-alignment .meta:n = + { + table-number-alignment = #1, + table-text-alignment = #1, + table-unit-alignment = #1 + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_format_convert:nn #1#2 { + \prop_get:NnN \_l_siunitx_number_in_prop {#1} \_l_siunitx_tmpa_tl + \quark_if_no_value:NTF \_l_siunitx_tmpa_tl + { \int_set:cn { _l_siunitx_table_ #2 _int } { 0 } } + { + \prop_get:NnN \_l_siunitx_number_in_prop {#1} \_l_siunitx_tmpa_tl + \int_set:cn { _l_siunitx_table_ #2 _int } { \_l_siunitx_tmpa_tl } + } +} +\keys_define:nn { siunitx } { + table-format .code:n = + { + \_siunitx_number_in_parse:n {#1} + \_siunitx_table_format_convert:nn { mantissa-integer } { integer } + \_siunitx_table_format_convert:nn { mantissa-decimal } { decimal } + \_siunitx_table_format_convert:nn { mantissa-uncertainty } + { uncert } + \_siunitx_table_format_convert:nn { exponent-integer } + { exponent } + \prop_if_in:NnTF \_l_siunitx_number_in_prop { mantissa-sign } + { \bool_set_true:N \_l_siunitx_table_sign_mantissa_bool } + { \bool_set_false:N \_l_siunitx_table_sign_mantissa_bool } + \prop_if_in:NnTF \_l_siunitx_number_in_prop { exponent-sign } + { \bool_set_true:N \_l_siunitx_table_sign_mantissa_bool } + { \bool_set_false:N \_l_siunitx_table_sign_mantissa_bool } + \keys_set:nn { siunitx } { table-number-alignment = center } + }, +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S: { + \bool_if:NTF \_l_siunitx_table_collect_pre_bool + { + \_siunitx_table_align_left:n { \_l_siunitx_table_text_align_skip } + \tl_use:N \_l_siunitx_table_collect_pre_tl + \_siunitx_table_align_right:n + { \_l_siunitx_table_text_align_skip } + } + { + \_siunitx_table_align_left:n + { \_l_siunitx_table_number_align_skip } + \_siunitx_table_print_S_aux: + \_siunitx_table_align_right:n + { \_l_siunitx_table_number_align_skip } + } +} + +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_aux: { + \bool_if:NTF \_l_siunitx_table_parse_only_bool + { + \tl_use:N \_l_siunitx_table_collect_pre_tl + \_siunitx_number_output:V \_l_siunitx_table_collect_tl + \tl_use:N \_l_siunitx_table_collect_post_tl + } + { + \bool_if:NTF \_l_siunitx_table_center_decimal_bool + { \_siunitx_table_print_S_centered: } + { \_siunitx_table_print_S_reserved: } + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_parse: { + \bool_set_false:N \_l_siunitx_error_bool + \_siunitx_number_in_parse:V \_l_siunitx_table_collect_tl + \bool_if:NF \_l_siunitx_error_bool + { + \_siunitx_number_process: + \_siunitx_number_format: + \_siunitx_number_output_color: + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_centered: { + \_siunitx_table_print_S_centered_ends: + \dim_compare:nNnTF + { \box_wd:N \_l_siunitx_table_pre_box } = { \c_zero_skip } + { \tl_use:N \_l_siunitx_table_collect_pre_tl } + { \box_use:N \_l_siunitx_table_pre_box } + \_siunitx_table_print_S_parse: + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_number_out_prop + { integer } { mantissa } + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_number_out_prop + { marker } { mantissa } + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_number_out_prop + { result } { } + \box_set_eq:NN \_l_siunitx_table_result_box \_l_siunitx_tmp_box + \dim_set:Nn \_l_siunitx_table_fill_dim + { \_l_siunitx_table_result_dim - \_l_siunitx_table_integer_dim } + \prop_if_in:NnT \_l_siunitx_number_out_prop + { mantissa-decimal-marker } + { + \dim_set:Nn \_l_siunitx_table_fill_dim + { \_l_siunitx_table_fill_dim - \_l_siunitx_table_marker_dim } + } + \dim_compare:nNnTF + { \_l_siunitx_table_integer_dim } > { \_l_siunitx_table_fill_dim } + { \_siunitx_table_print_S_centered_integer: } + { \_siunitx_table_print_S_centered_decimal: } + \bool_if:NTF \_l_siunitx_table_align_post_bool + { \box_use:N \_l_siunitx_table_post_box } + { + \dim_set:Nn \_l_siunitx_table_fill_dim + { - \dim_use:N \_l_siunitx_table_fill_dim } + \skip_horizontal:N \_l_siunitx_table_fill_dim + \box_use:N \_l_siunitx_table_post_box + \box_use:N \_l_siunitx_table_fill_box + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_centered_ends: { + \hbox_set:Nn \_l_siunitx_table_pre_box + { { \tl_use:N \_l_siunitx_table_collect_pre_tl } } + \hbox_set:Nn \_l_siunitx_table_post_box + { \tl_use:N \_l_siunitx_table_collect_post_tl } + \dim_compare:nNnTF + { \box_wd:N \_l_siunitx_table_pre_box } > + { \box_wd:N \_l_siunitx_table_post_box } + { + \hbox_set_to_wd:Nnn \_l_siunitx_table_post_box + { \box_wd:N \_l_siunitx_table_pre_box } + { + \hbox_unpack_clear:N \_l_siunitx_table_post_box + \tex_hfil:D + } + } + { + \hbox_set_to_wd:Nnn \_l_siunitx_table_pre_box + { \box_wd:N \_l_siunitx_table_post_box } + { + \tex_hfil:D + \hbox_unpack_clear:N \_l_siunitx_table_pre_box + } + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_centered_integer: { + \dim_set:Nn \_l_siunitx_table_fill_dim + { \_l_siunitx_table_integer_dim - \_l_siunitx_table_fill_dim } + \hbox_set_to_wd:Nnn \_l_siunitx_table_fill_box + { \_l_siunitx_table_fill_dim } { \tex_hfil:D } + \box_use:N \_l_siunitx_table_result_box + \box_use:N \_l_siunitx_table_fill_box +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_centered_decimal: { + \dim_set:Nn \_l_siunitx_table_fill_dim + { \_l_siunitx_table_fill_dim - \_l_siunitx_table_integer_dim } + \hbox_set_to_wd:Nnn \_l_siunitx_table_fill_box + { \_l_siunitx_table_fill_dim } { \tex_hfil:D } + \box_use:N \_l_siunitx_table_fill_box + \box_use:N \_l_siunitx_table_result_box +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_reserved: { + \dim_zero:N \_l_siunitx_table_gap_dim + \_siunitx_table_print_S_reserved_ends: + \dim_compare:nNnTF + { \box_wd:N \_l_siunitx_table_pre_box } = { \c_zero_skip } + { \tl_use:N \_l_siunitx_table_collect_pre_tl } + { \box_use:N \_l_siunitx_table_pre_box } + \_siunitx_table_print_S_model_create: + \bool_if:NT \_l_siunitx_table_auto_bool + { + \int_set:Nn \_l_siunitx_process_precision_int + { \_l_siunitx_table_decimal_int } + \tl_set:Nn \_l_siunitx_round_tl { places } + } + \_siunitx_table_print_S_parse: + \intexpr_compare:nNnTF + { + \int_use:N \_l_siunitx_table_integer_int + + \int_use:N \_l_siunitx_table_decimal_int + } + > { 0 } + { \_siunitx_table_print_S_reserved_mantissa: } + { + \prop_if_in:NnT \_l_siunitx_number_out_prop { mantissa-result } + { + \msg_error:nnx { siunitx } { table-partial-number } + { a~mantissa } + } + } + \prop_if_in:NnT \_l_siunitx_number_out_prop { complex-result } + { + \msg_error:nnx { siunitx } { table-partial-number } + { a~complex } + } + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_table_exponent_int } > { 0 } + { \_siunitx_table_print_S_reserved_exponent: } + { + \prop_if_in:NnT \_l_siunitx_number_out_prop { exponent-result } + { + \msg_error:nnx { siunitx } { table-partial-number } + { an~exponent } + } + } + \bool_if:NTF \_l_siunitx_table_align_post_bool + { \box_use:N \_l_siunitx_table_post_box } + { + \hbox_set_to_wd:Nnn \_l_siunitx_table_fill_box + { \dim_use:N \_l_siunitx_table_gap_dim } + { \tex_hfil:D } + \dim_set:Nn \_l_siunitx_table_gap_dim + { - \dim_use:N \_l_siunitx_table_gap_dim } + \skip_horizontal:N \_l_siunitx_table_gap_dim + \box_use:N \_l_siunitx_table_post_box + \box_use:N \_l_siunitx_table_fill_box + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_reserved_ends: { + \hbox_set:Nn \_l_siunitx_tmp_box { \_l_siunitx_table_pre_tl } + \hbox_set_to_wd:Nnn \_l_siunitx_table_pre_box + { \box_wd:N \_l_siunitx_tmp_box } + { + \tex_hfil:D + { \tl_use:N \_l_siunitx_table_collect_pre_tl } + } + \hbox_set:Nn \_l_siunitx_tmp_box { \_l_siunitx_table_post_tl } + \hbox_set_to_wd:Nnn \_l_siunitx_table_post_box + { \box_wd:N \_l_siunitx_tmp_box } + { + \tl_use:N \_l_siunitx_table_collect_post_tl + \tex_hfil:D + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_model_create: { + \prop_clear:N \_l_siunitx_number_in_prop + \_siunitx_table_print_S_model_aux:nn { integer } { mantissa-integer } + \_siunitx_table_print_S_model_aux:nn { decimal } { mantissa-decimal } + \_siunitx_table_print_S_model_aux:nn { uncert } + { mantissa-uncertainty } + \_siunitx_table_print_S_model_aux:nn { exponent } { exponent-integer } + \intexpr_compare:nNnF + { + \int_use:N \_l_siunitx_table_integer_int + + \int_use:N \_l_siunitx_table_decimal_int + } + = { 0 } + { + \prop_put:Nnn \_l_siunitx_number_in_prop { mantissa } + { true } + } + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_table_decimal_int } > { 0 } + { + \prop_put:NnV \_l_siunitx_number_in_prop + { mantissa-decimal-marker } + \_l_siunitx_output_decimal_tl + } + \bool_if:NT \_l_siunitx_table_sign_mantissa_bool + { \prop_put:Nnn \_l_siunitx_number_in_prop { mantissa-sign } { - } } + \intexpr_compare:nNnT + { \int_use:N \_l_siunitx_table_exponent_int } > { 0 } + { + \bool_if:NT \_l_siunitx_table_sign_exponent_bool + { + \prop_put:Nnn \_l_siunitx_number_in_prop { exponent-sign } + { - } + } + } + \_siunitx_number_process: + \_siunitx_number_format: + \prop_set_eq:NN \_l_siunitx_table_model_prop + \_l_siunitx_number_out_prop +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_model_aux:nn #1#2 { + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \prg_replicate:nn { \int_use:c { _l_siunitx_table_ #1 _int } } + { 8 } + } + \tl_if_empty:NF \_l_siunitx_tmpa_tl + { + \prop_put:NnV \_l_siunitx_number_in_prop {#2} \_l_siunitx_tmpa_tl + \prop_put:Nnn \_l_siunitx_number_in_prop {#1} { true } + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_reserved_mantissa: { + \_siunitx_table_print_S_reserved_mantissa_aux:n { mantissa } + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_table_model_prop + { mantissa } { } + \_siunitx_table_print_S_get_mantissa:Nn + \_l_siunitx_number_out_prop { } + \hbox_set_to_wd:Nnn \_l_siunitx_table_result_box + { \_l_siunitx_table_mantissa_dim } + { + \box_use:N \_l_siunitx_table_fill_box + \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl + \tex_hfil:D + } + \box_use:N \_l_siunitx_table_result_box + \_siunitx_table_print_S_reserved_uncert:n { mantissa } +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_reserved_mantissa_aux:n #1 { + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_table_model_prop + { integer } {#1} + \_siunitx_table_print_S_get_integer:Nn + \_l_siunitx_number_out_prop {#1} + \box_clear:N \_l_siunitx_tmp_box + \tl_if_empty:NF \_l_siunitx_tmpa_tl + { + \hbox_set:Nn \_l_siunitx_tmp_box + { \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl } + } + \hbox_set_to_wd:Nnn \_l_siunitx_table_fill_box + { \_l_siunitx_table_integer_dim - \box_wd:N \_l_siunitx_tmp_box } + { \tex_hfil:D } + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_table_model_prop + { decimal } {#1} + \box_clear:N \_l_siunitx_tmp_box + \_siunitx_table_print_S_get_decimal:Nn + \_l_siunitx_number_out_prop {#1} + \tl_if_empty:NF \_l_siunitx_tmpa_tl + { + \hbox_set:Nn \_l_siunitx_tmp_box + { \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl } + } + \dim_set:Nn \_l_siunitx_table_gap_dim + { + \dim_use:N \_l_siunitx_table_decimal_dim - + \box_wd:N \_l_siunitx_tmp_box + } +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_reserved_uncert:n #1 { + \bool_if:NT \_l_siunitx_uncert_sep_bool + { + \intexpr_compare:nNnTF + { \int_use:N \_l_siunitx_table_uncert_int } > { 0 } + { \_siunitx_table_print_S_reserved_uncert_aux:n {#1} } + { + \prop_if_in:NnT \_l_siunitx_number_out_prop + { #1 -uncertainty } + { + \msg_error:nn { siunitx } { table-partial-number } + { an~uncertainty } + } + } + } +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_reserved_uncert_aux:n #1 { + \_siunitx_table_print_S_reserved_uncert_pm:n {#1} + \_siunitx_table_print_S_reserved_mantissa_aux:n { #1 -uncertainty } + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_table_model_prop + { uncert } {#1} + \_siunitx_table_print_S_get_uncert:Nn \_l_siunitx_number_out_prop {#1} + \hbox_set_to_wd:Nnn \_l_siunitx_table_result_box + { \_l_siunitx_table_uncert_dim } + { + \box_use:N \_l_siunitx_table_fill_box + \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl + \tex_hfil:D + } + \box_use:N \_l_siunitx_table_result_box +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_reserved_uncert_pm:n #1 { + \tl_clear:N \_l_siunitx_tmpb_tl + \_siunitx_number_format_join_uncert_pm: + \tl_set:Nx \_l_siunitx_tmpb_tl + { { } \exp_not:V \_l_siunitx_tmpb_tl { } } + \hbox_set:Nn \_l_siunitx_table_result_box + { \_siunitx_print:nV { number } \_l_siunitx_tmpb_tl } + \prop_if_in:NnF \_l_siunitx_number_out_prop { #1 -uncertainty } + { + \hbox_set_to_wd:Nnn \_l_siunitx_table_result_box + { \box_wd:N \_l_siunitx_table_result_box } { \tex_hfil:D } + } + \box_use:N \_l_siunitx_table_result_box +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_reserved_exponent: { + \dim_zero:N \_l_siunitx_table_gap_dim + \_siunitx_table_print_S_reserved_exponent_product: + \_siunitx_table_print_S_measure:Nnn \_l_siunitx_table_model_prop + { exponent } { } + \_siunitx_table_print_S_get_exponent:Nn + \_l_siunitx_number_out_prop { } + \hbox_set_to_wd:Nnn \_l_siunitx_table_result_box + { \_l_siunitx_table_exponent_dim } + { + \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl + \tex_hfil:D + } + \box_use:N \_l_siunitx_table_result_box +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_reserved_exponent_product: { + \tl_clear:N \_l_siunitx_tmpa_tl + \box_clear:N \_l_siunitx_table_result_box + \prop_if_in:NnTF \_l_siunitx_table_model_prop { mantissa-result } + { \_siunitx_table_print_S_reserved_exponent_product_aux_i: } + { + \prop_if_in:NnT \_l_siunitx_table_model_prop { complex-result } + { \_siunitx_table_print_S_reserved_exponent_product_aux_i: } + } + \box_use:N \_l_siunitx_table_result_box +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_reserved_exponent_product_aux_i: { + \tl_set_eq:NN \_l_siunitx_tmpa_tl \_l_siunitx_exponent_product_tl + \bool_if:NT \_l_siunitx_tight_bool + { + \tl_set:Nx \_l_siunitx_tmpa_tl + { { \exp_not:V \_l_siunitx_tmpa_tl } } + } + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \exp_not:N \_siunitx_ensuremath:n + { { } \exp_not:V \_l_siunitx_tmpa_tl { } } + } + \hbox_set:Nn \_l_siunitx_table_result_box + { \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl } + \prop_if_in:NnTF \_l_siunitx_number_out_prop { exponent-result } + { + \prop_if_in:NnF \_l_siunitx_number_out_prop { mantissa-result } + { + \prop_if_in:NnF \_l_siunitx_number_out_prop { complex-result } + { + \_siunitx_table_print_S_reserved_exponent_product_aux_ii: + } + } + } + { \_siunitx_table_print_S_reserved_exponent_product_aux_ii: } -\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@log@inf{Redefining unit \string#2}% - \si@unt@defunit[#1]{#2}{#3}}} -\newcommand*{\provideunit}[3][]{% - \si@ifdefinable{#2} - {\si@unt@defunit[#1]{#2}{#3}} - {}} -\newcommand*{\newprefix}[4][]{% - \si@ifdefinable{#2} - {\si@unt@defprefix[#1]{#2}{#3}{#4}} - {\si@log@err{Prefix \string#2 already defined!}\@eha}} -\newcommand*{\renewprefix}[4][]{% - \si@ifdefinable{#2} - {\si@log@err{Prefix \string#2 undefined}\@ehc - \si@unt@defprefix[#1]{#2}{#3}{#4}} - {\si@log@inf{Redefining prefix \string#2}% - \si@unt@defprefix[#1]{#2}{#3}{#4}}} -\newcommand*{\provideprefix}[4][]{% - \si@ifdefinable{#2} - {\si@unt@defprefix[#1]{#2}{#3}{#4}} - {}} -\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@log@inf{Redefining power \string#2}% - \si@unt@defpower[#1]{#2}{#3}}} -\newcommand*{\providepower}[3][]{% - \si@ifdefinable{#2} - {\si@unt@defpower[#1]{#2}{#3}} - {}} -\newcommand*{\newqualifier}[2]{% - \si@ifdefinable{#1} - {\si@unt@defqual{#1}{#2}} - {\si@log@err{Qualifier \string#1 already defined!}\@eha}} -\newcommand*{\renewqualifier}[2]{% - \si@ifdefinable{#1} - {\si@log@err{Qualifier \string#1 undefined}\@ehc - \si@unt@defqual{#1}{#2}} - {\si@unt@defqual{#1}{#2}}} -\newcommand*{\providequalifier}[2]{% - \si@ifdefinable{#1} - {\si@unt@defqual{#1}{#2}} - {}} -\newif\ifsi@unt@num -\newcommand*{\si@unt@unitarg}{} -\newcommand*{\si@unt@SIopts}{} -\def\si@SI[#1]#2[#3]#4{% - \begingroup - \let\fg\SIfg - \sisetup{#1}% - \renewcommand*{\si@unt@SIopts}{#1}% - \si@fam@mode - \si@unt@numfalse - \si@xspacefalse - \si@ifnotmtarg{#3} - {\si@log@debug{Prefix unit found}% - \si@unt@printunit{#3}}% - \si@ifnotmtarg{#4} - {\renewcommand*{\si@unt@unitarg}{#4}}% - \si@ifnotmtarg{#2} - {\si@log@debug{Number found in \string\SI\space - argument}% - \ifsi@repeatunits\else - \ifsi@trapambigerr - \expandafter\expandafter\expandafter - \si@num@ambigerrtrue - \fi - \fi - \num{#2}% - \si@unt@numtrue}% - \si@ifnotmtarg{#4} - {\si@ifmtarg{#2} - {\si@unt@printunit{#4}} - {\si@tempcnta\z@\relax - \ifsi@addunitpower - \si@unt@countx{#2}% - \fi - \ifnum\si@tempcnta>\z@\relax - \advance\si@tempcnta\@ne\relax - \edef\si@tempa{\noexpand\tothe{\si@tempcnta}}% - \renewcommand*{\si@tempb}{#4}% - \expandafter\expandafter\expandafter - \si@unt@printunit\expandafter\expandafter - \expandafter{% - \expandafter\si@tempb\si@tempa}% - \else - \si@unt@printunit{#4}% - \fi}}% - \endgroup} -\newcommand*{\si@unt@countx}[1]{% - \si@tempcnta\z@\relax - \expandafter\si@unt@cntx#1\@empty\@empty} -\def\si@unt@cntx#1#2\@empty{% - \si@str@ifchrstr{#1}{\si@numprod} - {\advance\si@tempcnta\@ne\relax} - {}% - \ifx\@empty#2\@empty\else - \si@unt@cntx#2\@empty\@empty - \fi} -\newif\ifsi@unt@littest -\newcommand*{\si@unt@ifliteral}[1]{% - \begingroup - \si@unt@littesttrue - \setbox\si@tempboxa=\hbox{\si@unt@out{#1}}% - \ifdim\wd\si@tempboxa>\z@\relax - \aftergroup\@firstoftwo - \else - \aftergroup\@secondoftwo - \fi - \endgroup} -\newif\ifsi@unt@litout -\newcommand*{\si@unt@printunit}[1]{% - \si@unt@ifliteral{#1} - {\ifsi@allowlitunits - \expandafter\si@unt@litprint - \else - \expandafter\si@unt@nolitprint - \fi - {#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@litprint}[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}% -} -\newcommand*{\si@unt@nolitprint}[1]{% - \si@log@err{Literal units disabled}{% - You can the literal input `#1' for a unit\MessageBreak - but the allowliteralunits option is off. +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_reserved_exponent_product_aux_ii: { + \hbox_set_to_wd:Nnn \_l_siunitx_table_result_box + { \box_wd:N \_l_siunitx_table_result_box } { \tex_hfil:D } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_measure:Nnn #1#2#3 { + \use:c { _siunitx_table_print_S_get_ #2 :Nn } #1 {#3} + \tl_if_empty:NTF \_l_siunitx_tmpa_tl + { \dim_set:cn { _l_siunitx_table_ #2 _dim } { \c_zero_skip } } + { + \hbox_set:Nn \_l_siunitx_tmp_box + { \_siunitx_print:nV { number } \_l_siunitx_tmpa_tl } + \dim_set:cn { _l_siunitx_table_ #2 _dim } + { \box_wd:N \_l_siunitx_tmp_box } + } +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_get_decimal:Nn #1#2 { + \prop_get:NnN #1 { #2 -decimal } \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { \tl_clear:N \_l_siunitx_tmpa_tl } +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_get_exponent:Nn #1#2 { + \prop_get:NnN #1 { exponent-result } \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { \tl_clear:N \_l_siunitx_tmpa_tl } +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_get_integer:Nn #1#2 { + \prop_get:NnN #1 { #2 -sign } \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { \tl_clear:N \_l_siunitx_tmpa_tl } + \prop_get:NnN #1 { #2 -integer } \_l_siunitx_tmpb_tl + \quark_if_no_value:NT \_l_siunitx_tmpb_tl + { \tl_clear:N \_l_siunitx_tmpb_tl } + \tl_put_right:NV \_l_siunitx_tmpa_tl \_l_siunitx_tmpb_tl +} +\cs_set_protected_nopar:Npn + \_siunitx_table_print_S_get_mantissa:Nn #1#2 { + \prop_get:NnN #1 { mantissa } \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { \tl_clear:N \_l_siunitx_tmpa_tl } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_get_marker:Nn #1#2 { + \tl_set:Nx \_l_siunitx_tmpa_tl + { + \exp_not:N \_siunitx_ensuremath:n + { \exp_not:V \_l_siunitx_output_decimal_tl } + } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_get_result:Nn #1#2 { + \prop_get:NnN #1 { result } \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { \tl_clear:N \_l_siunitx_tmpa_tl } +} +\cs_set_protected_nopar:Npn \_siunitx_table_print_S_get_uncert:Nn #1#2 { + \prop_get:NnN #1 { #2 -uncertainty } \_l_siunitx_tmpa_tl + \quark_if_no_value:NT \_l_siunitx_tmpa_tl + { \tl_clear:N \_l_siunitx_tmpa_tl } +} +\cs_set_protected_nopar:Npn \_siunitx_table_direct: { + \m@th + \bool_if:NTF \_l_siunitx_table_center_decimal_bool + { \_siunitx_table_direct_centered: } + { \_siunitx_table_direct_reserved: } +} +\char_make_active:N \@ +\cs_set_protected_nopar:Npn \_siunitx_table_direct_centered: { + \cs_set_eq:NN \_siunitx_table_print: + \_siunitx_table_direct_centered_end: + \hbox_set:Nn \_l_siunitx_tmp_box + { \_siunitx_ensuremath:n { \_l_siunitx_output_decimal_tl } } + \hbox_set_to_wd:Nnn \_l_siunitx_table_post_box + { \box_wd:N \_l_siunitx_tmp_box } + { \tex_hfil:D } + \hbox_set:Nn \_l_siunitx_table_pre_box + \c_group_begin_token + \c_math_shift_token + \tl_map_function:NN \_l_siunitx_input_decimal_tl + \_siunitx_table_direct_centered_aux:N +} +\cs_set_protected_nopar:Npn \_siunitx_table_direct_centered_aux:N #1 { + \char_set_lccode:nn { `\@ } { `#1 } + \char_set_mathcode:nn { `#1 } { 32768 } + \tl_to_lowercase:n { \cs_set_nopar:Npn @ } + { + \c_math_shift_token + \c_group_end_token + \hbox_set:Nn \_l_siunitx_table_post_box + \c_group_begin_token + \c_math_shift_token + \_l_siunitx_output_decimal_tl + } +} +\char_make_letter:N \@ +\cs_set_protected_nopar:Npn \_siunitx_table_direct_centered_end: { + \c_math_shift_token + \c_group_end_token + \dim_compare:nNnTF + { \box_wd:N \_l_siunitx_table_pre_box } > + { \box_wd:N \_l_siunitx_table_post_box } + { + \hbox_set_to_wd:Nnn \_l_siunitx_table_post_box + { \box_wd:N \_l_siunitx_table_pre_box } + { + \hbox_unpack:N \_l_siunitx_table_post_box + \tex_hfil:D + } + } + { + \hbox_set_to_wd:Nnn \_l_siunitx_table_pre_box + { \box_wd:N \_l_siunitx_table_post_box } + { + \tex_hfil:D + \hbox_unpack:N \_l_siunitx_table_pre_box + } + } + \box_use:N \_l_siunitx_table_pre_box + \box_use:N \_l_siunitx_table_post_box +} +\char_make_active:N \@ +\cs_set_protected_nopar:Npn \_siunitx_table_direct_reserved: { + \cs_set_eq:NN \_siunitx_table_print: + \_siunitx_table_direct_reserved_end: + \tl_set:Nx \_l_siunitx_tmpa_tl + { \prg_replicate:nn { \_l_siunitx_table_integer_int } { 8 } } + \hbox_set:Nn \_l_siunitx_tmp_box + { + \_siunitx_ensuremath:n + { + \bool_if:NT \_l_siunitx_table_sign_mantissa_bool { - } + \_l_siunitx_tmpa_tl + } + } + \dim_set:Nn \_l_siunitx_table_integer_dim + { \box_wd:N \_l_siunitx_tmp_box } + \tl_set:Nx \_l_siunitx_tmpa_tl + { \prg_replicate:nn { \_l_siunitx_table_decimal_int } { 8 } } + \hbox_set:Nn \_l_siunitx_tmp_box + { + \_siunitx_ensuremath:n + { + \_l_siunitx_output_decimal_tl + \_l_siunitx_tmpa_tl + } + } + \hbox_set_to_wd:Nnn \_l_siunitx_table_post_box + { \box_wd:N \_l_siunitx_tmp_box } + { \tex_hfil:D } + \hbox_set_to_wd:Nnn \_l_siunitx_table_pre_box + { \_l_siunitx_table_integer_dim } + \c_group_begin_token + \c_math_shift_token + \tl_map_function:NN \_l_siunitx_input_decimal_tl + \_siunitx_table_direct_reserved_aux:N + \tex_hfill:D +} +\cs_set_protected_nopar:Npn \_siunitx_table_direct_reserved_aux:N #1 { + \char_set_lccode:nn { `\@ } { `#1 } + \char_set_mathcode:nn { `#1 } { 32768 } + \tl_to_lowercase:n { \cs_set_nopar:Npn @ } + { + \c_math_shift_token + \c_group_end_token + \hbox_set_to_wd:Nnn \_l_siunitx_table_post_box + { \box_wd:N \_l_siunitx_tmp_box } + \c_group_begin_token + \c_math_shift_token + \_l_siunitx_output_decimal_tl + } +} +\char_make_letter:N \@ +\cs_set_protected_nopar:Npn \_siunitx_table_direct_reserved_end: { + \c_math_shift_token + \tex_hfil:D + \c_group_end_token + \_siunitx_table_align_left:n { \_l_siunitx_table_number_align_skip } + \box_use:N \_l_siunitx_table_pre_box + \box_use:N \_l_siunitx_table_post_box + \_siunitx_table_align_right:n { \_l_siunitx_table_number_align_skip } +} +\keys_define:nn { siunitx } { + redefine-symbols .bool_set:N = \_l_siunitx_redefine_symbols_bool, +} +\keys_set:nn { siunitx } { + redefine-symbols = true +} +\AtBeginDocument { + \bool_if:NT \_l_siunitx_redefine_symbols_bool + { + \@ifpackageloaded { textcomp } + { + \keys_set:nn { siunitx } + { + math-degree = \text { \textdegree }, + text-degree = \textdegree, + } + \@ifpackageloaded { mathptmx } { } + { + \keys_set:nn { siunitx } { text-micro = \textmu } + \@ifpackageloaded { fourier } { } + { \keys_set:nn { siunitx } { text-ohm = \textohm } } + } + \tl_if_eq:nVT { OT1 } \encodingdefault + { + \keys_set:nn { siunitx } + { + math-angstrom = \text { \capitalring { A } }, + text-angstrom = \capitalring { A } + } + } + } { } + \@ifpackageloaded { upgreek } + { + \keys_set:nn { siunitx } + { math-ohm = \Upomega } + } { } + } +} +\keys_define:nn { siunitx } { + math-angstrom .tl_set:N = \_l_siunitx_angstrom_math_tl, + math-arcminute .tl_set:N = \_l_siunitx_arcminute_math_tl, + math-arcsecond .tl_set:N = \_l_siunitx_arcsecond_math_tl, + math-celsius .tl_set:N = \_l_siunitx_celsius_math_tl, + math-degree .tl_set:N = \_l_siunitx_degree_math_tl, + math-micro .tl_set:N = \_l_siunitx_micro_math_tl, + math-ohm .tl_set:N = \_l_siunitx_ohm_math_tl +} +\keys_set:nn { siunitx } { + math-angstrom = \text { \AA }, + math-arcminute = { } ^ { \prime }, + math-arcsecond = { } ^ { \prime \prime }, + math-celsius = { } ^ { \circ } \kern - \scriptspace \mathrm { C }, + math-degree = { } ^ { \circ }, + math-micro = \text { \_c_siunitx_mu_tl }, + math-ohm = \text { \ensuremath { \_c_siunitx_omega_tl } }, +} +\keys_define:nn { siunitx } { + text-angstrom .tl_set:N = \_l_siunitx_angstrom_text_tl, + text-arcminute .tl_set:N = \_l_siunitx_arcminute_text_tl, + text-arcsecond .tl_set:N = \_l_siunitx_arcsecond_text_tl, + text-celsius .tl_set:N = \_l_siunitx_celsius_text_tl, + text-degree .tl_set:N = \_l_siunitx_degree_text_tl, + text-micro .tl_set:N = \_l_siunitx_micro_text_tl, + text-ohm .tl_set:N = \_l_siunitx_ohm_text_tl, +} +\keys_set:nn { siunitx } { + text-angstrom = \AA, + text-arcminute = \ensuremath { { } ^ { \prime } }, + text-arcsecond = \ensuremath { { } ^ { \prime \prime } }, + text-celsius = + \ensuremath { { } ^ { \circ } \kern - \scriptspace \text { C } }, + text-degree = \ensuremath { { } ^ { \circ } }, + text-micro = \_c_siunitx_mu_tl , + text-ohm = \ensuremath { \_c_siunitx_omega_tl }, +} +\cs_set_protected:Npn \_siunitx_symbol_new:n #1 { + \cs_set_protected_nopar:cpn { SIUnitSymbol #1 } + { + \mode_if_math:TF + { \tl_to_lowercase:n { \use:c { _l_siunitx_ #1 _math_tl } } } + { \tl_to_lowercase:n { \use:c { _l_siunitx_ #1 _text_tl } } } + } +} +\_siunitx_symbol_new:n { Angstrom } +\_siunitx_symbol_new:n { Arcminute } +\_siunitx_symbol_new:n { Arcsecond } +\_siunitx_symbol_new:n { Celsius } +\_siunitx_symbol_new:n { Degree } +\_siunitx_symbol_new:n { Micro } +\_siunitx_symbol_new:n { Ohm } +\clist_new:N \_l_siunitx_pgf_link_clist +\cs_set_protected_nopar:Npn \_siunitx_pgf_link: { + \clist_clear:N \_l_siunitx_pgf_link_clist + \tl_if_eq:VnT \_l_siunitx_round_tl { figure } + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist { fixed } + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { fixed~zerofill = true } + } + \clist_put_right:Nx \_l_siunitx_pgf_link_clist + { precision = \int_use:N \_l_siunitx_process_precision_int } + \clist_put_right:Nx \_l_siunitx_pgf_link_clist + { + set~decimal~separator = + { { \exp_not:V \_l_siunitx_output_decimal_tl } } + } + \clist_put_right:Nx \_l_siunitx_pgf_link_clist + { + set~thousands~separator = + { \exp_not:V \_l_siunitx_group_sep_tl } + } + \bool_if:NTF \_l_siunitx_group_four_bool + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { min~exponent~for~1000~sep = 3 } + } + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { min~exponent~for~1000~sep = 4 } + } + \bool_if:nF + { + \_l_siunitx_group_decimal_bool || + \_l_siunitx_group_integer_bool + } + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { min~exponent~for~1000~sep = 999 } + } + \bool_if:NTF \_l_siunitx_process_integer_zero_bool + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { skip~0. = false } + } + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { skip~0. = true } + } + \tl_if_eq:VnTF \_l_siunitx_process_sign_tl { + } + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { showpos = true } + } + { + \clist_put_right:Nn \_l_siunitx_pgf_link_clist + { showpos = false } + } + \group_begin: + \cs_set_nopar:Npx \_siunitx_tmp:w + { + \group_end: + \exp_not:N \pgfqkeys + { /pgf/number~format } + { \exp_not:V \_l_siunitx_pgf_link_clist } + } + \_siunitx_tmp:w +} +\msg_set:nnnn { siunitx } { bad-arc-sign } + { Incorrect~use~of~sign~in~degree-minute-second~angle. } + { Only~the~highest~value~part~of~an~angle~can~have~a~sign. } +\msg_set:nnnn { siunitx } { duplicate-complex-root-token } + { Duplicate~complex~root~token~'#1'~in~input. } + { Only~one~complex~root~token~can~appear~in~a~single~number. } +\msg_set:nnnn { siunitx } { duplicate-decimal-token } + { Duplicate~decimal~marker~token~'#1'~in~input. } + { Only one decimal marker token can appear in a single number. } +\msg_set:nnnn { siunitx } { duplicate-exponent-token } + { Duplicate~exponent~marker~token~'#1'~in~input. } + { Only~one~exponent~marker~token~can~appear~in~a~single~number. } +\msg_set:nnnn { siunitx } { duplicate-quotient-token } + { Duplicate~quotient~token. } + { Only~one~quotient~token~can~appear~in~a~single~number. } +\msg_set:nnnn { siunitx } { duplicate-sticky-per } + { Duplicate~\token_to_str:N \per. } + { + When~the~'sticky-per'~option~is~active,~only~one + \token_to_str:N \per \\ + may~appear~in~a~unit. + } +\msg_set:nnnn { siunitx } { empty-arc } + { Empty~degree-minute-second~angle. } + { The~angle~given~does~not~contain~any~numbers. } +\msg_set:nnnn { siunitx } { empty-uncertainty } + { Empty~uncertainty~given~in~'#1'. } + { The~number~given~contains~an~empty~uncertainty. } +\msg_set:nnnn { siunitx } { ending-product-token } + { Misplaced~product~token. } + { A~number~cannot~end~with~a~product~token. } +\msg_set:nnnn { siunitx } { ending-quotient-token } + { Misplaced~quotient~token. } + { A~number~cannot~end~with~a~quotient~token. } +\msg_set:nnnn { siunitx } { invalid-arc-format } + { Invalid~degree-minute-second angle~'#1'. } + { + Angles~given~in~degree-minute-second~format~should~contain~two~';'\\ + symbols~to~divide~up~the~parts~of~the~input.\\ + } +\msg_set:nnnn { siunitx } { invalid-number } + { Invalid~numerical~input~'#1'. } + { + The~input given~as~a~number~does~not~make~logical~sense.\\ + This~happens,~for example,~if~a~number~only~contains~a~sign. + } +\msg_set:nnnn { siunitx } { invalid-token-in-exponent } + { Invalid~exponent~in~numerical~input~'#1'. } + { + The~exponent`part~of~a~number~cannot~contain~an~uncertainty~or~ + complex~part.\\ + The~input~given~appears~to~contain~one~of~these~in~the~exponent. } +\msg_set:nnnn { siunitx } { invalid-token-in-number } + { Invalid~token~'#1'~in~numerical~input. } + { + Numbers~can~only~contain~tokens~defined~using~the~ + 'input-...'~options:\\ + the~token~'#1'~is~not~set~up~as~a~valid~part~of~a~number. + } +\msg_set:nnnn { siunitx } { invalid-token-in-uncertainty } + { Invalid~uncertainty~in~numerical~input~'#1'. } + { + The~uncertainty~part~of~a~number~may~only~contain~digits~or~ + symbols. + } +\msg_set:nnnn { siunitx } { literal-unit } + { Literal~units~disabled. } + { + You~gave~the~literal~input~'#1'\\ + but~literal~unit~output~is~disabled. + } +\msg_set:nnnn { siunitx } { misplaced-sign-token } + { Misplaced~sign~token~'#1'. } + { Sign~tokens~can~only~come~at~the~beginning~of~a~number. } +\msg_set:nnnn { siunitx } { misplaced-complex-root-token } + { Misplaced~complex~token~in~numerical~input~'#1'. } + { + The~root~token~must~come~either~before~or~after~the~real~digits\\ + of~the~complex~part. + } +\msg_set:nnnn { siunitx } { misplaced-uncertainty-token } + { Misplaced~uncertainty~token~'#1'. } + { + The~uncertainty~in~a~number~must~be~given~between~a~set~of~ + delimiters~as~defined~by~the\\ + \c_space_tl \c_space_tl + 'input-open-uncertainty'~and~'input-close-uncertainty'\\ + options. + } +\msg_set:nnnn { siunitx } { multi-part-range } + { Numerical~range~with~multiple~parts. } + { + The~input~'#1'~is~a~number~which~has~more~than~one~part.\\ + Ranges~can~only~contain~one~number~in~each~part. + } +\msg_set:nnn { siunitx } { option-not-available } + { Option~'#1'~not~available~in~strict~mode. } +\msg_set:nnn { siunitx } { option-preamble-only } + { Option~'#1'~only~available~in~the~preamble. } +\msg_set:nnnn { siunitx } { prefix-base-mismatch } + { Prefix~bases~do~not~match. } + { + You~have~asked~for~prefixes~to~be~converted~into~a~power,\\ + but~the~bases~do~not~match. + } +\msg_set:nnn { siunitx } { prefix-only } + { Prefix~with~no~unit. } +\msg_set:nnnn { siunitx } { qualifier-before-unit } + { Qualifier~before~unit. } + { Unit~qualifiers~have~to~follow~after~units,~not~before~them. } +\msg_set:nnnn { siunitx } { restricted-number } + { Token~'#1'~forbidden~in~restricted~numerical~input. } + { + The~current~input~must~be~a~real~number~and~cannot~contain: \\ + \c_space_tl -~an~exponent; \\ + \c_space_tl -~an~uncertainty; \\ + \c_space_tl -~a~complex~part. + } +\msg_set:nnnn { siunitx } { starting-product-token } + { Misplaced~product~token. } + { A~number~cannot~begin~with~a~product~token. } +\msg_set:nnnn { siunitx } { starting-quotient-token } + { Misplaced~quotient~token. } + { A~number~cannot~begin~with~a~quotient~token. } +\msg_set:nnnn { siunitx } { table-partial-number } + { No~space~reserved~for~#1~\msg_line_context:. } + { + The~number~in~the~current~table~cell~contains~#1~part, \\ + but~you~did~not~reserve~any~space~to~print~it: \\ + it~will~be~missing~in~the~output. + } +\msg_set:nnnn { siunitx } { unknown-configuration-file } + { Unknown~configuration~'#1'. } + { The~configuration~file~'siunitx-#1.cfg'~was~not~found. } +\msg_set:nnnn { siunitx } { unknown-option } + { Unknown~option~'#1'. } + { + The~option~file~'#1'~is~not~known~by~siunitx: \\ + perhaps~it~is~spelled~incorrectly. + } +\cs_set_protected_nopar:Npn \DeclareBinaryPrefix #1#2#3 { + \_siunitx_declare_prefix:Nnnn #1 {#2} { 2 } {#3} +} +\cs_set_protected_nopar:Npn \DeclareSIPostPower #1#2 { + \_siunitx_declare_power_after:Nn #1 {#2} +} +\cs_set_protected_nopar:Npn \DeclareSIPrefix #1#2#3 { + \_siunitx_declare_prefix:Nnnn #1 {#2} { 10 } {#3} +} +\cs_set_protected_nopar:Npn \DeclareSIPrePower #1#2 { + \_siunitx_declare_power_before:Nn #1 {#2} +} +\cs_set_protected_nopar:Npn \DeclareSIQualifier #1#2 { + \_siunitx_declare_qualifier:Nn #1 {#2} +} +\cs_set_protected_nopar:Npn \DeclareSIUnit #1#2 { + \_siunitx_declare_unit:Nnn #1 {#2} { } +} +\cs_set_protected_nopar:Npn \DeclareSIUnitWithOptions #1#2#3 { + \_siunitx_declare_unit:Nnn #1 {#2} {#3} } -\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@litprefixfalse - \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@spacestacka}{}% - \renewcommand*{\si@unt@spacestackb}{}% - \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\@namedef\expandafter{% - \expandafter\@gobble\string#2@opt@unt@si}{#1}}% - \protected\def#2{% - \ifsi@allowoptarg - \expandafter\si@unt@withopt - \else - \expandafter\si@unt@noopt - \fi - {#2}{#3}}} -\newcommand*{\si@unt@withopt}[2]{% - \@ifnextchar[%] - {\si@unt@opt{#1}{#2}} - {\si@unt@opt{#1}{#2}[]}} -\newcommand*{\si@unt@noopt}[2]{\si@unt@opt{#1}{#2}[]} -\def\si@unt@opt#1#2[#3]{% - \ifsi@unt@littest - \expandafter\si@gobblethree - \else - \ifsi@unt@litout - \expandafter\expandafter\expandafter\@gobbletwo - \else - \expandafter\expandafter\expandafter\si@unt@unit - \fi - \fi - {#3}{#1}{#2}} -\long\def\si@gobblethree #1#2#3{} -\newif\ifsi@unt@litprefix -\si@unt@litprefixtrue -\newcommand*{\si@unt@defprefix}[4][]{% - \si@log@debug{Declaring multiple \string#1 with\MessageBreak - meaning \string#4}% - \expandafter\expandafter\expandafter\def\expandafter - \csname\expandafter\@gobble\string#2@opt@si\endcsname{#1}% - \protected\def#2{% - \ifsi@unt@littest - \expandafter\si@gobblethree - \else - \ifsi@unt@litout - \expandafter\expandafter\expandafter\@gobbletwo - \else - \ifsi@unt@litprefix - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\@gobbletwo - \else - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\si@unt@prefix - \fi - \fi - \fi - {#2}{#3}{#4}}} -\newcommand*{\si@unt@defpower}[3][]{% - \si@log@debug{Declaring power \string#2 with\MessageBreak - meaning \string#3}% - \expandafter\expandafter\expandafter\def\expandafter - \csname\expandafter\@gobble\string#2@opt@si\endcsname{#1}% - \protected\def#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@defqual}[2]{% - \si@log@debug{Declaring qualifier \string#1 with\MessageBreak - meaning \string#2}% - \protected\def#1{% - \ifsi@unt@littest - \expandafter\@gobble - \else - \ifsi@unt@litout - \expandafter\expandafter\expandafter\si@unt@litqual - \else - \expandafter\expandafter\expandafter\si@unt@qual - \fi - \fi - {#2}}} -\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@numtrue}% - \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 - \renewcommand*{\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}{% - \renewcommand*{\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@prefixsymbolic - \expandafter\si@unt@addprefix - \else - \expandafter\si@unt@countprefix - \fi - {#1}{#2}{#3}} -\newcommand*{\si@unt@addprefix}[3]{% - \si@unt@addtostack{prefix}{#3}} -\newcount\si@unt@prefixcnt -\newcommand*{\si@unt@countprefix}[3]{% - \renewcommand*{\si@tempa}{binary}% - \expandafter\expandafter\expandafter\ifx\expandafter - \csname\expandafter\@gobble\string#1@opt@si\endcsname - \si@tempa - \expandafter\sisetup - \else - \expandafter\@gobble - \fi - {prefixbase=two}% - \si@tempcnta#2\relax - \ifsi@unt@per - \expandafter\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]{% - \renewcommand*{\si@tempa}{post}% - \expandafter\expandafter\expandafter\ifx\expandafter - \csname\expandafter\@gobble\string#1@opt@si\endcsname - \si@tempa - \expandafter\@gobbletwo - \else - \expandafter\si@unt@firstorsecond - \fi - {}{\power}% - \si@unt@powerdim #2 pt\relax - \ifsi@frac\else - \ifsi@unt@per - \expandafter\expandafter\expandafter\si@unt@invpower - \fi - \fi - \renewcommand*{\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 - \else - \si@log@debug{Power \strip@pt\si@unt@powerdim\space saved - to be added after\MessageBreak next unit}% - \fi} -\newdimen\si@unt@powerdim -\newcommand*{\si@unt@stackpower}{% - \si@unt@prepowerfalse - \si@unt@stkpower - \ifsi@stickyper\else - \si@unt@perfalse - \si@unt@perseenfalse - \fi} -\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 - \renewcommand*{\si@tempa}{unit}% - \expandafter\ifx - \csname si@unt@lastadd\si@unt@checkstack\endcsname - \si@tempa - \si@unt@skpwr - \else - \renewcommand*{\si@tempa}{qual}% - \expandafter\ifx - \csname si@unt@lastadd\si@unt@checkstack\endcsname - \si@tempa - \si@unt@skpwrqual - \fi - \fi - \fi - \si@unt@powerdim\z@\relax} -\newcommand*{\si@unt@skpwr}{% - \si@log@debug{Adding power - \strip@pt\si@unt@powerdim\space to output stack}% - \si@unt@addtostack{power}{^{\num[fixdp=false]{% - \strip@pt\si@unt@powerdim}}}} -\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} -\newcommand*{\si@unt@litqual}[1]{(#1)} -\newcommand*{\si@unt@qual}[1]{% - \ifsi@unt@first - \si@log@err{Qualifier before units} - {A unit qualifier can only be given after\MessageBreak - one or more units. You tried to open a unit - with\MessageBreak \string#1}% - \fi - \expandafter\let\expandafter\si@unt@spacestack - \csname si@unt@spacestack\si@unt@checkstack\endcsname - \expandafter\let\csname si@unt@spacestack\si@unt@checkstack - \endcsname\@empty - \renewcommand*{\si@tempa}{power}% - \expandafter\ifx - \csname si@unt@lastadd\si@unt@checkstack\endcsname\si@tempa - \let\si@unt@skpwrqual\relax - \else - \let\si@unt@skpwrqual\si@unt@skpwr - \fi - \si@unt@addtostack{qual}{_{#1}}% - \expandafter\let\csname si@unt@spacestack\si@unt@checkstack - \endcsname\si@unt@spacestack} -\newif\ifsi@unt@per -\newif\ifsi@unt@perseen -\si@newrobustcmd*{\si@per}{% - \ifsi@unt@littest\else - \ifsi@unt@litout - \expandafter\expandafter\expandafter /% - \else - \ifsi@unt@litprefix - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter /% - \else - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\si@unt@per - \fi - \fi - \fi} -\newcommand*{\si@unt@per}{% - \si@unt@firstorsecond{}{\per}% - \ifsi@unt@per - \ifsi@stickyper\else - \expandafter\expandafter\expandafter\si@unt@perfalse - \fi - \else - \expandafter\si@unt@pertrue - \fi} -\let\per\si@per -\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]{% - \renewcommand*{\si@tempa}{#1}% - \expandafter\ifx - \csname si@unt@lastadd\si@unt@checkstack\endcsname\si@tempa - \renewcommand*{\si@tempa}{prefix}% - \expandafter\ifx\csname si@unt@lastadd\si@unt@checkstack - \endcsname\si@tempa - \si@log@warn{Two prefixes found: only first printed}% - \fi - \expandafter\@gobbletwo - \else - \expandafter\si@unt@preplussp - \fi - {#1}{#2}} -\newcommand*{\si@unt@preplussp}[2]{% - \renewcommand*{\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\renewcommand\expandafter*\expandafter{% - \csname si@unt@lastadd\si@unt@checkstack\endcsname}{#1}% - \renewcommand*{\si@tempa}{#1}% - \renewcommand*{\si@tempb}{unit}% - \ifx\si@tempa\si@tempb - \expandafter\si@unt@inccnt - \fi - \renewcommand*{\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@spacestack}{} -\newcommand*{\si@unt@spacestacka}{} -\newcommand*{\si@unt@spacestackb}{} -\newcommand*{\si@unt@holdspace}[1]{% - \renewcommand*{\si@tempa}{b}% - \edef\si@tempb{\si@unt@checkstack}% - \ifx\si@tempa\si@tempb - \ifx\@empty\si@unt@stackb\@empty - \else - \protected@edef\si@unt@spacestackb{#1}% - \fi - \else - \protected@edef\si@unt@spacestacka{#1}% - \fi} -\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@spacestack\si@unt@checkstack\endcsname#1}% - \expandafter\renewcommand\expandafter*\expandafter{% - \csname si@unt@spacestack\si@unt@checkstack\endcsname}{}} -\newcommand*{\si@unt@stackout}{% - \si@unt@litouttrue - \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{\ensuremath{{}\si@prefixproduct{}}}% - \fi - \si@unt@stackvalsep - \let\si@expbase\si@prefixbase - \num[fixdp=false]{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 - \ifsi@trapambigfrac - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\si@unt@notabg - \fi - \fi - \fi} -\newcommand*{\si@unt@notabg}{% - \protected@edef\si@unt@stackb{\si@openfrac\si@unt@stackb - \si@closefrac}} -\begingroup - \catcode`\~=\active - \catcode`\.=\active - \gdef\si@unt@out#1{% - \si@temptoks{#1}% - \si@unt@fullstop - \def.{\ensuremath{\si@unitsep}}% - \def~{\ensuremath{\si@unitspace}}% - \expandafter\protected@edef\expandafter\si@tempa - \expandafter{\the\si@temptoks}% - \begingroup - \si@unt@nonlatin - \makeatletter - \endlinechar\m@ne - \expandafter\si@out\expandafter{% - \expandafter\scantokens\expandafter{\si@tempa}}% - \endgroup} -\endgroup -\begingroup - \catcode`\.=\active - \catcode`\&=12\relax - \begingroup - \lccode`\.=`\.\relax - \lccode`\&=`\.\relax - \lowercase{\endgroup - \gdef\si@unt@fullstop{% - \si@temptoks\expandafter{\expandafter}\expandafter - \si@unt@stp\the\si@temptoks&\@nil} - \gdef\si@unt@stp#1\@nil{% - \edef\si@tempa{\the\si@temptoks}% - \ifx\si@tempa\@empty - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi - {\si@temptoks{#1}} - {\si@temptoks\expandafter{\the\si@temptoks.#1}}% - \si@ifmtarg{#2} - {} - {\si@unt@stp#2\@nil}}} -\endgroup -\newcommand*{\si@unt@nonlatin}{} -\ifdefined\XeTeXrevision - \renewcommand*{\si@unt@nonlatin}{% - \catcode176=\active - \catcode181=\active - \catcode197=\active - \si@unt@sym{176}{\si@sym@degree}% - \si@unt@sym{181}{\si@sym@mu}% - \si@unt@sym{197}{\si@sym@ringA}}% -\fi -\AtBeginDocument{ - \@ifpackageloaded{inputenc} - {\@for\si@tempa:=latin1,latin5,latin9\do{ - \ifx\inputencodingname\si@tempa - \renewcommand*{\si@unt@nonlatin}{% - \catcode176=\active - \catcode181=\active - \catcode197=\active - \si@unt@sym{176}{\si@sym@degree}% - \si@unt@sym{181}{\si@sym@mu}% - \si@unt@sym{197}{\si@sym@ringA}}% - \fi}} - {}} -\newcommand*{\si@unt@sym}[1]{% - \bgroup - \uccode`\~#1% - \uppercase{% - \egroup - \def~}} -\newunit{\kilogram}{kg} -\newunit{\metre}{m} -\newunit{\meter}{\metre} -\newunit{\mole}{mol} -\AtBeginDocument{\provideunit{\second}{s}} -\newunit{\ampere}{A} -\newunit{\kelvin}{K} -\newunit{\candela}{cd} -\AtBeginDocument{ - \@ifundefined{Square}{% - \newpower{\Square}{2}}{}} -\newpower{\ssquare}{2} -\newpower[post]{\squared}{2} -\newpower{\cubic}{3} -\newpower[post]{\cubed}{3} -\newcommand*{\tothe}{\si@tothe{\tothe}} -\newcommand*{\raiseto}{\si@tothe{\raiseto}} -\newcommand*{\si@tothe}[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 - {#1}{#2}} -\newcommand*{\tothe@opt@si}{post} -\newcommand*{\raiseto@opt@si}{} -\si@newrobustcmd*{\numrange}[3][]{% - \begingroup - \sisetup{#1}% - \num{#2}% - \text{\si@tophrase}% - \num{#3}% - \endgroup -} -\si@newrobustcmd*{\SIrange}[4][]{% - \begingroup - \sisetup{#1}% - \ifsi@repeatunits - \SI{#2}{#4}% - \else - \ifsi@trapambigrange - \ensuremath{\si@openrange}% - \fi - \num{#2}% - \fi - \text{\si@tophrase}% - \ifsi@repeatunits - \SI{#3}{#4}% - \else - \ifsi@trapambigrange - \num{#3}% - \ensuremath{\si@closerange\si@valuesep}% - \si{#4}% - \else - \SI{#3}{#4}% - \fi - \fi - \endgroup -} -\newcommand*{\si@loc@load}[1]{% - \let\si@loc@sisetup\sisetup - \renewcommand*{\sisetup}[1]{% - \expandafter\gdef\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*{\si@loc@ltol}[1]{% - \def\si@tempa##1:##2\@nil{\si@loc@load{##1}} - \@for\si@tempb:=#1\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:=#1\do{% - \expandafter\si@tempa\si@tempb::\@nil}% - \expandafter\selectlanguage\expandafter{\languagename}} - {\si@log@warn{babel not loaded \MessageBreak - loctolang option ignored}}}} -\AtBeginDocument{ - \@ifpackageloaded{babel} - {\renewcommand*{\si@loc@ltol}[1]{% - \def\si@tempa##1:##2\@nil{\si@loc@load{##1}}% - \@for\si@tempb:=#1\do{% - \expandafter\si@tempa\si@tempb:\@nil}% - \def\si@tempa##1:##2:##3\@nil{% - \expandafter\addto\expandafter{% - \csname extras##2\endcsname}% - {\si@loc@set{##1}}}% - \@for\si@tempb:=#1\do{% - \expandafter\si@tempa\si@tempb::\@nil}}} - {\renewcommand*{\si@loc@ltol}[1]{% - \si@log@warn{babel not loaded \MessageBreak - loctolang option ignored}}}} -\newcommand*{\addtolocale}[2]{% - \si@addtocsname{si@loc@#1@extra}{#2}} -\begingroup - \catcode`\^=\active - \catcode`\-=\active - \catcode`\_=\active - \gdef\si@out#1{% - \begingroup - \catcode`\^=\active - \catcode`\_=\active - \makeatletter - \endlinechar\m@ne - \ifsi@fam@set\else - \expandafter\si@fam@set - \fi - \text{% - \si@colourcmd{\si@colour}% - \si@fam@italic\si@fam@bold\si@fam@text - \ifsi@textmode - \expandafter\si@out@text - \else - \expandafter\si@out@maths - \fi - {\scantokens{#1}}}% - \endgroup - \check@mathfonts} - \gdef\si@out@text#1{% - \let^\si@out@sp - \let_\si@out@sb - \let\textsuperscript\si@out@sp - \let\textsubscript\si@out@sb - \catcode`\-=\active\relax - \let-\si@out@minus - #1} - \gdef\si@out@maths#1{% - \let^\sp - \let_\sb - \let\textsuperscript\sp - \let\textsubscript\sb - $\si@fam@maths{#1}$} -\endgroup -\newcommand*{\si@out@sp}[1]{\ensuremath{^{\text{#1}}}} -\newcommand*{\si@out@sb}[1]{\ensuremath{_{\text{#1}}}} -\newcommand*{\si@out@minus}{} -\DeclareTextSymbolDefault{\si@out@minus}{TS1} -\DeclareTextSymbol{\si@out@minus}{TS1}{61} -\newif\ifsi@out@num -\newcommand*{\si@out@num}[1]{% - \begingroup - \si@out@numtrue - \si@out{#1}% - \endgroup} -\newcommand*{\si@extension}{cfg} -\newcommand*{\si@fileprefix}{si-} -\newcommand*{\si@ifl@aded}{} -\let\si@ifl@aded\@ifl@aded -\newcommand*{\si@ifloaded}[1]{% - \si@ifl@aded\si@extension{\si@fileprefix#1}} -\newcommand*{\si@loadfile}[1]{% - \si@ifloaded{#1}{} - {\si@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}}}} -\newif\ifsi@outerinput\si@outerinputtrue -\let\si@InputIfFileExists\InputIfFileExists -\AtBeginDocument{ - \renewcommand*{\si@InputIfFileExists}{% - \ifsi@outerinput - \expandafter\si@outerinput - \else - \expandafter\InputIfFileExists - \fi}} -\newcommand*{\si@outerinput}[3]{% - \makeatletter - \nullfont - \si@outerinputfalse - \IfFileExists{#1}% - {#2\@addtofilelist{#1}\@@input \@filef@und\normalsize} - {#3}% - \normalsize - \makeatother} -\newcommand*{\requiresiconfigs}[1]{% - \@for\si@tempb:=#1\do{\si@loadfile{\si@tempb}}} -\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 siunitx 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'}} -\newcommand*{\si@emulating}[2]{% - \@namedef{ver@#1.sty}{#2 siunitx emulation of #1}% - \let\si@tempa\si@blockpkgs - \renewcommand*{\si@blockpkgs}{}% - \@for\si@tempb:=\si@tempa\do{% - \renewcommand*{\si@tempa}{#1}% - \ifx\si@tempa\si@tempb\else - \lowercase{\edef\si@tempa{#1}}% - \lowercase{\edef\si@tempc{\si@tempb}}% - \ifx\si@tempa\si@tempc - \@namedef{ver@\si@tempc.sty}{#2 siunitx emulation of - #1}% - \else - \si@addtolist{\si@blockpkgs}{\si@tempb}% - \fi - \fi}% - \let\si@tempa\si@checkpkgs - \renewcommand*{\si@checkpkgs}{}% - \renewcommand*{\si@tempb}{#1}% - \@for\si@tempc:=\si@tempa\do{% - \ifx\si@tempb\si@tempc\else - \si@addtolist{\si@checkpkgs}{\si@tempc}% - \fi}} -\sisetup{ - addsign=none, - allowlitunits=true, - allowzeroexp=false, - angformat=unchanged, - astroang=false,%( - closeerr=),%( - closefrac=),%( - closerange=), - colour=black, - colourall=false, - colourneg=false, - decimalsymbol=fullstop, - detectdisplay=true, - digitsep=thin, - dp=3, - eVcorra=0.3ex, - eVcorrb=0ex, - errspace=none, - fixdp=false, - inlinebold=text, - load=default, - mathsrm=mathrm, - mathssf=mathsf, - mathstt=mathtt, - mode=maths, - negcolour=red, - noload={}, - numaddn={},%( - numcloseerr=), - numdecimal={.,}, - numdigits=0123456789, - numdiv=/, - numexp=eEdD, - numgobble={}, - numopenerr=(,%) - numprod=x, - numsign=+-\pm\mp, - obeybold=false, - obeyitalic=false, - obeymode=false, - openerr=(,%) - openfrac=(,%) - openrange=(,% - padangle=small, - padnumber=lead, - per=reciprocal, - prefixbase=ten, - prefixproduct=times, - prefixsymbolic=true, - prespace=false, - redefsymbols=true, - repeatunits=true, - retainplus=false, - seperr=false, - sepfour=false, - sign=plus, - slash=slash, - stickyper=false, - strictarc=true, - tabalignexp=true, - tabautofit=false, - tabformat=3.2, - tabnumalign=centredecimal, - tabparseonly=false, - tabtextalign=centre, - tabunitalign=left, - textrm=rmfamily, - textsf=sffamily, - texttt=ttfamily, - tightpm=false, - tophrase=to, - trapambigerr=true, - trapambigfrac=true, - trapambigrange=true, - unitsep=thin, - valuesep=thin, - xspace=false} -\ProcessOptionsX[si] -\ifx\@empty\si@emulate\@empty\else - \@for\si@tempa:=\si@emulate\do{% - \expandafter\si@loademfile\expandafter{\si@tempa}} -\fi -\newcommand*{\si@expanddefault}[2]{% - \expandafter\ifx\expandafter\@empty\csname si@#1\endcsname - \@empty - \else - \renewcommand*{\si@tempb}{default}% - \renewcommand*{\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}% - \renewcommand*{\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} -\IfFileExists{siunitx.cfg} - {\si@log@inf{Local configuration file found}% - \InputIfFileExists{siunitx.cfg}{}{}} - {} -\si@catcodes +\@onlypreamble \DeclareBinaryPrefix +\@onlypreamble \DeclareSIPostPower +\@onlypreamble \DeclareSIPrefix +\@onlypreamble \DeclareSIPrePower +\@onlypreamble \DeclareSIQualifier +\@onlypreamble \DeclareSIUnit +\@onlypreamble \DeclareSIUnitWithOptions +\cs_set_protected_nopar:Npn \SendSettingsToPgf { \_siunitx_pgf_link: } +\@onlypreamble \SendSettingsToPgf +\NewDocumentCommand \ang { o > { \SplitArgument { 2 } { ; } } m } { + \group_begin: + \IfNoValueF {#1} + { \keys_set:nn { siunitx } {#1} } + \_siunitx_angle_output:nnn #2 + \group_end: +} +\NewDocumentCommand \num { o m } { + \group_begin: + \IfNoValueF {#1} + { \keys_set:nn { siunitx } {#1} } + \_siunitx_number_output:n {#2} + \group_end: +} +\NewDocumentCommand \numlist { o > { \SplitList { ; } } m } { + \group_begin: + \IfNoValueF {#1} + { \keys_set:nn { siunitx } {#1} } + \_siunitx_list_numbers:n {#2} + \group_end: +} +\NewDocumentCommand \numrange { o m m } { + \group_begin: + \IfNoValueF {#1} + { \keys_set:nn { siunitx } {#1} } + \_siunitx_range_numbers:nn {#2} {#3} + \group_end: +} +\NewDocumentCommand \si { o m } { + \group_begin: + \IfNoValueTF {#1} + { \_siunitx_unit_output:nn {#2} { } } + { + \keys_set:nn { siunitx } {#1} + \_siunitx_unit_output:nn {#2} {#1} + } + \group_end: +} +\NewDocumentCommand \SIlist { o > { \SplitList { ; } } m m } { + \group_begin: + \IfNoValueTF {#1} + { \_siunitx_list_units:nnn {#2} {#3} { } } + { + \keys_set:nn { siunitx } {#1} + \_siunitx_list_units:nnn {#2} {#3} {#1} + } + \group_end: +} +\NewDocumentCommand \SIrange { o m m m } { + \group_begin: + \IfNoValueTF {#1} + { \_siunitx_range_unit:nnnn {#4} { } {#2} {#3} } + { + \keys_set:nn { siunitx } {#1} + \_siunitx_range_unit:nnnn {#4} {#1} {#2} {#3} + } + \group_end: +} +\NewDocumentCommand \SI { o m o m } { + \group_begin: + \IfNoValueTF {#1} + { \_siunitx_combined:nnnn { } {#2} {#3} {#4} } + { + \keys_set:nn { siunitx } {#1} + \_siunitx_combined:nnnn {#1} {#2} {#3} {#4} + } + \group_end: +} +\NewDocumentCommand \sisetup { m } { + \keys_set:nn { siunitx } {#1} +} +\AtBeginDocument { + \cs_set:Npn \addtocontents #1#2 + { + \protected@write \@auxout + { + \cs_set_eq:NN \label \use_none:n + \cs_set_eq:NN \index \use_none:n + \cs_set_eq:NN \glossary\use_none:n + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_contents_add:N + } + { \token_to_str:N \@writefile {#1} {#2} } + } +} +\cs_set_protected_nopar:Npn \_siunitx_contents_add:N #1 { + \cs_set_nopar:Npn #1 { \token_to_str:N #1 } +} +\cs_set_protected_nopar:Npn \_siunitx_contents_bookmarks: { + \tl_map_function:NN \_l_siunitx_declare_list_tl + \_siunitx_unit_print_literal_aux:N + \msg_redirect_name:nnn { LaTeX / xparse } { redefine-command } + { none } + \cs_set_eq:NN \num \_siunitx_bookmark_num:w + \cs_set_eq:NN \numrange \_siunitx_bookmark_numrange:w + \cs_set_eq:NN \si \_siunitx_bookmark_si:w + \cs_set_eq:NN \SI \_siunitx_bookmark_SI:w + \cs_set_eq:NN \SIrange \_siunitx_bookmark_SIrange:w + \cs_set_nopar:Npn \SIUnitSymbolAngstrom { \AA } + \cs_set_nopar:Npn \SIUnitSymbolArcminute { ' } + \cs_set_nopar:Npn \SIUnitSymbolArcsecond { '' } + \cs_set_nopar:Npn \SIUnitSymbolCelsius { \textcelsius } + \cs_set_nopar:Npn \SIUnitSymbolDegree { \textdegree } + \cs_set_nopar:Npn \SIUnitSymbolMicro { \textmu } + \cs_set_nopar:Npn \SIUnitSymbolOhm { [ohm] } +} +\DeclareExpandableDocumentCommand \_siunitx_bookmark_num:w { o m } {#2} +\DeclareExpandableDocumentCommand \_siunitx_bookmark_numrange:w { o m m } + { #2 \_l_siunitx_range_phrase_tl #3 } +\DeclareExpandableDocumentCommand \_siunitx_bookmark_si:w { o m } {#2} +\DeclareExpandableDocumentCommand \_siunitx_bookmark_SI:w { o m o m } + { \IfNoValueF {#3} {#3} #2 ~ #4 } +\DeclareExpandableDocumentCommand \_siunitx_bookmark_SIrange:w + { o m m m } { #2 ~ #4 \_l_siunitx_range_phrase_tl #3 ~ #4 } +\AtBeginDocument { + \@ifpackageloaded { hyperref } + { \pdfstringdefDisableCommands { \_siunitx_contents_bookmarks: } } + { } +} +\DeclareSIUnit \kilogram { \kilo \gram } +\DeclareSIUnit \metre { m } +\DeclareSIUnit \meter { \metre } +\DeclareSIUnit \mole { mol } +\DeclareSIUnit \second { s } +\DeclareSIUnit \ampere { A } +\DeclareSIUnit \kelvin { K } +\DeclareSIUnit \candela { cd } +\DeclareSIUnit \gram { g } +\DeclareSIPrefix \yocto { y } { -24 } +\DeclareSIPrefix \zepto { z } { -21 } +\DeclareSIPrefix \atto { a } { -18 } +\DeclareSIPrefix \femto { f } { -15 } +\DeclareSIPrefix \pico { p } { -12 } +\DeclareSIPrefix \nano { n } { -9 } +\DeclareSIPrefix \micro { \SIUnitSymbolMicro } { -6 } +\DeclareSIPrefix \milli { m } { -3 } +\DeclareSIPrefix \centi { c } { -2 } +\DeclareSIPrefix \deci { d } { -1 } +\DeclareSIPrefix \deca { da } { 1 } +\DeclareSIPrefix \deka { da } { 1 } +\DeclareSIPrefix \hecto { h } { 2 } +\DeclareSIPrefix \kilo { k } { 3 } +\DeclareSIPrefix \mega { M } { 6 } +\DeclareSIPrefix \giga { G } { 9 } +\DeclareSIPrefix \tera { T } { 12 } +\DeclareSIPrefix \peta { P } { 15 } +\DeclareSIPrefix \exa { E } { 18 } +\DeclareSIPrefix \zetta { Z } { 21 } +\DeclareSIPrefix \yotta { Y } { 24 } +\DeclareSIUnit \becquerel { Bq } +\DeclareSIUnit \celsius { \SIUnitSymbolCelsius } +\DeclareSIUnit \degreeCelsius { \SIUnitSymbolCelsius } +\DeclareSIUnit \coulomb { C } +\DeclareSIUnit \farad { F } +\DeclareSIUnit \gray { Gy } +\DeclareSIUnit \hertz { Hz } +\DeclareSIUnit \henry { H } +\DeclareSIUnit \joule { J } +\DeclareSIUnit \katal { kat } +\DeclareSIUnit \lumen { lm } +\DeclareSIUnit \lux { lx } +\DeclareSIUnit \newton { N } +\DeclareSIUnit \ohm { \SIUnitSymbolOhm } +\DeclareSIUnit \pascal { Pa } +\DeclareSIUnit \radian { rad } +\DeclareSIUnit \siemens { S } +\DeclareSIUnit \sievert { Sv } +\DeclareSIUnit \steradian { sr } +\DeclareSIUnit \tesla { T } +\DeclareSIUnit \volt { V } +\DeclareSIUnit \watt { W } +\DeclareSIUnit \weber { Wb } +\DeclareSIUnitWithOptions \arcmin { \arcminute } + { number-unit-separator = } +\DeclareSIUnitWithOptions \arcminute { \SIUnitSymbolArcminute } + { number-unit-separator = } +\DeclareSIUnitWithOptions \arcsecond { \SIUnitSymbolArcsecond } + { number-unit-separator = } +\DeclareSIUnit \day { d } +\DeclareSIUnitWithOptions \degree { \SIUnitSymbolDegree } + { number-unit-separator = } +\DeclareSIUnit \hectare { ha } +\DeclareSIUnit \hour { h } +\DeclareSIUnit \litre { l } +\DeclareSIUnit \liter { L } +\DeclareSIUnit \minute { min } +\DeclareSIUnit \percent { \char 37 } +\DeclareSIUnit \tonne { t } +\DeclareSIUnit \astronomicalunit { ua } +\DeclareSIUnit \atomicmassunit { u } +\DeclareSIUnit \electronvolt { eV } +\DeclareSIUnit \dalton { Da } +\group_begin: + \char_set_lccode:nn { `\@ } { `\_ } + \char_make_math_subscript:N \@ +\tl_to_lowercase:n { + \group_end: + \DeclareSIUnit \clight { \text { \ensuremath { c @ { 0 } } } } + \DeclareSIUnit \electronmass + { \text { \ensuremath { m @ { \text { e } } } } } +} +\DeclareSIUnit \planckbar { \text { \ensuremath { \hbar } } } +\DeclareSIUnit \elementarycharge { \text { \ensuremath { e } } } +\group_begin: + \char_set_lccode:nn { `\@ } { `\_ } + \char_make_math_subscript:N \@ +\tl_to_lowercase:n { + \group_end: + \DeclareSIUnit \bohr { \text { \ensuremath { a @ { 0 } } } } + \DeclareSIUnit \hartree + { \text { \ensuremath { E @ { \textup { h } } } } } +} +\DeclareSIUnit \angstrom { \SIUnitSymbolAngstrom } +\DeclareSIUnit \bar { bar } +\DeclareSIUnit \barn { b } +\DeclareSIUnit \bel { B } +\DeclareSIUnit \decibel { \deci \bel } +\DeclareSIUnit \knot { kn } +\DeclareSIUnit \mmHg { mmHg } +\DeclareSIUnit \nauticalmile { M } +\DeclareSIUnit \neper { Np } +\DeclareSIPrePower \square { 2 } +\DeclareSIPostPower \squared { 2 } +\DeclareSIPrePower \cubic { 3 } +\DeclareSIPostPower \cubed { 3 } +\NewDocumentCommand \requiresiconfigs { m } { + \keys_set:nn { siunitx } { load-configurations = version-1 } + \clist_map_function:nN {#1} \_siunitx_requireconfig:n +} +\cs_set_protected_nopar:Npn \_siunitx_requireconfig:n #1 { + \tl_if_eq:nnT {#1} { synchem } + { \keys_set:nn { siunitx } { load-configurations = chemistry } } +} +\keys_define:nn { siunitx } { + strict .code:n = + { + \keys_set:nn { siunitx } + { + bracket-numbers = true, + detect-italic = false, + detect-mode = false, + detect-weight = false, + multi-part-units = bracket, + parse-numbers = true, + parse-units = true, + product-units = repeat, + } + \_siunitx_strict_option:n + { + bracket-numbers , + detect-italic , + detect-mode , + detect-weight , + multi-part-units , + parse-numbers , + parse-units , + product-units , + } + \keys_define:nn { siunitx } + { + per-mode / repeated-symbol .code:n = + { + \msg_warning:nnx { siunitx } { option-not-available } + { per-mode~=~repeated-symbol } + } + } + } +} +\_siunitx_option_deactivate:n { strict } +\cs_set_protected_nopar:Npn \_siunitx_strict_option:n #1 { + \clist_map_function:nN {#1} \_siunitx_strict_option_aux:n +} +\cs_set_protected_nopar:Npn \_siunitx_strict_option_aux:n #1 { + \keys_define:nn { siunitx } + { #1 .code:n = + { \msg_warning:nnx { _siunitx} { option-not-available } {#1} } + } +} +\keys_define:nn { siunitx } { + load-configurations .code:n = + { \_siunitx_load_configuration:n {#1} } +} +\cs_set_protected:Npn \_siunitx_load_configuration:n #1 { + \tl_set_rescan:Nnn \_l_siunitx_tmpa_tl + { \char_make_ignore:N \ } {#1} + \clist_map_function:NN \_l_siunitx_tmpa_tl + \_siunitx_load_configuration_aux:n +} +\cs_set_protected:Npn \_siunitx_load_configuration_aux:n #1 { + \tl_if_empty:nF {#1} + { + \file_if_exist:nTF + { siunitx- #1 . \_c_siunitx_configuration_ext_tl } + { + \@onefilewithoptions { siunitx- #1 } [ ] [ ] + \_c_siunitx_configuration_ext_tl + } + { + \msg_error:nnx { siunitx } { unknown-configuration-file } {#1} + } + } +} +\tl_new:N \_c_siunitx_configuration_ext_tl +\tl_set:Nn \_c_siunitx_configuration_ext_tl { cfg } +\file_if_exist:nT { siunitx . \_c_siunitx_configuration_ext_tl } + { + \@onefilewithoptions { siunitx } [ ] [ ] + \_c_siunitx_configuration_ext_tl + } +\ProcessKeysOptions { siunitx } %% %% Copyright (C) 2008-2010 by %% Joseph Wright @@ -3984,11 +5766,8 @@ %% %% This work consists of the file siunitx.dtx %% and the derived files siunitx.pdf, -%% siunitx.sty -%% siunitx.bib, -%% siunitx.ins, -%% siunitx-bug.tex and -%% various .cfg files. +%% siunitx.sty and +%% siunitx.ins. %% %% %% End of file `siunitx.sty'. -- cgit v1.2.3