diff options
author | Karl Berry <karl@freefriends.org> | 2008-09-28 22:41:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-09-28 22:41:56 +0000 |
commit | a67fcd0c52585e36929a2228293ddc24f07c68c2 (patch) | |
tree | efe9a49f1738a5a3764831338a72b09478f6bda6 /Master | |
parent | 0fdbfd30e202ef2ac464b3b1a0137d03babb4576 (diff) |
siunitx 1.1 (28sep08)
git-svn-id: svn://tug.org/texlive/trunk@10777 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
27 files changed, 869 insertions, 169 deletions
diff --git a/Master/texmf-dist/doc/latex/siunitx/si-colour.pdf b/Master/texmf-dist/doc/latex/siunitx/si-colour.pdf Binary files differdeleted file mode 100644 index 0a95a1935a1..00000000000 --- a/Master/texmf-dist/doc/latex/siunitx/si-colour.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx-manual.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-manual.pdf Binary files differdeleted file mode 100644 index 34bd6644f36..00000000000 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx-manual.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf Binary files differindex f6c4808697a..e15849347ac 100644 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf +++ b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 0f82125a68e..ab6979af8ad 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -51,9 +51,7 @@ % documentation in PDF format. Simply decompress siunitx.tds.dtx % in your local TeX directory, run your hash program (texhash, % initexmf --update-fndb, etc.) and everything will be ready to -% go. The user documentation for the package is called -% siunitx-manual.pdf; the file siunitx.pdf includes the user -% manual and the fully-indexed source code. +% go. % % Unpacking: % (a) If siunitx.ins is present: @@ -205,9 +203,10 @@ dcolumn, rccol and numprint packages. % Various adjustments are needed to the packages loaded. xfrac is % only loaded if it is available. \usepackage[final]{graphicx} -\IfFileExists{xfrac.sty} - {\usepackage{xfrac}} - {} +% Currently, xfrac is not working with expl3! +%\IfFileExists{xfrac.sty} +% {\usepackage{xfrac}} +% {} \usepackage{jawltxdoc} \usepackage{textcomp,tikz,pgfplots,tocloft,datatool} \usepackage[latin1]{inputenc} @@ -223,7 +222,7 @@ dcolumn, rccol and numprint packages. %</driver> % \fi % -%\CheckSum{9558} +%\CheckSum{10072} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -305,7 +304,7 @@ dcolumn, rccol and numprint packages. % kibi,byte,molar,Molar,mmHg,mebi,torr,parsec,lightyear,clight, % eVperc,addplot,color,milli,cm,Hz,kg,DeclareRobustCommand, % pascal,dalton,addtolocale,DTLnewdb,DTLnewrow,DTLnewdbentry, -% DTLforeach,DTLiffirstrow,DTLmul}} +% DTLforeach,DTLiffirstrow,DTLmul,newqualifier,hour}} % %\title{\currpkg\ --- A comprehensive (SI) units package^^A % \thanks{This file describes version \fileversion, last revised @@ -781,11 +780,14 @@ dcolumn, rccol and numprint packages. % later. % %\subsection{Literal units} +%\changes{v1.1}{2008/07/23}{Unit processor extended to interpret +% \texttt{\textunderscore} correctly} % Units can be input in two ways, inspired by \SIstyle and \SIunits. -% The \SIstyle-like method uses literal input. Four characters have +% The \SIstyle-like method uses literal input. Five characters have % a special meaning: %\begin{itemize} -% \item ``|^|'' The superscript character is used without the usual +% \item ``|^|'' and ``|_|'' The superscript and subscript +% characters can be used without the usual % need for surrounding maths characters (|$|);^^A$ % \item ``|.|'' and ``|,|'': the full stop (point) symbol and comma % are made active, and produce the current contents of the @@ -797,6 +799,7 @@ dcolumn, rccol and numprint packages. %\begin{LaTeXexample} % \SI{10}{kg.m.s^{-2}}\\ % \SI{1.453}{g/cm^3}\\ +% \SI{6.345}{kg_{pol}.mmol_{cat}^{-1}}\\ % \SI{33.562}{cd~s}\\ % \SI[unitsep=medium]{100}{m.s^{-2}} %\end{LaTeXexample} @@ -1346,6 +1349,23 @@ dcolumn, rccol and numprint packages. % \newprefix[binary]{\kibi}{Ki}{10} %\end{LaTeXexample} % +%\changes{v1.1}{2008/09/22}{Qualifiers introduced} +%\DescribeMacro{\newqualifier} +%\DescribeMacro{\renewqualifier} +%\DescribeMacro{\providequalifier} +% It is possible to create unit ``qualifiers'', which add subscript +% descriptions to units. Although not encouraged, this is sometimes +% necessary to make the meaning clear. No qualifiers are pre-defined +% by \currpkg, and so the user needs to declare them using +% \cs{newqualifier}. Currently, only subscript qualifiers can be +% created; a more extended set of options is planned for the next +% release of \currpkg. +%\begin{LaTeXexample} +% \newqualifier{\polymer}{pol} +% \newqualifier{\catalyst}{cat} +% \si{\kg\polymer\per\mole\catalyst\per\hour} +%\end{LaTeXexample} +% %\section{Specialist units} % In some subject area, there are units which are in common use even % though they are outside of the SI system. Unlike the units @@ -1674,6 +1694,7 @@ dcolumn, rccol and numprint packages. %\subsection{Number formatting} %\DescribeOption{numdigits} %\DescribeOption{numdecimal} +%\DescribeOption{numdiv} %\DescribeOption{numexp} %\DescribeOption{numsign} %\DescribeOption{numaddn} @@ -1686,13 +1707,14 @@ dcolumn, rccol and numprint packages. % \numprint package, \opt{numexp} (the list of exponent markers) % recognises \defaultopt{deDE} as valid by default. \opt{numsign} % contains the sign markers for numbers -% (\defaultopt{+-\cs{pm}\cs{mp}}). \opt{numaddn} and -% \opt{numgobble} both control which other characters do not give an -% error when present in a number. \opt{numaddn} contains valid -% characters which should be included in the final output ``as is'', -% whereas \opt{numgobble} lists the characters that are completely -% ignored. In all cases, the content of the options is a simple -% string, for example \opt{numdigits=1234567890}. +% (\defaultopt{+-\cs{pm}\cs{mp}}). \opt{numdiv} holds the division +% marker in numbers (\defaultopt{/}). \opt{numaddn} and \opt{numgobble} +% both control which other characters do not give an error when present +% in a number. \opt{numaddn} contains valid characters which should be +% included in the final output ``as is'', whereas \opt{numgobble} lists +% the characters that are completely ignored. In all cases, the +% content of the options is a simple string, for example +% \opt{numdigits=1234567890}. % %\DescribeOption{decimalsymbol} %\DescribeOption{digitsep} @@ -1842,15 +1864,38 @@ dcolumn, rccol and numprint packages. % In contrast to the \opt{padnumber} option, the package can alter % the precision of the input number if the \opt{fixdp} option is set. % The will fix the decimal places of the output to the number stored -% in the \opt{dp} option. The later should be a positive integer. +% in the \opt{dp} option. The later should be a positive integer or +% zero. %\begin{LaTeXexample} % \sisetup{fixdp,dp=3} % \num{1}\\ % \num{53.9}\\ % \num{4.56783}\\ % \num{-1.2942}\\ -% \num{-1.2949}\\ -% \num{9.9999} +% \num{-1.2959}\\ +% \num{9.9999}\\ +% \num{2.1264e90}\\ +% \num[dp=0]{12.345} +%\end{LaTeXexample} +% +%\DescribeOption{fixsf} +%\changes{v1.1}{2008/08/22}{New \opt{fixsf} option} +%\DescribeOption{sf} +%\changes{v1.1}{2008/08/22}{New \opt{sf} option} +% In contrast to the \opt{dp} option, the \opt{fixsf} and \opt{sf} +% options control the number of significant figures in the output. +% This never adds extra digits to the output, as significant figures +% are concerned with accuracy. +%\begin{LaTeXexample} +% \sisetup{fixsf,sf=3} +% \num{1}\\ +% \num{53.9}\\ +% \num{4.56783}\\ +% \num{-1.2942}\\ +% \num{-1.2959}\\ +% \num{9.9999}\\ +% \num{2.1264e90}\\ +% \num{773322} %\end{LaTeXexample} % %\subsection{Angle formatting} @@ -1941,7 +1986,7 @@ dcolumn, rccol and numprint packages. % whitespace after shorter mantissa components. In the second % method, no additional space is added after the mantissa, and the % exponents do no line up (\ref{tab:alignexp}). This is controlled -% by the \opt{tabexpalign} option, which can be set to +% by the \opt{tabalignexp} option, which can be set to % \defaultopt{true} or \opt{false}. %\begin{LaTeXexample}[float] % \begin{table} @@ -2004,6 +2049,33 @@ dcolumn, rccol and numprint packages. % \end{table} %\end{LaTeXexample} % +%\DescribeOption{tabparseonly} +% It is possible to turn off the automatic alignment of numbers +% while retaining the ability to parse the |S| column input. +% Setting \opt{tabparseonly} to \opt{true} will still parse the +% column contents, but will not align the decimal markers. The +% alignment of the cell is governed by \opt{tabnumalign} +% (\ref{tab:parse}). +%\begin{LaTeXexample}[float] +% \begin{table} +% \centering +% \caption{The \opt{tabparseonly} option} +% \label{tab:parse} +% \begin{tabular}{% +% S[tabparseonly]% +% S[tabparseonly,tabnumalign=left]% +% S[tabparseonly,tabnumalign=right]} +% \toprule +% {Header} & {Header} & {Header} \\ +% \midrule +% 14.2 & 14.2 & 14.2 \\ +% 1.23456 & 1.23456 & 1.23456 \\ +% 1.2e3 & 1.2e3 & 1.2e3 \\ +% \bottomrule +% \end{tabular} +% \end{table} +%\end{LaTeXexample} +% %\subsection{Units} %\DescribeOption{per} % Most of the unit options are concerned with the processing of named @@ -2330,6 +2402,8 @@ dcolumn, rccol and numprint packages. % expproduct & List or literal & Product sign for exponents \\ % fixdp & Boolean & Switch for fixing decimal \\ % & & places of numbers \\ +% fixsf & Boolean & Switch for fixing significant \\ +% & & figures of numbers \\ % fraction & List & Method used when setting \opt{per=frac} \\ % inlinebold & List & Select how inline bold is tested \\ % load & Modules & Modules to load \\ @@ -2379,8 +2453,9 @@ dcolumn, rccol and numprint packages. % numaddn & Literal & Additional input allowed in numbers \\ % numcloseerr & Literal & Character indicating end of \\ % & & numerical error\\ -% numdecimal & Literal & Decimal symbols in numbers\\ +% numdecimal & Literal & Decimal symbols in numbers \\ % numdigits & Literal & Digit characters in numbers \\ +% numdiv & Literal & Division characters in numbers \\ % numexp & Literal & Exponent characters in numbers \\ % numgobble & Literal & Characters to ignore in numbers \\ % numopenerr & Literal & Character indicating start of \\ @@ -2408,6 +2483,8 @@ dcolumn, rccol and numprint packages. % retainplus & Boolean & Retain explicit plus sign\\ % seperr & Boolean & Separate number and error \\ % sepfour & Boolean & Separate four-digit numbers \\ +% sf & Integer & Number of significant figures \\ +% & & to output numbers to \\ % sign & List or literal & Sign to add to numbers \\ % slash & List or literal & Symbol used for ``/'' \\ % stickyper & Boolean & Require \cs{per} only once \\ @@ -2420,6 +2497,7 @@ dcolumn, rccol and numprint packages. % & & length given by \opt{tabformat} \\ % tabformat & Number & Space reserved in table for numbers \\ % tabnumalign & List & Alignment of |S| column numbers \\ +% tabparseonly & Boolean & Do not align |S| columns \\ % tabtextalign & List & Positioning of text in |S| columns \\ % tabunitalign & List & Positioning of units in |s| columns \\ % textcelsius & Literal & ``$^{\circ}$C'' symbol in text mode \\ @@ -3236,7 +3314,7 @@ author. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{siunitx} - [2008/09/03 v1.0l A comprehensive (SI) units package] + [2008/09/28 v1.1 A comprehensive (SI) units package] % \end{macrocode} % The package requires \eTeX, so the usual test is made. % \begin{macrocode} @@ -3261,6 +3339,7 @@ author. \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 @@ -3271,6 +3350,7 @@ author. \catcode\string`\` 12\relax \catcode`\= 12\relax \catcode`\^ 7\relax +\catcode`\_ 8\relax \catcode`\~ \active\relax \@makeother{\:} \@makeother{\-} @@ -4051,7 +4131,9 @@ author. %\end{macro} %\end{macro} %\end{macro} +%\changes{v1.1}{2008/09/22}{Added \opt{numdiv} option} %\begin{macro}{\si@numdigits} +%\begin{macro}{\si@numdiv} %\begin{macro}{\si@numdecimal} %\begin{macro}{\si@numexp} %\begin{macro}{\si@numprod} @@ -4065,7 +4147,7 @@ author. % and with characters ignored with no output renamed as \opt{gobble}. % \begin{macrocode} \si@opt@cmdkeys{numdigits,numdecimal,numexp,numgobble,numsign,% - numcloseerr,numopenerr,numaddn,numprod} + numcloseerr,numopenerr,numaddn,numprod,numdiv} % \end{macrocode} %\end{macro} %\end{macro} @@ -4076,6 +4158,7 @@ author. %\end{macro} %\end{macro} %\end{macro} +%\end{macro} %\begin{macro}{\si@numvalid} %\begin{macro}{\si@numextra} % The various valid characters are collected together in a single @@ -4086,7 +4169,7 @@ author. \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@numdecimal\si@numdigits\si@numextra\si@numprod\si@numdiv} % \end{macrocode} %\end{macro} %\end{macro} @@ -4354,7 +4437,9 @@ author. \si@opt@boolkey{strictarc} % \end{macrocode} %\end{macro} +%\changes{v1.1}{2008/09/03}{Added \opt{tabparseonly} option} %\begin{macro}{\ifsi@tab@fixed} +%\begin{macro}{\ifsi@tabparseonly} %\begin{macro}{\si@tabnumalign} %\begin{macro}{\si@tab@rfill@S} %\begin{macro}{\si@tab@lfill@S} @@ -4363,6 +4448,7 @@ author. % is used, and the fills used for achieving this. % \begin{macrocode} \newif\ifsi@tab@fixed +\si@opt@boolkey{tabparseonly} \si@opt@choicekey{tabnumalign} {centredecimal,centerdecimal,right,left,centre,center} {\si@tab@fixedtrue @@ -4391,6 +4477,7 @@ author. %\end{macro} %\end{macro} %\end{macro} +%\end{macro} %\begin{macro}{\ifsi@tabalignexp} % A switch for aligning exponents. % \begin{macrocode} @@ -4548,20 +4635,49 @@ author. %\end{macro} %\end{macro} %\begin{macro}{\ifsi@fixdp} +%\changes{v1.1}{2008/08/22}{Modified to work with \opt{fixsf} option} %\begin{macro}{\si@num@dp} +%\changes{v1.1}{2008/08/22}{Modified to work with \opt{fixsf} option} % To allow control of rounding, two options are needed. One sets how % many fixed digits to use, the second turns this function on and % off. % \begin{macrocode} -\si@opt@boolkey{fixdp} +\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@num@dp#1\relax - \si@fixdptrue} + {The dp option must be given a positive integer}}} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\ifsi@fixsf} +%\begin{macro}{\si@num@sf} +% A similar approach for fixing significant figures. +% \begin{macrocode} +\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}}} % \end{macrocode} %\end{macro} %\end{macro} @@ -5799,6 +5915,7 @@ author. \def\,{}% \catcode`\~=\active\relax \catcode`\^=\active\relax + \catcode`\_=\active\relax \everyeof{\noexpand}% \endlinechar\m@ne \protected@xdef\si@tempa{\scantokens{#1}}% @@ -6648,6 +6765,9 @@ author. \expandafter\si@num@checkerr \fi}% % \end{macrocode} +%\changes{v1.1}{2008/08/22}{Fixed-length code generalised} +%\changes{v1.1}{2008/08/26}{Length-fixing only applies to +% manitssa} % If both parts of the number contain only digits, then any rounding % can be attempted if there is no error part. Otherwise, the input % must be left alone. @@ -6656,8 +6776,10 @@ author. \expandafter\si@str@ifonlychrs\expandafter{\si@tempa} {0123456789} {\ifx\@empty\si@num@err\@empty - \ifsi@fixdp - \expandafter\expandafter\expandafter\si@num@fixdp + \renewcommand*{\si@tempb}{mant}% + \renewcommand*{\si@tempc}{#1}% + \ifx\si@tempb\si@tempc + \expandafter\expandafter\expandafter\si@num@fixlength \fi \fi}{}% % \end{macrocode} @@ -6894,6 +7016,8 @@ author. %\end{macro} %\end{macro} %\begin{macro}{\si@num@largeerr} +%\changes{v1.0m}{2008/09/16}{Fixed problem with error separation +% crossing decimal boundary} %\begin{macro}{\si@num@lerr} %\begin{macro}{\si@num@movedigit} % When the error has more digits than the decimal part, some @@ -6904,7 +7028,7 @@ author. \si@tempcntb\si@tempcnta\relax \si@num@lerr \protected@edef\si@num@err{% - \si@tempa\ensuremath{\si@decimalsymbol}\si@tempb}} + \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 @@ -6918,6 +7042,19 @@ author. %\end{macro} %\end{macro} %\end{macro} +%\begin{macro}{\si@num@fixlength} +% The checks for fixing number length are spun out here. +% \begin{macrocode} +\newcommand*{\si@num@fixlength}{% + \ifsi@fixdp + \expandafter\si@num@fixdp + \else + \ifsi@fixsf + \expandafter\expandafter\expandafter\si@num@fixsf + \fi + \fi} +% \end{macrocode} +%\end{macro} %\begin{macro}{\si@num@fixdp} % The test for fixing decimal places starts by counting up the number % of decimal digits. The number is then padded, rounded or left @@ -6951,9 +7088,19 @@ author. % \end{macrocode} %\end{macro} %\end{macro} +%\begin{macro}{\si@num@rndtarget} +%\changes{v1.1}{2008/08/25}{New counter} +% A scratch counter is created to allow some code sharing between +% fixing decimal places and significant figures. +% \begin{macrocode} +\newcount\si@num@rndtarget +% \end{macrocode} +%\end{macro} %\begin{macro}{\si@num@round} %\begin{macro}{\si@num@prernd} %\begin{macro}{\si@num@postrnd} +%\begin{macro}{\si@num@rndstart} +%\changes{v1.1}{2008/08/25}{Separated out from \cs{si@num@round}} % Rounding a number is more complicated. The main macro here relies % on several others, and is simply a set-up and hand-off system. % \begin{macrocode} @@ -6961,6 +7108,9 @@ author. \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 @@ -6973,6 +7123,7 @@ author. %\end{macro} %\end{macro} %\end{macro} +%\end{macro} %\begin{macro}{\si@num@reverse} %\begin{macro}{\si@num@rev} %\darg{storage-macro} @@ -6993,6 +7144,8 @@ author. %\end{macro} %\end{macro} %\begin{macro}{\si@num@rnd} +%\changes{v1.1}{2008/08/25}{Altered check for ending to generalise +% code} %\begin{macro}{\si@num@rndpre} %\begin{macro}{\si@num@rndpost} %\changes{v1.0b}{2008/06/23}{Corrected bug in rounding code} @@ -7005,10 +7158,10 @@ author. % to achieve the same thing. % \begin{macrocode} \newcommand*{\si@num@rnd}{% - \ifnum\si@tempcnta>\z@\relax - \expandafter\si@num@rndpost - \else + \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{% @@ -7042,12 +7195,12 @@ author. \advance\si@tempcntb\@ne\relax \fi \si@switchfalse - \advance\si@num@dp\@ne\relax - \ifnum\si@tempcnta>\si@num@dp\relax - \advance\si@num@dp\m@ne\relax + \advance\si@num@rndtarget\@ne\relax + \ifnum\si@tempcnta>\si@num@rndtarget\relax + \advance\si@num@rndtarget\m@ne\relax \else - \advance\si@num@dp\m@ne\relax - \ifnum\si@tempcnta>\si@num@dp\relax + \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 @@ -7060,11 +7213,175 @@ author. \fi \fi \advance\si@tempcnta\m@ne\relax +% \end{macrocode} +% If \cs{si@tempcnta} is negative, this must be the significant +% figures routine and one digit needs to be thrown away. +% \begin{macrocode} + \ifnum\si@tempcnta=\m@ne\relax + \si@num@throw + \fi \si@num@rnd} % \end{macrocode} %\end{macro} %\end{macro} %\end{macro} +%\begin{macro}{\si@num@throw} +% Throw one digit away from the end of the post-decimal part. +% \begin{macrocode} +\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}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\si@num@fixsf} +% Setting up a fixed number of significant figures is rather more +% complicated than fixing the decimal places. There are a number of +% tests needed to see what needs to be done. +% \begin{macrocode} +\newcommand*{\si@num@fixsf}{% + \si@num@cntdigits{\si@num@predec}% + \ifx\@empty\si@num@predec\@empty + \si@tempcnta\z@\relax + \fi +% \end{macrocode} +% If the pre-decimal component has only a single digit, it could be +% ``0'': if so, only the significant figures in the decimal part are +% counted. +% \begin{macrocode} + \ifnum\si@tempcnta=\@ne\relax + \renewcommand*{\si@tempa}{0}% + \ifx\si@num@predec\si@tempa +% \end{macrocode} +% The number of significant digits after the decimal point have to be +% counted up. If there are enough digits there, then some rounding +% will again be needed. +% \begin{macrocode} + \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 +% \end{macrocode} +% If there are too many digits in the pre-decimal part, a check is +% first made to see if there may be a need to round from the first +% post-decimal digit. If not, the post decimal part is thrown away. +% \begin{macrocode} + \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} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\si@num@cntpostsf} +% Counting up significant figures in the post-decimal part needs an +% auxiliary macro. +% \begin{macrocode} +\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} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\si@num@cntprepost} +% There are two routes to find that the number of digits in both +% parts of the number are important. In either case, rounding is +% only needed if the two parts have too many digits. +% \begin{macrocode} +\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} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\si@num@sfpre} +% The code here is very similar to that used to round to a fixed +% number of decimal places. +% \begin{macrocode} +\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} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\si@num@int} %\darg{integer-part} % The formatting code for separating thousands is taken more-or-less @@ -8052,15 +8369,19 @@ author. %\end{macro} %\end{macro} %\begin{macro}{\si@tab@numout} +%\changes{v1.1}{2008/09/03}{Extended for non-aligned output} % If a number is found, then some secondary processing is needed to % format it correctly. % \begin{macrocode} \newcommand*{\si@tab@numout}{% \si@num@intabtrue - \ifsi@tab@fixed - \ifsi@tabautofit - \si@num@dp\si@tab@mantpostcnt\relax - \expandafter\expandafter\expandafter\si@fixdptrue + \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}% @@ -8086,16 +8407,21 @@ author. %\end{macro} %\end{macro} %\begin{macro}{\si@tab@format} +%\changes{v1.1}{2008/09/03}{Extended for non-aligned output} % The formatting set up is taken from \pkg{dcolumn}, but with % control of the output form the stored information. The choice % of a variable (decimal-centred) column or fixed width boxes is % made. % \begin{macrocode} \newcommand*{\si@tab@format}{% - \ifsi@tab@fixed - \expandafter\si@tab@fixed + \ifsi@tabparseonly + \expandafter\si@tab@outonly \else - \expandafter\si@tab@unfixed + \ifsi@tab@fixed + \expandafter\expandafter\expandafter\si@tab@fixed + \else + \expandafter\expandafter\expandafter\si@tab@unfixed + \fi \fi % \end{macrocode} % A hack to get the correct colour everywhere without too much work. @@ -8103,10 +8429,30 @@ author. \ifsi@colourvalues \si@fam@colourcmd{\si@valuecolour}% \fi - \box\si@tab@prebox\box\si@tab@midbox\box\si@tab@postbox% + \box\si@tab@prebox\box\si@tab@midbox\box\si@tab@postbox \box\si@tab@expbox} % \end{macrocode} %\end{macro} +%\begin{macro}{\si@tab@outonly} +% The non-alignment option means that no real processing is done: only font +% control is required. +% \begin{macrocode} +\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}} +% \end{macrocode} +%\end{macro} %\begin{macro}{\si@tab@unfixed} %\changes{v1.0l}{2008/09/03}{Fixed issue with decimal sign and % integers} @@ -8116,7 +8462,7 @@ author. % in boxes. The wider one is then used to set up the column width, % by resizing the other one. % \begin{macrocode} -\newcommand*\si@tab@unfixed{% +\newcommand*{\si@tab@unfixed}{% \si@log@debug{Using variable width S column}% \ifx\@empty\si@num@out\@empty \setbox\si@tab@midbox=\hbox @@ -8246,8 +8592,7 @@ author. \setbox\si@tab@prebox=\hbox to\si@tab@predim{\hss\hfill \expandafter\si@out@num\expandafter{\si@tab@out}}% \ifx\@empty\si@num@out\@empty - \setbox\si@tab@postbox=\hbox to\si@tab@postdim - {\expandafter\si@out@num\expandafter{\si@num@out}\hfil}% + \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}% @@ -8419,6 +8764,33 @@ author. %\end{macro} %\end{macro} %\end{macro} +%\begin{macro}{\newqualifier} +%\changes{v1.1}{2008/09/04}{New user macro} +%\begin{macro}{\renewqualifier} +%\changes{v1.1}{2008/09/04}{New user macro} +%\begin{macro}{\providequalifier} +%\changes{v1.1}{2008/09/04}{New user macro} +%\darg{qualifier} +%\darg{symbol} +% Creating unit qualifiers is much the same method. +% \begin{macrocode} +\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}} + {}} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} %\begin{macro}{\ifsi@unt@num} % A flag is needed to tell the processor whether there is a number, % to get the correct spacing. @@ -8647,8 +9019,8 @@ author. \renewcommand*{\si@unt@spstack}{}% \renewcommand*{\si@unt@stacka}{}% \renewcommand*{\si@unt@stackb}{}% - \renewcommand*{\si@unt@holdstacka}{}% - \renewcommand*{\si@unt@holdstackb}{}% + \renewcommand*{\si@unt@spacestacka}{}% + \renewcommand*{\si@unt@spacestackb}{}% \renewcommand*{\si@unt@lastadda}{space}% \renewcommand*{\si@unt@lastaddb}{space}} % \end{macrocode} @@ -8821,6 +9193,28 @@ author. {#2}{#3}}} % \end{macrocode} %\end{macro} +%\begin{macro}{\si@unt@defqual} +%\darg{qualifier} +%\darg{symbol} +% Qualifiers are defined in a similar manner. +% \begin{macrocode} +\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}}} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\si@unt@unithook} %\begin{macro}{\si@unt@unit} %\darg{number} @@ -9107,6 +9501,7 @@ author. %\begin{macro}{\si@unt@stackpower} %\begin{macro}{\si@unt@stkpower} %\begin{macro}{\si@unt@stkpwr} +%\begin{macro}{\si@unt@skpwr} % Adding powers to the stack should also clear the power list. If % the number is already zero, then of course nothing happens. % \begin{macrocode} @@ -9133,6 +9528,7 @@ author. \expandafter\si@unt@stkpwr \fi} % \end{macrocode} +%\changes{v1.1}{2008/09/04}{Altered to account for qualifiers} % Finally, the actual adding (set up to avoid problems with the % \cs{if} above). % \begin{macrocode} @@ -9142,17 +9538,27 @@ author. \expandafter\ifx \csname si@unt@lastadd\si@unt@checkstack\endcsname \si@tempa - \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}}}% + \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}}}} % \end{macrocode} %\end{macro} %\end{macro} %\end{macro} +%\end{macro} %\begin{macro}{\si@unt@invpower} % A macro to change the sign of the current power. % \begin{macrocode} @@ -9168,6 +9574,45 @@ author. \fi} % \end{macrocode} %\end{macro} +%\begin{macro}{\si@unt@litqual} +% \begin{macrocode} +\newcommand*{\si@unt@litqual}[1]{(#1)} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\si@unt@qual} +% \begin{macrocode} +\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 +% \end{macrocode} +% The space after the current unit is shuffled so it will come +% after the qualifier. +% \begin{macrocode} + \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 +% \end{macrocode} +%\begin{macro}{\si@unt@skpwrqual} +% Some protection against trying to add two powers. +% \begin{macrocode} + \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} +% \end{macrocode} +%\end{macro} +%\end{macro} %\begin{macro}{\ifsi@unt@per} %\begin{macro}{\ifsi@unt@perseen} %\begin{macro}{\per} @@ -9317,15 +9762,18 @@ author. \@ne\relax} % \end{macrocode} %\end{macro} -%\begin{macro}{\si@unt@holdstacka} -%\begin{macro}{\si@unt@holdstackb} +%\begin{macro}{\si@unt@spacestack} +%\begin{macro}{\si@unt@spacestacka} +%\begin{macro}{\si@unt@spacestackb} % The stacked material needs somewhere to live. % \begin{macrocode} -\newcommand*{\si@unt@holdstacka}{} -\newcommand*{\si@unt@holdstackb}{} +\newcommand*{\si@unt@spacestack}{} +\newcommand*{\si@unt@spacestacka}{} +\newcommand*{\si@unt@spacestackb}{} % \end{macrocode} %\end{macro} %\end{macro} +%\end{macro} %\begin{macro}{\si@unt@holdspace} %\begin{macro}{\si@unt@addstack} %\darg{token} @@ -9339,20 +9787,18 @@ author. \ifx\si@tempa\si@tempb \ifx\@empty\si@unt@stackb\@empty \else - \expandafter\protected@edef - \csname si@unt@holdstack\si@unt@checkstack\endcsname{#1}% + \protected@edef\si@unt@spacestackb{#1}% \fi \else - \expandafter\protected@edef - \csname si@unt@holdstack\si@unt@checkstack\endcsname{#1}% + \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@holdstack\si@unt@checkstack\endcsname#1}% + \csname si@unt@spacestack\si@unt@checkstack\endcsname#1}% \expandafter\renewcommand\expandafter*\expandafter{% - \csname si@unt@holdstack\si@unt@checkstack\endcsname}{}} + \csname si@unt@spacestack\si@unt@checkstack\endcsname}{}} % \end{macrocode} %\end{macro} %\end{macro} @@ -9769,6 +10215,7 @@ author. % %\subsection{Output routine} %\begin{macro}{\si@out} +%\changes{v1.1}{2008/07/22}{Extended handling to subscripts} %\darg{text} % With all of the setup done, the text can finally be typeset. This % is done inside a \cs{text} block, which takes care of @@ -9780,13 +10227,15 @@ author. \begingroup \catcode`\^=\active \catcode`\-=\active + \catcode`\_=\active \gdef\si@out#1{% \begingroup \catcode`\^=\active + \catcode`\_=\active \makeatletter \endlinechar\m@ne % \end{macrocode} -%\changes{1.0f}{2008/07/17}{Fixed bug with colour and spacing} +%\changes{v1.0f}{2008/07/17}{Fixed bug with colour and spacing} % The various font families can now be set up. First a check is made % in case there are nested calls to \cs{si@out@text}. % \begin{macrocode} @@ -9817,28 +10266,36 @@ author. % \begin{macrocode} \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 % \end{macrocode} %\end{macro} %\end{macro} %\begin{macro}{\si@out@sp} +%\begin{macro}{\si@out@sb} %\darg{text} % \cs{textsuperscript} gives slightly different alignment of numbers % to using |^| in text mode. To avoid this, a slightly different -% definition is used. Elsewhere \cs{textsuperscript} is used, as -% the code above sorts out the text/maths mode issues. +% definition is used. Elsewhere \cs{textsuperscript} is used, as the +% code above sorts out the text/maths mode issues. The same is done +% for subscripts. % \begin{macrocode} \newcommand*{\si@out@sp}[1]{\ensuremath{^{\text{#1}}}} +\newcommand*{\si@out@sb}[1]{\ensuremath{_{\text{#1}}}} % \end{macrocode} %\end{macro} +%\end{macro} %\begin{macro}{\si@out@minus} % An active minus sign is needed. % \begin{macrocode} @@ -10042,9 +10499,10 @@ author. negcolour=red, noload={}, numaddn={},%( - numcloseerr=),% + numcloseerr=), numdecimal={.,}, numdigits=0123456789, + numdiv=/, numexp=eEdD, numgobble={}, numopenerr=(,%) @@ -10075,6 +10533,7 @@ author. tabautofit=false, tabformat=3.2, tabnumalign=centredecimal, + tabparseonly=false, tabtextalign=centre, tabunitalign=left, textrm=rmfamily, @@ -10177,7 +10636,7 @@ author. % powers. % \begin{macrocode} \ProvidesFile{si-prefix.cfg} - [2008/09/03 v1.0l siunitx: SI Multiple prefixes] + [2008/09/28 v1.1 siunitx: SI Multiple prefixes] \newprefix{\yocto}{-24}{y} \newprefix{\zepto}{-21}{z} \newprefix{\atto}{-18}{a} @@ -10281,7 +10740,7 @@ author. % is an awkward one, but here the UK standard is used. % \begin{macrocode} \ProvidesFile{si-named.cfg} - [2008/09/03 v1.0l siunitx: SI Named units] + [2008/09/28 v1.1 siunitx: SI Named units] \newunit{\becquerel}{Bq} \newunit{\coulomb}{C} \newunit{\farad}{F} @@ -10377,7 +10836,7 @@ author. % This requires \file{si-prefix.cfg} and \file{si-named.cfg}. % \begin{macrocode} \ProvidesFile{si-prefixed.cfg} - [2008/09/03 v1.0l siunitx: SI Prefixed units] + [2008/09/28 v1.1 siunitx: SI Prefixed units] \requiresiconfigs{prefix,named,accepted,physical} % \end{macrocode} %\begin{macro}{\picometre} @@ -10663,7 +11122,7 @@ author. % block for the appropriate option. First currents. % \begin{macrocode} \ProvidesFile{si-abbr.cfg} - [2008/09/03 v1.0l siunitx: Abbreviated units] + [2008/09/28 v1.1 siunitx: Abbreviated units] \requiresiconfigs{prefix,named,accepted,physical} \newunit{\pA}{\pico\ampere} \newunit{\nA}{\nano\ampere} @@ -10875,7 +11334,7 @@ author. % These are defined here, although some are in very general use. % \begin{macrocode} \ProvidesFile{si-addn.cfg} - [2008/09/03 v1.0l siunitx: SI Additional units] + [2008/09/28 v1.1 siunitx: SI Additional units] \newunit{\angstrom}{\si@sym@ringA} \newunit{\are}{a} \newunit{\hectare}{\hecto\are} @@ -10924,7 +11383,7 @@ author. %\begin{macro}{\percent} % \begin{macrocode} \ProvidesFile{si-accepted.cfg} - [2008/09/03 v1.0l siunitx: SI Accepted units] + [2008/09/28 v1.1 siunitx: SI Accepted units] \newunit{\minute}{min} \newunit{\hour}{h} \newunit{\Day}{d} @@ -10973,7 +11432,7 @@ author. % for a negative kern does make things a bit complicated. % \begin{macrocode} \ProvidesFile{si-physical.cfg} - [2008/09/03 v1.0l siunitx: SI Physically-measured units] + [2008/09/28 v1.1 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% @@ -11009,7 +11468,7 @@ author. % own definitions. % \begin{macrocode} \ProvidesFile{si-synchem.cfg} - [2008/09/03 v1.0l siunitx: Units for synthetic chemists] + [2008/09/28 v1.1 siunitx: Units for synthetic chemists] \requiresiconfigs{prefix} \newunit{\mmHg}{mmHg} \newunit{\molar}{\mole\per\cubic\deci\metre} @@ -11030,7 +11489,7 @@ author. % Some units inspired by \pkg{hepunits}. % \begin{macrocode} \ProvidesFile{si-hep.cfg} - [2008/09/03 v1.0l siunitx: Units for high-energy physics] + [2008/09/28 v1.1 siunitx: Units for high-energy physics] \requiresiconfigs{prefix,named} % \end{macrocode} %\begin{macro}{\micron} @@ -11112,7 +11571,7 @@ author. % For astronomy, the \cs{parsec} unit is needed. % \begin{macrocode} \ProvidesFile{si-astro.cfg} - [2008/09/03 v1.0l siunitx: Units for astronomy] + [2008/09/28 v1.1 siunitx: Units for astronomy] \newunit{\parsec}{pc} \newunit{\lightyear}{ly} % \end{macrocode} @@ -11135,7 +11594,7 @@ author. % \SIunits. First, the binary prefixes. % \begin{macrocode} \ProvidesFile{si-binary.cfg} - [2008/09/03 v1.0l siunitx: Binary units] + [2008/09/28 v1.1 siunitx: Binary units] \newprefix[binary]{\kibi}{10}{Ki} \newprefix[binary]{\mebi}{20}{Mi} \newprefix[binary]{\gibi}{30}{Gi} @@ -11178,7 +11637,7 @@ author. % default values.\footnote{The package author is in the UK.} % \begin{macrocode} \ProvidesFile{si-UK.cfg} - [2008/09/03 v1.0l siunitx: UK locale] + [2008/09/28 v1.1 siunitx: UK locale] \sisetup{ unitsep=thin, expproduct=times, @@ -11195,7 +11654,7 @@ author. % The same as for the UK. % \begin{macrocode} \ProvidesFile{si-USA.cfg} - [2008/09/03 v1.0l siunitx: USA locale] + [2008/09/28 v1.1 siunitx: USA locale] \sisetup{ unitsep=thin, expproduct=times, @@ -11212,7 +11671,7 @@ author. % Germany, hopefully. % \begin{macrocode} \ProvidesFile{si-DE.cfg} - [2008/09/03 v1.0l siunitx: Germany locale] + [2008/09/28 v1.1 siunitx: Germany locale] \sisetup{ unitsep=cdot, valuesep=thin, @@ -11229,7 +11688,7 @@ author. % Design decisions taken from the same section of \SIstyle. % \begin{macrocode} \ProvidesFile{si-ZA.cfg} - [2008/09/03 v1.0l siunitx: South Africa locale] + [2008/09/28 v1.1 siunitx: South Africa locale] \sisetup{ unitsep=cdot, valuesep=thin, @@ -11261,7 +11720,7 @@ author. % \units for conflicting options, so users probably expect none. % \begin{macrocode} \ProvidesFile{si-units.cfg} - [2008/09/03 v1.0l siunitx: Emulation of units] + [2008/09/28 v1.1 siunitx: Emulation of units] \si@emulating{units}{1998/08/04 v0.9b} \si@ifloaded{SIunits} {\si@emclash{units}{SIunits}\endinput}{} @@ -11331,7 +11790,8 @@ author. % clash. % \begin{macrocode} \ProvidesFile{si-unitsdef.cfg} - [2008/09/03 v1.0l siunitx: Emulation of unitsdef] + [2008/09/28 v1.1 siunitx: + Emulation of unitsdef] \si@emulating{unitsdef}{2005/01/04 v0.2} \si@ifloaded{SIunits} {\si@emclash{unitsdef}{SIunits}\endinput}{} @@ -11779,7 +12239,8 @@ author. % the macros in \SIstyle as given in the manual for that package. % \begin{macrocode} \ProvidesFile{si-sistyle.cfg} - [2008/09/03 v1.0l siunitx: Emulation of SIstyle] + [2008/09/28 v1.1 siunitx: Emulation of + SIstyle] \si@emulating{sistyle}{2006/12/20 v2.3} \sisetup{% sepfour=true, @@ -11962,7 +12423,8 @@ author. % \SIunits emulation starts in much the same way. % \begin{macrocode} \ProvidesFile{si-SIunits.cfg} - [2008/09/03 v1.0l siunitx: Emulation of SIunits] + [2008/09/28 v1.1 siunitx: Emulation of + SIunits] \si@emulating{SIunits}{2007/12/02 v1.36} \sisetup{ unitsep=thick, @@ -12523,7 +12985,8 @@ author. % which are not really to be encouraged. % \begin{macrocode} \ProvidesFile{si-hepunits.cfg} - [2008/09/03 v1.0l siunitx: Emulation of hepunits] + [2008/09/28 v1.1 siunitx: Emulation of + hepunits] \si@emulating{hepunits}{2007/09/27} \requiresiconfigs{SIunits,accepted,prefix,hep} % \end{macrocode} @@ -12677,7 +13140,8 @@ author. % a little emulation and a few macros needed. % \begin{macrocode} \ProvidesFile{si-fancynum.cfg} - [2008/09/03 v1.0l siunitx: Emulation of fancynum] + [2008/09/28 v1.1 siunitx: Emulation of + fancynum] \si@emulating{fancynum}{2000/08/08 0.92} \sisetup{decimalsymbol=cdot,digitsep=comma} % \end{macrocode} @@ -12738,7 +13202,8 @@ author. % test is needed. % \begin{macrocode} \ProvidesFile{si-fancyunits.cfg} - [2008/09/03 v1.0l siunitx: Emulation of fancyunits] + [2008/09/28 v1.1 siunitx: Emulation of + fancyunits] \si@emulating{fancyunits}{2007/02/01 v1.0.1} \si@ifloaded{SIunits} {\si@log@err{SIunits emulation loaded\MessageBreak before @@ -12950,14 +13415,6 @@ author. \restylefloat{table} \labelformat{figure}{\figurename~#1} \labelformat{table}{\tablename~#1} -\ifpdf - \usepackage{embedfile} - \embedfile[% - stringmethod=escape,% - mimetype=plain/text,% - desc={LaTeX docstrip source archive for package `\jobname'}% - ]{\jobname.dtx} -\fi \IfFileExists{\jobname.sty} {\usepackage{\jobname}}{} \usepackage[numbered]{hypdoc} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg index 46f0c886d01..61767cdce16 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-DE.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-DE.cfg} - [2008/09/03 v1.0l siunitx: Germany locale] + [2008/09/28 v1.1 siunitx: Germany locale] \sisetup{ unitsep=cdot, valuesep=thin, diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg index 3e3f452f090..3103921552f 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-SIunits.cfg @@ -14,7 +14,8 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-SIunits.cfg} - [2008/09/03 v1.0l siunitx: Emulation of SIunits] + [2008/09/28 v1.1 siunitx: Emulation of + SIunits] \si@emulating{SIunits}{2007/12/02 v1.36} \sisetup{ unitsep=thick, diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg index 738b61d8787..99d93b7e6d9 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-UK.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-UK.cfg} - [2008/09/03 v1.0l siunitx: UK locale] + [2008/09/28 v1.1 siunitx: UK locale] \sisetup{ unitsep=thin, expproduct=times, diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg index ec429c18443..622fb8ddccf 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-USA.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-USA.cfg} - [2008/09/03 v1.0l siunitx: USA locale] + [2008/09/28 v1.1 siunitx: USA locale] \sisetup{ unitsep=thin, expproduct=times, diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg index 6dc518eb08a..e0dba73265c 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-ZA.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-ZA.cfg} - [2008/09/03 v1.0l siunitx: South Africa locale] + [2008/09/28 v1.1 siunitx: South Africa locale] \sisetup{ unitsep=cdot, valuesep=thin, diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg index 4e18e3fc370..c93c7a7b75b 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-abbr.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-abbr.cfg} - [2008/09/03 v1.0l siunitx: Abbreviated units] + [2008/09/28 v1.1 siunitx: Abbreviated units] \requiresiconfigs{prefix,named,accepted,physical} \newunit{\pA}{\pico\ampere} \newunit{\nA}{\nano\ampere} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg index 4f050c7ebd9..2236969c914 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-accepted.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-accepted.cfg} - [2008/09/03 v1.0l siunitx: SI Accepted units] + [2008/09/28 v1.1 siunitx: SI Accepted units] \newunit{\minute}{min} \newunit{\hour}{h} \newunit{\Day}{d} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg index 52def9ca5ab..f6ef0e272a2 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-addn.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-addn.cfg} - [2008/09/03 v1.0l siunitx: SI Additional units] + [2008/09/28 v1.1 siunitx: SI Additional units] \newunit{\angstrom}{\si@sym@ringA} \newunit{\are}{a} \newunit{\hectare}{\hecto\are} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg index a39cce154c5..95a702c7e4a 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-astro.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-astro.cfg} - [2008/09/03 v1.0l siunitx: Units for astronomy] + [2008/09/28 v1.1 siunitx: Units for astronomy] \newunit{\parsec}{pc} \newunit{\lightyear}{ly} \endinput diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg index f90bae2cd62..0481dbd628d 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-binary.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-binary.cfg} - [2008/09/03 v1.0l siunitx: Binary units] + [2008/09/28 v1.1 siunitx: Binary units] \newprefix[binary]{\kibi}{10}{Ki} \newprefix[binary]{\mebi}{20}{Mi} \newprefix[binary]{\gibi}{30}{Gi} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg index 849a1c52043..9c34f5dc04c 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-fancynum.cfg @@ -14,7 +14,8 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-fancynum.cfg} - [2008/09/03 v1.0l siunitx: Emulation of fancynum] + [2008/09/28 v1.1 siunitx: Emulation of + fancynum] \si@emulating{fancynum}{2000/08/08 0.92} \sisetup{decimalsymbol=cdot,digitsep=comma} \let\fnum\num diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg index f73010149df..89212451f54 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-fancyunits.cfg @@ -14,7 +14,8 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-fancyunits.cfg} - [2008/09/03 v1.0l siunitx: Emulation of fancyunits] + [2008/09/28 v1.1 siunitx: Emulation of + fancyunits] \si@emulating{fancyunits}{2007/02/01 v1.0.1} \si@ifloaded{SIunits} {\si@log@err{SIunits emulation loaded\MessageBreak before diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg index 8825525b522..4a704aee51a 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-hep.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-hep.cfg} - [2008/09/03 v1.0l siunitx: Units for high-energy physics] + [2008/09/28 v1.1 siunitx: Units for high-energy physics] \requiresiconfigs{prefix,named} \provideunit{\micron}{\micro\metre} \newunit{\mrad}{\milli\rad} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg index 1e57ff7c5dd..e0bb32063f8 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-hepunits.cfg @@ -14,7 +14,8 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-hepunits.cfg} - [2008/09/03 v1.0l siunitx: Emulation of hepunits] + [2008/09/28 v1.1 siunitx: Emulation of + hepunits] \si@emulating{hepunits}{2007/09/27} \requiresiconfigs{SIunits,accepted,prefix,hep} \ifsi@old@noprefixcmds\else diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg index ad9af4617d5..748cf20d7db 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-named.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-named.cfg} - [2008/09/03 v1.0l siunitx: SI Named units] + [2008/09/28 v1.1 siunitx: SI Named units] \newunit{\becquerel}{Bq} \newunit{\coulomb}{C} \newunit{\farad}{F} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg index 3b6ab1f6018..4cb1f8cce0a 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-physical.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-physical.cfg} - [2008/09/03 v1.0l siunitx: SI Physically-measured units] + [2008/09/28 v1.1 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% diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg index 2969dd8c71e..0330987ccfc 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-prefix.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-prefix.cfg} - [2008/09/03 v1.0l siunitx: SI Multiple prefixes] + [2008/09/28 v1.1 siunitx: SI Multiple prefixes] \newprefix{\yocto}{-24}{y} \newprefix{\zepto}{-21}{z} \newprefix{\atto}{-18}{a} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg index 99593b2561e..32030fa1f2b 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-prefixed.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-prefixed.cfg} - [2008/09/03 v1.0l siunitx: SI Prefixed units] + [2008/09/28 v1.1 siunitx: SI Prefixed units] \requiresiconfigs{prefix,named,accepted,physical} \newunit{\picometre}{\pico\metre} \newunit{\nanometre}{\nano\metre} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg index 3f7977ed19e..18a516494a4 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-sistyle.cfg @@ -14,7 +14,8 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-sistyle.cfg} - [2008/09/03 v1.0l siunitx: Emulation of SIstyle] + [2008/09/28 v1.1 siunitx: Emulation of + SIstyle] \si@emulating{sistyle}{2006/12/20 v2.3} \sisetup{% sepfour=true, diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg index 97048463852..d1dff21c562 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-synchem.cfg @@ -14,7 +14,7 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-synchem.cfg} - [2008/09/03 v1.0l siunitx: Units for synthetic chemists] + [2008/09/28 v1.1 siunitx: Units for synthetic chemists] \requiresiconfigs{prefix} \newunit{\mmHg}{mmHg} \newunit{\molar}{\mole\per\cubic\deci\metre} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg index 799b0f99142..ce3c24034aa 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-units.cfg @@ -15,7 +15,7 @@ %% \si@ifloaded{units}{\endinput}{} \ProvidesFile{si-units.cfg} - [2008/09/03 v1.0l siunitx: Emulation of units] + [2008/09/28 v1.1 siunitx: Emulation of units] \si@emulating{units}{1998/08/04 v0.9b} \si@ifloaded{SIunits} {\si@emclash{units}{SIunits}\endinput}{} diff --git a/Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg b/Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg index c0a7bebdc86..322f7b5691e 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/si-unitsdef.cfg @@ -14,7 +14,8 @@ %% ---------------------------------------------------------------- %% \ProvidesFile{si-unitsdef.cfg} - [2008/09/03 v1.0l siunitx: Emulation of unitsdef] + [2008/09/28 v1.1 siunitx: + Emulation of unitsdef] \si@emulating{unitsdef}{2005/01/04 v0.2} \si@ifloaded{SIunits} {\si@emclash{unitsdef}{SIunits}\endinput}{} diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 3d5eb1260d7..b0d0bf5285b 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -15,7 +15,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{siunitx} - [2008/09/03 v1.0l A comprehensive (SI) units package] + [2008/09/28 v1.1 A comprehensive (SI) units package] \begingroup \@ifundefined{eTeXversion} {\PackageError{siunitx} @@ -30,6 +30,7 @@ \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 @@ -40,6 +41,7 @@ \catcode\string`\` 12\relax \catcode`\= 12\relax \catcode`\^ 7\relax +\catcode`\_ 8\relax \catcode`\~ \active\relax \@makeother{\:} \@makeother{\-} @@ -377,11 +379,11 @@ \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} + 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@numdecimal\si@numdigits\si@numextra\si@numprod\si@numdiv} \si@opt@boolkey{seperr} \si@opt@boolkey{trapambigerr} \si@opt@cmdkeys{openerr,closeerr} @@ -531,6 +533,7 @@ \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 @@ -639,15 +642,35 @@ \ifx\si@tempa\si@tempb \let\si@tab@lfill@s\relax \fi} -\si@opt@boolkey{fixdp} +\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@num@dp#1\relax - \si@fixdptrue} + {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 @@ -1240,6 +1263,7 @@ \def\,{}% \catcode`\~=\active\relax \catcode`\^=\active\relax + \catcode`\_=\active\relax \everyeof{\noexpand}% \endlinechar\m@ne \protected@xdef\si@tempa{\scantokens{#1}}% @@ -1700,8 +1724,10 @@ \expandafter\si@str@ifonlychrs\expandafter{\si@tempa} {0123456789} {\ifx\@empty\si@num@err\@empty - \ifsi@fixdp - \expandafter\expandafter\expandafter\si@num@fixdp + \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}{} @@ -1837,7 +1863,7 @@ \si@tempcntb\si@tempcnta\relax \si@num@lerr \protected@edef\si@num@err{% - \si@tempa\ensuremath{\si@decimalsymbol}\si@tempb}} + \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 @@ -1847,6 +1873,14 @@ \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 @@ -1865,10 +1899,14 @@ \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 @@ -1887,10 +1925,10 @@ \si@num@rev#2\@empty\@empty \fi} \newcommand*{\si@num@rnd}{% - \ifnum\si@tempcnta>\z@\relax - \expandafter\si@num@rndpost - \else + \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{% @@ -1924,12 +1962,12 @@ \advance\si@tempcntb\@ne\relax \fi \si@switchfalse - \advance\si@num@dp\@ne\relax - \ifnum\si@tempcnta>\si@num@dp\relax - \advance\si@num@dp\m@ne\relax + \advance\si@num@rndtarget\@ne\relax + \ifnum\si@tempcnta>\si@num@rndtarget\relax + \advance\si@num@rndtarget\m@ne\relax \else - \advance\si@num@dp\m@ne\relax - \ifnum\si@tempcnta>\si@num@dp\relax + \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 @@ -1942,7 +1980,120 @@ \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 @@ -2488,10 +2639,13 @@ \newcount\si@tempcntb \newcommand*{\si@tab@numout}{% \si@num@intabtrue - \ifsi@tab@fixed - \ifsi@tabautofit - \si@num@dp\si@tab@mantpostcnt\relax - \expandafter\expandafter\expandafter\si@fixdptrue + \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}% @@ -2501,17 +2655,35 @@ \newbox\si@tab@postbox \newbox\si@tab@expbox \newcommand*{\si@tab@format}{% - \ifsi@tab@fixed - \expandafter\si@tab@fixed + \ifsi@tabparseonly + \expandafter\si@tab@outonly \else - \expandafter\si@tab@unfixed + \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@prebox\box\si@tab@midbox\box\si@tab@postbox \box\si@tab@expbox} -\newcommand*\si@tab@unfixed{% +\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 @@ -2589,8 +2761,7 @@ \setbox\si@tab@prebox=\hbox to\si@tab@predim{\hss\hfill \expandafter\si@out@num\expandafter{\si@tab@out}}% \ifx\@empty\si@num@out\@empty - \setbox\si@tab@postbox=\hbox to\si@tab@postdim - {\expandafter\si@out@num\expandafter{\si@num@out}\hfil}% + \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}% @@ -2672,6 +2843,19 @@ \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}{} @@ -2792,8 +2976,8 @@ \renewcommand*{\si@unt@spstack}{}% \renewcommand*{\si@unt@stacka}{}% \renewcommand*{\si@unt@stackb}{}% - \renewcommand*{\si@unt@holdstacka}{}% - \renewcommand*{\si@unt@holdstackb}{}% + \renewcommand*{\si@unt@spacestacka}{}% + \renewcommand*{\si@unt@spacestackb}{}% \renewcommand*{\si@unt@lastadda}{space}% \renewcommand*{\si@unt@lastaddb}{space}} \newcommand*{\si@unt@final}{% @@ -2873,6 +3057,20 @@ \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 @@ -3034,19 +3232,50 @@ \expandafter\ifx \csname si@unt@lastadd\si@unt@checkstack\endcsname \si@tempa - \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}}}% + \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}{% @@ -3122,28 +3351,27 @@ \expandafter\advance \csname si@unt@unitcnt\si@unt@checkstack\endcsname \@ne\relax} -\newcommand*{\si@unt@holdstacka}{} -\newcommand*{\si@unt@holdstackb}{} +\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 - \expandafter\protected@edef - \csname si@unt@holdstack\si@unt@checkstack\endcsname{#1}% + \protected@edef\si@unt@spacestackb{#1}% \fi \else - \expandafter\protected@edef - \csname si@unt@holdstack\si@unt@checkstack\endcsname{#1}% + \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@holdstack\si@unt@checkstack\endcsname#1}% + \csname si@unt@spacestack\si@unt@checkstack\endcsname#1}% \expandafter\renewcommand\expandafter*\expandafter{% - \csname si@unt@holdstack\si@unt@checkstack\endcsname}{}} + \csname si@unt@spacestack\si@unt@checkstack\endcsname}{}} \newcommand*{\si@unt@stackout}{% \si@unt@litouttrue \ifsi@frac @@ -3375,9 +3603,11 @@ \begingroup \catcode`\^=\active \catcode`\-=\active + \catcode`\_=\active \gdef\si@out#1{% \begingroup \catcode`\^=\active + \catcode`\_=\active \makeatletter \endlinechar\m@ne \ifsi@fam@set\else @@ -3396,16 +3626,21 @@ \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}{\ensuremath{-}} \newif\ifsi@out@num \newcommand*{\si@out@num}[1]{% @@ -3510,9 +3745,10 @@ negcolour=red, noload={}, numaddn={},%( - numcloseerr=),% + numcloseerr=), numdecimal={.,}, numdigits=0123456789, + numdiv=/, numexp=eEdD, numgobble={}, numopenerr=(,%) @@ -3543,6 +3779,7 @@ tabautofit=false, tabformat=3.2, tabnumalign=centredecimal, + tabparseonly=false, tabtextalign=centre, tabunitalign=left, textrm=rmfamily, |