summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-07-26 22:43:34 +0000
committerKarl Berry <karl@freefriends.org>2012-07-26 22:43:34 +0000
commit6de23ba3ea913fe19bef0226096c339ec2c81e78 (patch)
tree8051b1be2affc6f88a3d4905c8bcdb8f03506d1d /Master/texmf-dist/source
parent28c1ee71d4aff12fb6ecc265a01679aea2ca776d (diff)
siunitx (22jul12)
git-svn-id: svn://tug.org/texlive/trunk@27181 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx9077
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.ins2
2 files changed, 4543 insertions, 4536 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index edb45e96427..782f91b2c46 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
@@ -41,7 +41,7 @@ typeset the documentation.
The package requires LaTeX3 support as provided in the l3kernel
and l3packages bundles. Both of these are available on CTAN
(http://www.ctan.org/) as ready-to-install zip files. Suitable
-versions are available in MiKTeX 2.9 and TeX Live 2011
+versions are available in MiKTeX 2.9 and TeX Live 2012
(updating the relevant packages online may be necessary).
LaTeX3, and so siunitx, requires the e-TeX extensions: these
are available on all modern TeX systems.
@@ -74,7 +74,7 @@ need the packages:
\fi
%</internal>
%<*install>
-\input docstrip.tex
+\input l3docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
@@ -589,6 +589,7 @@ This work consists of the file siunitx.dtx
% to use UTF-8 values is appropriate}
%\changes{v2.5e}{2012/06/13}{Fix an internal error in unit expansion,
% introduced in v2.4f}
+%\changes{v2.5f}{2012/07/16}{Track changes in \pkg{expl3}}
%
%\begin{abstract}
% Physical quantities have both numbers and units, and each physical
@@ -646,7 +647,7 @@ This work consists of the file siunitx.dtx
% \pkg{l3kernel} and \pkg{l3packages} bundles. Both of these are available
% on \href{http://www.ctan.org}{\textsc{ctan}} as ready-to-install
% zip files. Suitable versions are available in MiK\TeX{}~2.9 and
-% \TeX{}~Live 2011 (updating the relevant packages online may be
+% \TeX{}~Live 2012 (updating the relevant packages online may be
% necessary). \LaTeX3, and so \pkg{siunitx}, requires the \eTeX{}
% extensions: these are available on all modern \TeX{} systems.
%
@@ -2714,6 +2715,7 @@ This work consists of the file siunitx.dtx
%\end{center}
%
% \DescribeOption{binary-units}
+% \changes{v2.5g}{2012/07/22}{Fix \opt{binary-units} option}
% \DescribeMacro{\bit}
% \DescribeMacro{\byte}
% Binary data is expressed in units of bits and bytes. These are
@@ -5089,12 +5091,16 @@ This work consists of the file siunitx.dtx
% \begin{macrocode}
%<*package>
% \end{macrocode}
+%
+% \begin{macrocode}
+%<@@=siunitx>
+% \end{macrocode}
%
%\subsection{Preliminaries}
%
% The usual preliminaries.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2012/06/13} {2.5e}
+\ProvidesExplPackage {siunitx} {2012/07/22} {2.5g}
{A comprehensive (SI) units package}
% \end{macrocode}
%
@@ -5102,7 +5108,7 @@ This work consists of the file siunitx.dtx
% This will also trap any problems with \pkg{l3packages} (as the two are now
% tied together, version-wise).
% \begin{macrocode}
-\@ifpackagelater { expl3 } { 2011/09/05 }
+\@ifpackagelater { expl3 } { 2012/07/16 }
{ }
{
\PackageError { siunitx } { Support~package~expl3~too~old. }
@@ -5115,7 +5121,7 @@ This work consists of the file siunitx.dtx
}
% \end{macrocode}
%
-%\begin{macro}{\siunitx_load_check:}
+%\begin{macro}{\@@_load_check:}
% There are also a number of packages that are incompatible with
% \pkg{siunitx}. These are all checked for next. Some of the
% incompatible packages will not raise an error if loaded after
@@ -5126,7 +5132,7 @@ This work consists of the file siunitx.dtx
\msg_new:nnnn { siunitx } { incompatible-package }
{ Package~'#1'~incompatible. }
{ The~#1~package~and~siunitx~are~incompatible. }
-\cs_new_protected:Npn \siunitx_load_check:n #1 {
+\cs_new_protected:Npn \@@_load_check:n #1 {
\group_begin:
\@ifpackageloaded {#1}
{ \msg_error:nnx { siunitx } { incompatible-package } {#1} }
@@ -5135,10 +5141,10 @@ This work consists of the file siunitx.dtx
}
\clist_map_function:nN
{ SIunits , sistyle , siunits , SIstyle , unitsdef , fancyunits }
- \siunitx_load_check:n
+ \@@_load_check:n
\AtBeginDocument {
\clist_map_function:nN { SIunits , sistyle , siunits , SIstyle }
- \siunitx_load_check:n
+ \@@_load_check:n
}
% \end{macrocode}
%\end{macro}
@@ -5148,10 +5154,10 @@ This work consists of the file siunitx.dtx
\RequirePackage{ amstext , array , l3keys2e }
% \end{macrocode}
%
-%\begin{macro}{\siunitx_tmp:w}
+%\begin{macro}{\@@_tmp:w}
% A scratch function.
% \begin{macrocode}
-\cs_new:Npn \siunitx_tmp:w { }
+\cs_new:Npn \@@_tmp:w { }
% \end{macrocode}
%\end{macro}
%
@@ -5162,43 +5168,43 @@ This work consists of the file siunitx.dtx
% \end{macro}
%
%\begin{macro}{
-% \l_siunitx_tmp_bool ,
-% \l_siunitx_tmp_box ,
-% \l_siunitx_tmp_dim ,
-% \l_siunitx_tmp_int ,
-% \l_siunitx_tmpa_tl ,
-% \l_siunitx_tmpb_tl
+% \l_@@_tmp_bool ,
+% \l_@@_tmp_box ,
+% \l_@@_tmp_dim ,
+% \l_@@_tmp_int ,
+% \l_@@_tmpa_tl ,
+% \l_@@_tmpb_tl
%}
% Scratch variables.
% \begin{macrocode}
-\bool_new:N \l_siunitx_tmp_bool
-\box_new:N \l_siunitx_tmp_box
-\dim_new:N \l_siunitx_tmp_dim
-\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_@@_tmp_bool
+\box_new:N \l_@@_tmp_box
+\dim_new:N \l_@@_tmp_dim
+\int_new:N \l_@@_tmp_int
+\tl_new:N \l_@@_tmpa_tl
+\tl_new:N \l_@@_tmpb_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_error:nxx ,
-% \siunitx_error:nx ,
-% \siunitx_error:n
+% \@@_error:nxx ,
+% \@@_error:nx ,
+% \@@_error:n
%}
-%\begin{macro}{\l_siunitx_error_bool}
+%\begin{macro}{\l_@@_error_bool}
% General-purpose functions for throwing errors.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_error:nxx #1#2#3 {
- \bool_set_true:N \l_siunitx_error_bool
+\cs_new_protected:Npn \@@_error:nxx #1#2#3 {
+ \bool_set_true:N \l_@@_error_bool
\msg_error:nnxx { siunitx } {#1} {#2} {#3}
}
-\cs_new_protected:Npn \siunitx_error:nx #1#2 {
- \siunitx_error:nxx {#1} {#2} { }
+\cs_new_protected:Npn \@@_error:nx #1#2 {
+ \@@_error:nxx {#1} {#2} { }
}
-\cs_new_protected:Npn \siunitx_error:n #1 {
- \siunitx_error:nxx {#1} { } { }
+\cs_new_protected:Npn \@@_error:n #1 {
+ \@@_error:nxx {#1} { } { }
}
-\bool_new:N \l_siunitx_error_bool
+\bool_new:N \l_@@_error_bool
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -5217,21 +5223,21 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%
%\begin{macro}{
-% \c_siunitx_minus_tl ,
-% \c_siunitx_minus_int
+% \c_@@_minus_tl ,
+% \c_@@_minus_int
%}
% To allow the correct symbol to appear in text mode: this is the same
% as \cs{textminus} from \pkg{textcomp}. If \pkg{fontspec} is loaded
% then the real character can be used.
% \begin{macrocode}
-\DeclareTextSymbolDefault \c_siunitx_minus_tl { TS1 }
-\DeclareTextSymbol \c_siunitx_minus_tl { TS1 } { 61 }
+\DeclareTextSymbolDefault \c_@@_minus_tl { TS1 }
+\DeclareTextSymbol \c_@@_minus_tl { TS1 } { 61 }
\AtBeginDocument {
\@ifpackageloaded { fontspec }
{
- \int_const:Nn \c_siunitx_minus_int { 8722 }
- \tl_set:Nn \c_siunitx_minus_tl
- { \tex_char:D \c_siunitx_minus_int }
+ \int_const:Nn \c_@@_minus_int { 8722 }
+ \tl_set:Nn \c_@@_minus_tl
+ { \tex_char:D \c_@@_minus_int }
}
{ }
}
@@ -5239,215 +5245,215 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \c_siunitx_mu_tl ,
-% \c_siunitx_mu_int
+% \c_@@_mu_tl ,
+% \c_@@_mu_int
%}
% The lack of an upright mu has to be sorted out. The same consideration
% for \pkg{fontspec} as above.
% \begin{macrocode}
-\DeclareTextSymbol \c_siunitx_mu_tl { TS1 } { 181 }
-\DeclareTextSymbolDefault \c_siunitx_mu_tl { TS1 }
+\DeclareTextSymbol \c_@@_mu_tl { TS1 } { 181 }
+\DeclareTextSymbolDefault \c_@@_mu_tl { TS1 }
\AtBeginDocument {
\@ifpackageloaded { fontspec }
{
- \int_const:Nn \c_siunitx_mu_int { 181 }
- \tl_set:Nn \c_siunitx_mu_tl { \tex_char:D \c_siunitx_mu_int }
+ \int_const:Nn \c_@@_mu_int { 181 }
+ \tl_set:Nn \c_@@_mu_tl { \tex_char:D \c_@@_mu_int }
}
{ }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\c_siunitx_omega_tl}
+%\begin{macro}{\c_@@_omega_tl}
% Some package redefine \cs{Omega} to be slanted and move the original
% symbol to \cs{upOmega}. This is handled here.
% \begin{macrocode}
-\tl_new:N \c_siunitx_omega_tl
-\tl_set:Nn \c_siunitx_omega_tl { \Omega }
+\tl_new:N \c_@@_omega_tl
+\tl_set:Nn \c_@@_omega_tl { \Omega }
\AtBeginDocument {
\cs_if_exist:NT \upOmega
- { \tl_set:Nn \c_siunitx_omega_tl { \upOmega } }
+ { \tl_set:Nn \c_@@_omega_tl { \upOmega } }
}
% \end{macrocode}
%\end{macro}
%
% \begin{macro}
% {
-% \siunitx_tl_put_left_math:Nn ,
-% \siunitx_tl_put_left_math:NV ,
+% \@@_tl_put_left_math:Nn ,
+% \@@_tl_put_left_math:NV ,
% }
% To add stuff in math mode.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_tl_put_left_math:Nn #1#2
+\cs_new_protected:Npn \@@_tl_put_left_math:Nn #1#2
{ \tl_put_left:Nn #1 { \ensuremath {#2} } }
-\cs_generate_variant:Nn \siunitx_tl_put_left_math:Nn { NV }
+\cs_generate_variant:Nn \@@_tl_put_left_math:Nn { NV }
% \end{macrocode}
% \end{macro}
%
-%\begin{macro}{\c_siunitx_old_options_seq}
+%\begin{macro}{\c_@@_old_options_seq}
% To pick up old options, all of the names need to be known.
% \begin{macrocode}
-\seq_new:N \c_siunitx_old_options_seq
-\cs_set_protected:Npn \siunitx_tmp:w #1 {
- \seq_put_right:No \c_siunitx_old_options_seq { \tl_to_str:n {#1} }
-}
-\siunitx_tmp:w { addsign }
-\siunitx_tmp:w { allowlitunits }
-\siunitx_tmp:w { allowoptarg }
-\siunitx_tmp:w { allowzeroexp }
-\siunitx_tmp:w { alsoload }
-\siunitx_tmp:w { angformat }
-\siunitx_tmp:w { anglesep }
-\siunitx_tmp:w { astroang }
-\siunitx_tmp:w { closeerr }
-\siunitx_tmp:w { closrfrac }
-\siunitx_tmp:w { closerange }
-\siunitx_tmp:w { colour }
-\siunitx_tmp:w { colorall }
-\siunitx_tmp:w { colourall }
-\siunitx_tmp:w { colorneg }
-\siunitx_tmp:w { colourneg }
-\siunitx_tmp:w { colourunits }
-\siunitx_tmp:w { colourunits }
-\siunitx_tmp:w { colorvalues }
-\siunitx_tmp:w { colourvalues }
-\siunitx_tmp:w { decimalsymbol }
-\siunitx_tmp:w { debug }
-\siunitx_tmp:w { detectdisplay }
-\siunitx_tmp:w { digitsep }
-\siunitx_tmp:w { dp }
-\siunitx_tmp:w { emulate }
-\siunitx_tmp:w { errspace }
-\siunitx_tmp:w { eVcorra }
-\siunitx_tmp:w { eVcorrb }
-\siunitx_tmp:w { expbase }
-\siunitx_tmp:w { expproduct }
-\siunitx_tmp:w { fixdp }
-\siunitx_tmp:w { fixsf }
-\siunitx_tmp:w { fraction }
-\siunitx_tmp:w { inlinebold }
-\siunitx_tmp:w { loctolang }
-\siunitx_tmp:w { log }
-\siunitx_tmp:w { load }
-\siunitx_tmp:w { mathOmega }
-\siunitx_tmp:w { mathcelsius }
-\siunitx_tmp:w { mathdegree }
-\siunitx_tmp:w { mathminute }
-\siunitx_tmp:w { mathmu }
-\siunitx_tmp:w { mathringA }
-\siunitx_tmp:w { mathrm }
-\siunitx_tmp:w { mathsOmega }
-\siunitx_tmp:w { mathscelsius }
-\siunitx_tmp:w { mathsdegree }
-\siunitx_tmp:w { mathsecond }
-\siunitx_tmp:w { mathsf }
-\siunitx_tmp:w { mathsminute }
-\siunitx_tmp:w { mathsmu }
-\siunitx_tmp:w { mathsringA }
-\siunitx_tmp:w { mathsrm }
-\siunitx_tmp:w { mathssecond }
-\siunitx_tmp:w { mathssf }
-\siunitx_tmp:w { mathstt }
-\siunitx_tmp:w { mathtt }
-\siunitx_tmp:w { negcolor }
-\siunitx_tmp:w { negcolour }
-\siunitx_tmp:w { noload }
-\siunitx_tmp:w { numaddn }
-\siunitx_tmp:w { numcloseerr }
-\siunitx_tmp:w { numdecimal }
-\siunitx_tmp:w { numdigits }
-\siunitx_tmp:w { numdiv }
-\siunitx_tmp:w { numexp }
-\siunitx_tmp:w { numgobble }
-\siunitx_tmp:w { numopenerr }
-\siunitx_tmp:w { numprod }
-\siunitx_tmp:w { numsign }
-\siunitx_tmp:w { obeyall }
-\siunitx_tmp:w { obeybold }
-\siunitx_tmp:w { obeyfamily }
-\siunitx_tmp:w { obeymode }
-\siunitx_tmp:w { obeyitalic }
-\siunitx_tmp:w { openerr }
-\siunitx_tmp:w { openfrac }
-\siunitx_tmp:w { openrange }
-\siunitx_tmp:w { padangle }
-\siunitx_tmp:w { padnumber }
-\siunitx_tmp:w { per }
-\siunitx_tmp:w { prefixbase }
-\siunitx_tmp:w { prefixproduct }
-\siunitx_tmp:w { prefixsymbolic }
-\siunitx_tmp:w { prespace }
-\siunitx_tmp:w { redefsymbols }
-\siunitx_tmp:w { repeatunits }
-\siunitx_tmp:w { retainplus }
-\siunitx_tmp:w { seperr }
-\siunitx_tmp:w { sepfour }
-\siunitx_tmp:w { sf }
-\siunitx_tmp:w { sign }
-\siunitx_tmp:w { slash }
-\siunitx_tmp:w { stickyper }
-\siunitx_tmp:w { strictarc }
-\siunitx_tmp:w { tabalign }
-\siunitx_tmp:w { tabalignexp }
-\siunitx_tmp:w { tabautofit }
-\siunitx_tmp:w { tabexpalign }
-\siunitx_tmp:w { tabformat }
-\siunitx_tmp:w { tabnumalign }
-\siunitx_tmp:w { tabparseonly }
-\siunitx_tmp:w { tabtextalign }
-\siunitx_tmp:w { textOmega }
-\siunitx_tmp:w { textcelsius }
-\siunitx_tmp:w { textdegree }
-\siunitx_tmp:w { textminute }
-\siunitx_tmp:w { textmode }
-\siunitx_tmp:w { textmu }
-\siunitx_tmp:w { textringA }
-\siunitx_tmp:w { textrm }
-\siunitx_tmp:w { textsecond }
-\siunitx_tmp:w { textsf }
-\siunitx_tmp:w { texttt }
-\siunitx_tmp:w { tightpm }
-\siunitx_tmp:w { tophrase }
-\siunitx_tmp:w { trapamigerr }
-\siunitx_tmp:w { trapambigfrac }
-\siunitx_tmp:w { trapambigrange }
-\siunitx_tmp:w { unitcolor }
-\siunitx_tmp:w { unitcolour }
-\siunitx_tmp:w { unitmathrm }
-\siunitx_tmp:w { unitmathsf }
-\siunitx_tmp:w { unitmathsrm }
-\siunitx_tmp:w { unitmathssf }
-\siunitx_tmp:w { unitmathstt }
-\siunitx_tmp:w { unitmathtt }
-\siunitx_tmp:w { unitmode }
-\siunitx_tmp:w { unitsep }
-\siunitx_tmp:w { unitspace }
-\siunitx_tmp:w { valuecolor }
-\siunitx_tmp:w { valuecolour }
-\siunitx_tmp:w { valuemathrm }
-\siunitx_tmp:w { valuemathsf }
-\siunitx_tmp:w { valuemathsrm }
-\siunitx_tmp:w { valuemathssf }
-\siunitx_tmp:w { valuemathstt }
-\siunitx_tmp:w { valuemathtt }
-\siunitx_tmp:w { valuemode }
-\siunitx_tmp:w { valuesep }
-\siunitx_tmp:w { xpace }
-% \end{macrocode}
-%\end{macro}
-%
-%\begin{macro}{\l_siunitx_key_tl}
+\seq_new:N \c_@@_old_options_seq
+\cs_set_protected:Npn \@@_tmp:w #1 {
+ \seq_put_right:No \c_@@_old_options_seq { \tl_to_str:n {#1} }
+}
+\@@_tmp:w { addsign }
+\@@_tmp:w { allowlitunits }
+\@@_tmp:w { allowoptarg }
+\@@_tmp:w { allowzeroexp }
+\@@_tmp:w { alsoload }
+\@@_tmp:w { angformat }
+\@@_tmp:w { anglesep }
+\@@_tmp:w { astroang }
+\@@_tmp:w { closeerr }
+\@@_tmp:w { closrfrac }
+\@@_tmp:w { closerange }
+\@@_tmp:w { colour }
+\@@_tmp:w { colorall }
+\@@_tmp:w { colourall }
+\@@_tmp:w { colorneg }
+\@@_tmp:w { colourneg }
+\@@_tmp:w { colourunits }
+\@@_tmp:w { colourunits }
+\@@_tmp:w { colorvalues }
+\@@_tmp:w { colourvalues }
+\@@_tmp:w { decimalsymbol }
+\@@_tmp:w { debug }
+\@@_tmp:w { detectdisplay }
+\@@_tmp:w { digitsep }
+\@@_tmp:w { dp }
+\@@_tmp:w { emulate }
+\@@_tmp:w { errspace }
+\@@_tmp:w { eVcorra }
+\@@_tmp:w { eVcorrb }
+\@@_tmp:w { expbase }
+\@@_tmp:w { expproduct }
+\@@_tmp:w { fixdp }
+\@@_tmp:w { fixsf }
+\@@_tmp:w { fraction }
+\@@_tmp:w { inlinebold }
+\@@_tmp:w { loctolang }
+\@@_tmp:w { log }
+\@@_tmp:w { load }
+\@@_tmp:w { mathOmega }
+\@@_tmp:w { mathcelsius }
+\@@_tmp:w { mathdegree }
+\@@_tmp:w { mathminute }
+\@@_tmp:w { mathmu }
+\@@_tmp:w { mathringA }
+\@@_tmp:w { mathrm }
+\@@_tmp:w { mathsOmega }
+\@@_tmp:w { mathscelsius }
+\@@_tmp:w { mathsdegree }
+\@@_tmp:w { mathsecond }
+\@@_tmp:w { mathsf }
+\@@_tmp:w { mathsminute }
+\@@_tmp:w { mathsmu }
+\@@_tmp:w { mathsringA }
+\@@_tmp:w { mathsrm }
+\@@_tmp:w { mathssecond }
+\@@_tmp:w { mathssf }
+\@@_tmp:w { mathstt }
+\@@_tmp:w { mathtt }
+\@@_tmp:w { negcolor }
+\@@_tmp:w { negcolour }
+\@@_tmp:w { noload }
+\@@_tmp:w { numaddn }
+\@@_tmp:w { numcloseerr }
+\@@_tmp:w { numdecimal }
+\@@_tmp:w { numdigits }
+\@@_tmp:w { numdiv }
+\@@_tmp:w { numexp }
+\@@_tmp:w { numgobble }
+\@@_tmp:w { numopenerr }
+\@@_tmp:w { numprod }
+\@@_tmp:w { numsign }
+\@@_tmp:w { obeyall }
+\@@_tmp:w { obeybold }
+\@@_tmp:w { obeyfamily }
+\@@_tmp:w { obeymode }
+\@@_tmp:w { obeyitalic }
+\@@_tmp:w { openerr }
+\@@_tmp:w { openfrac }
+\@@_tmp:w { openrange }
+\@@_tmp:w { padangle }
+\@@_tmp:w { padnumber }
+\@@_tmp:w { per }
+\@@_tmp:w { prefixbase }
+\@@_tmp:w { prefixproduct }
+\@@_tmp:w { prefixsymbolic }
+\@@_tmp:w { prespace }
+\@@_tmp:w { redefsymbols }
+\@@_tmp:w { repeatunits }
+\@@_tmp:w { retainplus }
+\@@_tmp:w { seperr }
+\@@_tmp:w { sepfour }
+\@@_tmp:w { sf }
+\@@_tmp:w { sign }
+\@@_tmp:w { slash }
+\@@_tmp:w { stickyper }
+\@@_tmp:w { strictarc }
+\@@_tmp:w { tabalign }
+\@@_tmp:w { tabalignexp }
+\@@_tmp:w { tabautofit }
+\@@_tmp:w { tabexpalign }
+\@@_tmp:w { tabformat }
+\@@_tmp:w { tabnumalign }
+\@@_tmp:w { tabparseonly }
+\@@_tmp:w { tabtextalign }
+\@@_tmp:w { textOmega }
+\@@_tmp:w { textcelsius }
+\@@_tmp:w { textdegree }
+\@@_tmp:w { textminute }
+\@@_tmp:w { textmode }
+\@@_tmp:w { textmu }
+\@@_tmp:w { textringA }
+\@@_tmp:w { textrm }
+\@@_tmp:w { textsecond }
+\@@_tmp:w { textsf }
+\@@_tmp:w { texttt }
+\@@_tmp:w { tightpm }
+\@@_tmp:w { tophrase }
+\@@_tmp:w { trapamigerr }
+\@@_tmp:w { trapambigfrac }
+\@@_tmp:w { trapambigrange }
+\@@_tmp:w { unitcolor }
+\@@_tmp:w { unitcolour }
+\@@_tmp:w { unitmathrm }
+\@@_tmp:w { unitmathsf }
+\@@_tmp:w { unitmathsrm }
+\@@_tmp:w { unitmathssf }
+\@@_tmp:w { unitmathstt }
+\@@_tmp:w { unitmathtt }
+\@@_tmp:w { unitmode }
+\@@_tmp:w { unitsep }
+\@@_tmp:w { unitspace }
+\@@_tmp:w { valuecolor }
+\@@_tmp:w { valuecolour }
+\@@_tmp:w { valuemathrm }
+\@@_tmp:w { valuemathsf }
+\@@_tmp:w { valuemathsrm }
+\@@_tmp:w { valuemathssf }
+\@@_tmp:w { valuemathstt }
+\@@_tmp:w { valuemathtt }
+\@@_tmp:w { valuemode }
+\@@_tmp:w { valuesep }
+\@@_tmp:w { xpace }
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\l_@@_key_tl}
% Unknown options should raise an \pkg{siunitx}-specific error message.
% \begin{macrocode}
-\tl_new:N \l_siunitx_key_tl
+\tl_new:N \l_@@_key_tl
\keys_define:nn { siunitx } {
unknown .code:n =
{
- \seq_if_in:NVTF \c_siunitx_old_options_seq \l_keys_key_tl
+ \seq_if_in:NVTF \c_@@_old_options_seq \l_keys_key_tl
{
\msg_warning:nnx { siunitx } { version-1-option }
{ \exp_not:V \l_keys_key_tl }
- \tl_set:Nx \l_siunitx_key_tl
+ \tl_set:Nx \l_@@_key_tl
{
\keys_set:nn { siunitx }
{
@@ -5456,7 +5462,7 @@ This work consists of the file siunitx.dtx
}
}
\keys_set:nn { siunitx } { version-1-compatibility }
- \tl_use:N \l_siunitx_key_tl
+ \tl_use:N \l_@@_key_tl
}
{
\msg_error:nnx { siunitx } { unknown-option }
@@ -5468,7 +5474,7 @@ This work consists of the file siunitx.dtx
\keys_define:nn { siunitx } {
unknown .code:n =
{
- \seq_if_in:NVTF \c_siunitx_old_options_seq \l_keys_key_tl
+ \seq_if_in:NVTF \c_@@_old_options_seq \l_keys_key_tl
{
\msg_error:nnx { siunitx } { version-1-option }
{ \exp_not:V \l_keys_key_tl }
@@ -5483,15 +5489,15 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_option_deactivate:n}
-%\begin{macro}[aux]{\siunitx_option_deactivate_aux:n}
-%\begin{macro}{\l_siunitx_option_deactivate_clist}
+%\begin{macro}{\@@_option_deactivate:n}
+%\begin{macro}[aux]{\@@_option_deactivate_aux:n}
+%\begin{macro}{\l_@@_option_deactivate_clist}
% Some options need to be deactivated at the start of the document.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_option_deactivate:n #1 {
- \clist_put_right:Nn \l_siunitx_option_deactivate_clist {#1}
+\cs_new_protected:Npn \@@_option_deactivate:n #1 {
+ \clist_put_right:Nn \l_@@_option_deactivate_clist {#1}
}
-\cs_new_protected:Npn \siunitx_option_deactivate_aux:n #1 {
+\cs_new_protected:Npn \@@_option_deactivate_aux:n #1 {
\keys_define:nn { siunitx }
{
#1 .code:n =
@@ -5499,21 +5505,21 @@ This work consists of the file siunitx.dtx
}
}
\AtBeginDocument {
- \clist_map_function:NN \l_siunitx_option_deactivate_clist
- \siunitx_option_deactivate_aux:n
+ \clist_map_function:NN \l_@@_option_deactivate_clist
+ \@@_option_deactivate_aux:n
}
-\clist_new:N \l_siunitx_option_deactivate_clist
+\clist_new:N \l_@@_option_deactivate_clist
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
-% \begin{macro}{\siunitx_option_unchanged:Nnn}
+% \begin{macro}{\@@_option_unchanged:Nnn}
% Needed to allow for altering of options at the start of the document
% only if they are unchanged. This needs to use the low-level implementation
% detail, hence the use of variable name directly.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_option_unchanged:Nnn #1#2#3
+\cs_new_protected:Npn \@@_option_unchanged:Nnn #1#2#3
{
\str_if_eq:VnT #1 {#2}
{ \tl_set:Nn #1 {#3} }
@@ -5530,10 +5536,10 @@ This work consists of the file siunitx.dtx
% \end{macro}
%
%\begin{macro}[pTF]{
-% \siunitx_cs_if_tl:N ,
-% \siunitx_cs_if_macro:N
+% \@@_cs_if_tl:N ,
+% \@@_cs_if_macro:N
%}
-%\begin{macro}[aux]{\siunitx_cs_if_tl_aux:w}
+%\begin{macro}[aux]{\@@_cs_if_tl_aux:w}
% This is basically a re-hash of stuff from \pkg{expl3}, but to test for
% short macros only. The second test (with the \cs{cs_to_str:N} part)
% is checking for \LaTeXe{} robust commands.
@@ -5545,9 +5551,9 @@ This work consists of the file siunitx.dtx
{ \char_set_lccode:nn { `#1 } { `#1 } }
\tl_to_lowercase:n {
\group_end:
- \prg_new_conditional:Npnn \siunitx_cs_if_tl:N #1 { T , F, TF , p }
+ \prg_new_conditional:Npnn \@@_cs_if_tl:N #1 { T , F, TF , p }
{
- \exp_last_unbraced:No \siunitx_cs_if_tl_aux:w
+ \exp_last_unbraced:No \@@_cs_if_tl_aux:w
{ \token_to_meaning:N #1 MACRO \q_stop }
{
\cs_if_exist:cTF { \cs_to_str:N #1 ~ }
@@ -5556,12 +5562,12 @@ This work consists of the file siunitx.dtx
}
{ \prg_return_false: }
}
- \cs_new:Npn \siunitx_cs_if_tl_aux:w #1 MACRO #2 \q_stop
+ \cs_new:Npn \@@_cs_if_tl_aux:w #1 MACRO #2 \q_stop
{ \tl_if_empty:nTF {#1} }
- \prg_new_conditional:Npnn \siunitx_cs_if_macro:N #1
+ \prg_new_conditional:Npnn \@@_cs_if_macro:N #1
{ T , F , TF , p }
{
- \exp_last_unbraced:No \siunitx_cs_if_tl_aux:w
+ \exp_last_unbraced:No \@@_cs_if_tl_aux:w
{ \token_to_meaning:N #1 MACRO \q_stop }
{ \prg_return_true: }
{ \prg_return_false: }
@@ -5578,8 +5584,8 @@ This work consists of the file siunitx.dtx
{
\@ifpackageloaded { tex4ht }
{
- \cs_set_eq:NN \siunitx_print_text_super:n \textsuperscript
- \siunitx_option_unchanged:Nnn \l_siunitx_qualifier_mode_tl
+ \cs_set_eq:NN \@@_print_text_super:n \textsuperscript
+ \@@_option_unchanged:Nnn \l_@@_qualifier_mode_tl
{ subscript } { brackets }
\keys_set:nn { siunitx } { mode = text }
}
@@ -5587,24 +5593,24 @@ This work consists of the file siunitx.dtx
}
% \end{macrocode}
%
-% \begin{macro}{\siunitx_textsuperscript:n}
+% \begin{macro}{\@@_textsuperscript:n}
% This function is set up here so that it can be redefined
% elsewhere as expandable. That is used in the bookmark system so
% that \pkg{hyperref} does not raise any unnecessary warnings.
% \begin{macrocode}
-\cs_new_eq:NN \siunitx_textsuperscript:n \textsuperscript
+\cs_new_eq:NN \@@_textsuperscript:n \textsuperscript
% \end{macrocode}
% \end{macro}
%
-%\begin{macro}{\l_siunitx_display_math_bool}
+%\begin{macro}{\l_@@_display_math_bool}
% To test for display math, a flag is added to the start of every
% display environment.
% \begin{macrocode}
-\bool_new:N \l_siunitx_display_math_bool
+\bool_new:N \l_@@_display_math_bool
\tex_everydisplay:D \exp_after:wN
{
\tex_the:D \tex_everydisplay:D
- \bool_set_true:N \l_siunitx_display_math_bool
+ \bool_set_true:N \l_@@_display_math_bool
}
% \end{macrocode}
%\end{macro}
@@ -5626,10 +5632,10 @@ This work consists of the file siunitx.dtx
% package. By carrying out the changes outside math mode, bold can
% reliably be applied to math output.
%
-%\begin{macro}{\siunitx_set_math_fam:n}
+%\begin{macro}{\@@_set_math_fam:n}
%\begin{macro}{
-% \c_siunitx_mathsf_int ,
-% \c_siunitx_mathtt_int
+% \c_@@_mathsf_int ,
+% \c_@@_mathtt_int
%}
% The detection routine needs some basic data about the sans serif and
% monospaced fonts in use. This is collected up at the start of the
@@ -5638,72 +5644,72 @@ This work consists of the file siunitx.dtx
% using \cs{AtBeginDocument} as it has to come after anything that
% \pkg{fontspec} does (nasty errors arise otherwise).
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_set_math_fam:n #1 {
- \int_new:c { c_siunitx_math #1 _int }
+\cs_new_protected:Npn \@@_set_math_fam:n #1 {
+ \int_new:c { c_@@_math #1 _int }
\group_begin:
- \hbox_set:Nn \l_siunitx_tmp_box
+ \hbox_set:Nn \l_@@_tmp_box
{
\ensuremath
{
\use:c { math #1 }
{
- \int_gset:cn { c_siunitx_math #1 _int } { \fam }
+ \int_gset:cn { c_@@_math #1 _int } { \fam }
}
}
}
\group_end:
}
\tl_put_right:Nn \document {
- \siunitx_set_math_fam:n { sf }
- \siunitx_set_math_fam:n { tt }
+ \@@_set_math_fam:n { sf }
+ \@@_set_math_fam:n { tt }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_font_set_text_fam:n}
+%\begin{macro}{\@@_font_set_text_fam:n}
%\begin{macro}{
-% \c_siunitx_textsf_tl ,
-% \c_siunitx_texttt_tl
+% \c_@@_textsf_tl ,
+% \c_@@_texttt_tl
%}
% The text families are done in a somewhat different manner: there are
% no issues with \cs{AtBeginDocument}, luckily. The need to define
% new macros here arises as \cs{sfdefault} and \cs{ttdefault} are
% \cs{long}, whereas \cs{f@family} is not.
% \begin{macrocode}
-\cs_new_protected: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 } }
+\cs_new_protected:Npn \@@_set_text_fam:n #1 {
+ \tl_new:c { c_@@_text #1 _tl }
+ \tl_set:cx { c_@@_text #1 _tl } { \use:c { #1 default } }
}
\AtBeginDocument {
- \siunitx_set_text_fam:n { sf }
- \siunitx_set_text_fam:n { tt }
+ \@@_set_text_fam:n { sf }
+ \@@_set_text_fam:n { tt }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_detect_inline_weight_tl}
+%\begin{macro}{\l_@@_detect_inline_weight_tl}
% Used by the keys, but needs to be created here.
% \begin{macrocode}
-\tl_new:N \l_siunitx_detect_inline_weight_tl
+\tl_new:N \l_@@_detect_inline_weight_tl
% \end{macrocode}
%\end{macro}
%
-% \begin{variable}{\l_siunitx_detect_inline_family_tl}
+% \begin{variable}{\l_@@_detect_inline_family_tl}
% This one is not generated by the keys system.
% \begin{macrocode}
-\tl_new:N \l_siunitx_detect_inline_family_tl
+\tl_new:N \l_@@_detect_inline_family_tl
% \end{macrocode}
% \end{variable}
%
%\begin{macro}{
-% \l_siunitx_detect_display_math_bool ,
-% \l_siunitx_detect_family_bool ,
-% \l_siunitx_detect_inline_family_tl ,
-% \l_siunitx_detect_shape_bool ,
-% \l_siunitx_detect_mode_bool ,
-% \l_siunitx_detect_weight_bool
+% \l_@@_detect_display_math_bool ,
+% \l_@@_detect_family_bool ,
+% \l_@@_detect_inline_family_tl ,
+% \l_@@_detect_shape_bool ,
+% \l_@@_detect_mode_bool ,
+% \l_@@_detect_weight_bool
%}
% Font detection is all about creating switches, with just a little
% gloss for \texttt{detect-all} and \texttt{detect-none}.
@@ -5726,26 +5732,26 @@ This work consists of the file siunitx.dtx
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,
+ \l_@@_detect_display_math_bool,
+ detect-family .bool_set:N = \l_@@_detect_family_bool,
detect-inline-family .choice:,
detect-inline-family .value_required:,
detect-inline-family /
math .code:n =
- { \tl_set:Nn \l_siunitx_detect_inline_family_tl { math } },
+ { \tl_set:Nn \l_@@_detect_inline_family_tl { math } },
detect-inline-family /
text .code:n =
- { \tl_set:Nn \l_siunitx_detect_inline_family_tl { text } },
+ { \tl_set:Nn \l_@@_detect_inline_family_tl { text } },
detect-inline-weight .choice:,
detect-inline-weight .value_required:,
detect-inline-weight /
math .code:n =
- { \tl_set:Nn \l_siunitx_detect_inline_weight_tl { math } },
+ { \tl_set:Nn \l_@@_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_shape_bool,
- detect-mode .bool_set:N = \l_siunitx_detect_mode_bool,
+ { \tl_set:Nn \l_@@_detect_inline_weight_tl { text } },
+ detect-italic .bool_set:N = \l_@@_detect_shape_bool,
+ detect-mode .bool_set:N = \l_@@_detect_mode_bool,
detect-none .choice:,
detect-none .default:n = true,
detect-none / false .meta:n =
@@ -5762,8 +5768,8 @@ This work consists of the file siunitx.dtx
detect-shape = false,
detect-weight = false
},
- detect-shape .bool_set:N = \l_siunitx_detect_shape_bool,
- detect-weight .bool_set:N = \l_siunitx_detect_weight_bool
+ detect-shape .bool_set:N = \l_@@_detect_shape_bool,
+ detect-weight .bool_set:N = \l_@@_detect_weight_bool
}
\keys_set:nn { siunitx } {
detect-inline-family = text ,
@@ -5773,165 +5779,165 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_font_set_bool ,
-% \l_siunitx_font_math_mode_bool
+% \l_@@_font_set_bool ,
+% \l_@@_font_math_mode_bool
%}
% The internals of the package need a number of switches to track what
% is happening.
% \begin{macrocode}
-\bool_new:N \l_siunitx_font_set_bool
-\bool_new:N \l_siunitx_font_math_mode_bool
+\bool_new:N \l_@@_font_set_bool
+\bool_new:N \l_@@_font_math_mode_bool
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_font_family_tl}
+%\begin{macro}{\l_@@_font_family_tl}
% Also some token storage.
% \begin{macrocode}
-\tl_new:N \l_siunitx_font_family_tl
+\tl_new:N \l_@@_font_family_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_font_shape: ,
-% \siunitx_font_weight:
+% \@@_font_shape: ,
+% \@@_font_weight:
%}
% These could be token lists or functions!
% \begin{macrocode}
-\cs_new:Npn \siunitx_font_shape: { }
-\cs_new:Npn \siunitx_font_weight: { }
+\cs_new:Npn \@@_font_shape: { }
+\cs_new:Npn \@@_font_weight: { }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_detect_font:}
+%\begin{macro}{\@@_detect_font:}
% The main font-setting macro is a control point for the other
% functions. Nesting font-control should not happen, so the first
% test is to ensure this is not happening.
% \begin{macrocode}
-\cs_new_protected: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_shape_bool
- { \siunitx_detect_font_shape: }
- \bool_if:NT \l_siunitx_detect_mode_bool
- { \siunitx_detect_font_mode: }
+\cs_new_protected:Npn \@@_detect_font: {
+ \bool_if:NF \l_@@_font_set_bool
+ {
+ \@@_detect_font_init:
+ \bool_if:NT \l_@@_detect_weight_bool
+ { \@@_detect_font_weight: }
+ \bool_if:NT \l_@@_detect_family_bool
+ { \@@_detect_font_family: }
+ \bool_if:NT \l_@@_detect_shape_bool
+ { \@@_detect_font_shape: }
+ \bool_if:NT \l_@@_detect_mode_bool
+ { \@@_detect_font_mode: }
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_detect_font_init:}
+%\begin{macro}{\@@_detect_font_init:}
% Set up the basic macros on the assumption nothing happens.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_detect_font_init: {
- \bool_set_true:N \l_siunitx_font_set_bool
- \cs_set:Npn \siunitx_font_weight:
+\cs_new_protected:Npn \@@_detect_font_init: {
+ \bool_set_true:N \l_@@_font_set_bool
+ \cs_set:Npn \@@_font_weight:
{
\unboldmath
\mdseries
}
- \cs_set:Npn \siunitx_font_shape: { \upshape }
- \tl_set:Nn \l_siunitx_font_family_tl { rm }
- \bool_set_true:N \l_siunitx_font_math_mode_bool
+ \cs_set:Npn \@@_font_shape: { \upshape }
+ \tl_set:Nn \l_@@_font_family_tl { rm }
+ \bool_set_true:N \l_@@_font_math_mode_bool
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_detect_font_weight:}
+%\begin{macro}{\@@_detect_font_weight:}
% The font weight detection code depends on whether the current text is
% math or text, and also the type of math (if appropriate). For
% inline math, there is a choice of what test to apply.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_detect_font_weight: {
+\cs_new_protected:Npn \@@_detect_font_weight: {
\mode_if_math:TF
{
- \bool_if:NTF \l_siunitx_display_math_bool
+ \bool_if:NTF \l_@@_display_math_bool
{
- \bool_if:NTF \l_siunitx_detect_display_math_bool
- { \siunitx_detect_font_weight_math: }
- { \siunitx_detect_font_weight_text: }
+ \bool_if:NTF \l_@@_detect_display_math_bool
+ { \@@_detect_font_weight_math: }
+ { \@@_detect_font_weight_text: }
}
{
\use:c
{
- siunitx_detect_font_weight_
- \l_siunitx_detect_inline_weight_tl
+ @@_detect_font_weight_
+ \l_@@_detect_inline_weight_tl
:
}
}
}
- { \siunitx_detect_font_weight_text: }
+ { \@@_detect_font_weight_text: }
}
% \end{macrocode}
%\end{macro}
%\begin{macro}{
-% \siunitx_detect_font_weight_math: ,
-% \siunitx_detect_font_weight_text:
+% \@@_detect_font_weight_math: ,
+% \@@_detect_font_weight_text:
%}
% The tests for font weight depend on whether the module is testing
% text or math content.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_detect_font_weight_math: {
+\cs_new_protected:Npn \@@_detect_font_weight_math: {
\str_if_eq:VnT \math@version { bold }
{
- \cs_set:Npn \siunitx_font_weight:
+ \cs_set:Npn \@@_font_weight:
{
\boldmath
\bfseries
}
}
\str_if_eq:VnT \math@version { light }
- { \cs_set:Npn \siunitx_font_weight: { \lseries } }
+ { \cs_set:Npn \@@_font_weight: { \lseries } }
}
-\cs_new_protected:Npn \siunitx_detect_font_weight_text: {
- \tl_set:Nx \l_siunitx_tmpa_tl { \tl_head:V \f@series }
- \str_if_eq:VnT \l_siunitx_tmpa_tl { b }
+\cs_new_protected:Npn \@@_detect_font_weight_text: {
+ \tl_set:Nx \l_@@_tmpa_tl { \tl_head:V \f@series }
+ \str_if_eq:VnT \l_@@_tmpa_tl { b }
{
- \cs_set:Npn \siunitx_font_weight:
+ \cs_set:Npn \@@_font_weight:
{
\boldmath
\bfseries
}
}
- \str_if_eq:VnT \l_siunitx_tmpa_tl { l }
- { \cs_set:Npn \siunitx_font_weight: { \lseries } }
+ \str_if_eq:VnT \l_@@_tmpa_tl { l }
+ { \cs_set:Npn \@@_font_weight: { \lseries } }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_detect_font_family:}
+%\begin{macro}{\@@_detect_font_family:}
% Family detection usually picks up the surrounding text. However, for
% display math there are two options, and so a second test may be made.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_detect_font_family: {
+\cs_new_protected:Npn \@@_detect_font_family: {
\mode_if_math:TF
{
- \bool_if:NTF \l_siunitx_display_math_bool
+ \bool_if:NTF \l_@@_display_math_bool
{
- \bool_if:NTF \l_siunitx_detect_display_math_bool
- { \siunitx_detect_font_family_math: }
- { \siunitx_detect_font_family_text: }
+ \bool_if:NTF \l_@@_detect_display_math_bool
+ { \@@_detect_font_family_math: }
+ { \@@_detect_font_family_text: }
}
{
\use:c
{
- siunitx_detect_font_family_
- \l_siunitx_detect_inline_family_tl
+ @@_detect_font_family_
+ \l_@@_detect_inline_family_tl
:
}
}
}
- { \siunitx_detect_font_family_text: }
+ { \@@_detect_font_family_text: }
}
% \end{macrocode}
%\end{macro}
%\begin{macro}{
-% \siunitx_detect_font_family_math: ,
-% \siunitx_detect_font_family_text:
+% \@@_detect_font_family_math: ,
+% \@@_detect_font_family_text:
%}
% The two detections routines check if the current font is sans serif or
% monospaced. The method used depends on whether the current math or
@@ -5939,44 +5945,44 @@ This work consists of the file siunitx.dtx
% default (\texttt{rm}), as the text function is always called and may
% have changed things.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_detect_font_family_math: {
- \tl_set:Nn \l_siunitx_font_family_tl { rm }
- \int_compare:nNnT { \fam } = { \c_siunitx_mathsf_int }
- { \tl_set:Nn \l_siunitx_font_family_tl { sf } }
- \int_compare:nNnT { \fam } = { \c_siunitx_mathtt_int }
- { \tl_set:Nn \l_siunitx_font_family_tl { tt } }
+\cs_new_protected:Npn \@@_detect_font_family_math: {
+ \tl_set:Nn \l_@@_font_family_tl { rm }
+ \int_compare:nNnT { \fam } = { \c_@@_mathsf_int }
+ { \tl_set:Nn \l_@@_font_family_tl { sf } }
+ \int_compare:nNnT { \fam } = { \c_@@_mathtt_int }
+ { \tl_set:Nn \l_@@_font_family_tl { tt } }
}
-\cs_new_protected: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_new_protected:Npn \@@_detect_font_family_text: {
+ \tl_if_eq:NNT \f@family \c_@@_textsf_tl
+ { \tl_set:Nn \l_@@_font_family_tl { sf } }
+ \tl_if_eq:NNT \f@family \c_@@_texttt_tl
+ { \tl_set:Nn \l_@@_font_family_tl { tt } }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_detect_font_shape:}
+%\begin{macro}{\@@_detect_font_shape:}
% The shape test uses \cs{f@shape} as a handy indicator.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_detect_font_shape: {
+\cs_new_protected:Npn \@@_detect_font_shape: {
\str_if_eq:VnT \f@shape { it }
- { \cs_set:Npn \siunitx_font_shape: { \itshape } }
+ { \cs_set:Npn \@@_font_shape: { \itshape } }
\str_if_eq:VnT \f@shape { sl }
- { \cs_set:Npn \siunitx_font_shape: { \slshape } }
+ { \cs_set:Npn \@@_font_shape: { \slshape } }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_detect_font_mode:}
+%\begin{macro}{\@@_detect_font_mode:}
% The mode switch works from the fact that math mode output it the
% standard.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_detect_font_mode: {
+\cs_new_protected:Npn \@@_detect_font_mode: {
\mode_if_math:F
{
- \bool_set_false:N \l_siunitx_font_math_mode_bool
- \bool_set_false:N \l_siunitx_number_math_mode_bool
- \bool_set_false:N \l_siunitx_unit_math_mode_bool
+ \bool_set_false:N \l_@@_font_math_mode_bool
+ \bool_set_false:N \l_@@_number_math_mode_bool
+ \bool_set_false:N \l_@@_unit_math_mode_bool
}
}
% \end{macrocode}
@@ -5991,103 +5997,103 @@ This work consists of the file siunitx.dtx
% the family selected by the detector.
%
%\begin{macro}{
-% \l_siunitx_number_math_mode_bool ,
-% \l_siunitx_unit_math_mode_bool
+% \l_@@_number_math_mode_bool ,
+% \l_@@_unit_math_mode_bool
%}
% Most of the variables are created by the keys system: these are not.
% \begin{macrocode}
-\bool_new:N \l_siunitx_number_math_mode_bool
-\bool_new:N \l_siunitx_unit_math_mode_bool
+\bool_new:N \l_@@_number_math_mode_bool
+\bool_new:N \l_@@_unit_math_mode_bool
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_mathrm:n ,
-% \siunitx_number_mathsf:n ,
-% \siunitx_number_mathtt:n ,
-% \siunitx_number_textrm: ,
-% \siunitx_number_textsf: ,
-% \siunitx_number_texttt:
+% \@@_number_mathrm:n ,
+% \@@_number_mathsf:n ,
+% \@@_number_mathtt:n ,
+% \@@_number_textrm: ,
+% \@@_number_textsf: ,
+% \@@_number_texttt:
%}
% Functions for number-mode fonts.
% \begin{macrocode}
-\cs_new:Npn \siunitx_number_mathrm:n #1 { }
-\cs_new:Npn \siunitx_number_mathsf:n #1 { }
-\cs_new:Npn \siunitx_number_mathtt:n #1 { }
-\cs_new:Npn \siunitx_number_textrm: { }
-\cs_new:Npn \siunitx_number_textsf: { }
-\cs_new:Npn \siunitx_number_texttt: { }
+\cs_new:Npn \@@_number_mathrm:n #1 { }
+\cs_new:Npn \@@_number_mathsf:n #1 { }
+\cs_new:Npn \@@_number_mathtt:n #1 { }
+\cs_new:Npn \@@_number_textrm: { }
+\cs_new:Npn \@@_number_textsf: { }
+\cs_new:Npn \@@_number_texttt: { }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_color_tl}
+%\begin{macro}{\l_@@_number_color_tl}
% The settings are actually created separately for numbers and units:
% numbers first.
% \begin{macrocode}
\keys_define:nn { siunitx } {
- number-color .tl_set:N = \l_siunitx_number_color_tl,
+ number-color .tl_set:N = \l_@@_number_color_tl,
number-math-rm .code:n =
- { \cs_set:Npn \siunitx_number_mathrm:n ##1 { #1 {##1} } },
+ { \cs_set:Npn \@@_number_mathrm:n ##1 { #1 {##1} } },
number-math-sf .code:n =
- { \cs_set:Npn \siunitx_number_mathsf:n ##1 { #1 {##1} } },
+ { \cs_set:Npn \@@_number_mathsf:n ##1 { #1 {##1} } },
number-math-tt .code:n =
- { \cs_set:Npn \siunitx_number_mathtt:n ##1 { #1 {##1} } },
+ { \cs_set:Npn \@@_number_mathtt:n ##1 { #1 {##1} } },
number-mode .choice:,
number-mode / math .code:n =
- { \bool_set_true:N \l_siunitx_number_math_mode_bool },
+ { \bool_set_true:N \l_@@_number_math_mode_bool },
number-mode / text .code:n =
- { \bool_set_false:N \l_siunitx_number_math_mode_bool },
+ { \bool_set_false:N \l_@@_number_math_mode_bool },
number-text-rm .code:n =
- { \cs_set:Npn \siunitx_number_textrm: {#1} },
+ { \cs_set:Npn \@@_number_textrm: {#1} },
number-text-sf .code:n =
- { \cs_set:Npn \siunitx_number_textsf: {#1} },
+ { \cs_set:Npn \@@_number_textsf: {#1} },
number-text-tt .code:n =
- { \cs_set:Npn \siunitx_number_texttt: {#1} }
+ { \cs_set:Npn \@@_number_texttt: {#1} }
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_unit_mathrm:n ,
-% \siunitx_unit_mathsf:n ,
-% \siunitx_unit_mathtt:n ,
-% \siunitx_unit_textrm: ,
-% \siunitx_unit_textsf: ,
-% \siunitx_unit_texttt:
+% \@@_unit_mathrm:n ,
+% \@@_unit_mathsf:n ,
+% \@@_unit_mathtt:n ,
+% \@@_unit_textrm: ,
+% \@@_unit_textsf: ,
+% \@@_unit_texttt:
%}
% The same storage for unit-mode fonts.
% \begin{macrocode}
-\cs_new:Npn \siunitx_unit_mathrm: { }
-\cs_new:Npn \siunitx_unit_mathsf: { }
-\cs_new:Npn \siunitx_unit_mathtt: { }
-\cs_new:Npn \siunitx_unit_textrm: { }
-\cs_new:Npn \siunitx_unit_textsf: { }
-\cs_new:Npn \siunitx_unit_texttt: { }
+\cs_new:Npn \@@_unit_mathrm: { }
+\cs_new:Npn \@@_unit_mathsf: { }
+\cs_new:Npn \@@_unit_mathtt: { }
+\cs_new:Npn \@@_unit_textrm: { }
+\cs_new:Npn \@@_unit_textsf: { }
+\cs_new:Npn \@@_unit_texttt: { }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_unit_color_tl}
+%\begin{macro}{\l_@@_unit_color_tl}
% Units look exactly the same.
% \begin{macrocode}
\keys_define:nn { siunitx } {
- unit-color .tl_set:N = \l_siunitx_unit_color_tl,
+ unit-color .tl_set:N = \l_@@_unit_color_tl,
unit-math-rm .code:n =
- { \cs_set:Npn \siunitx_unit_mathrm:n ##1 { #1 {##1} } },
+ { \cs_set:Npn \@@_unit_mathrm:n ##1 { #1 {##1} } },
unit-math-sf .code:n =
- { \cs_set:Npn \siunitx_unit_mathsf:n ##1 { #1 {##1} } },
+ { \cs_set:Npn \@@_unit_mathsf:n ##1 { #1 {##1} } },
unit-math-tt .code:n =
- { \cs_set:Npn \siunitx_unit_mathtt:n ##1 { #1 {##1} } },
+ { \cs_set:Npn \@@_unit_mathtt:n ##1 { #1 {##1} } },
unit-mode .choice:,
unit-mode / math .code:n =
- { \bool_set_true:N \l_siunitx_unit_math_mode_bool },
+ { \bool_set_true:N \l_@@_unit_math_mode_bool },
unit-mode / text .code:n =
- { \bool_set_false:N \l_siunitx_unit_math_mode_bool },
+ { \bool_set_false:N \l_@@_unit_math_mode_bool },
unit-text-rm .code:n =
- { \cs_set:Npn \siunitx_unit_textrm: {#1} },
+ { \cs_set:Npn \@@_unit_textrm: {#1} },
unit-text-sf .code:n =
- { \cs_set:Npn \siunitx_unit_textsf: {#1} },
+ { \cs_set:Npn \@@_unit_textsf: {#1} },
unit-text-tt .code:n =
- { \cs_set:Npn \siunitx_unit_texttt: {#1} }
+ { \cs_set:Npn \@@_unit_texttt: {#1} }
}
% \end{macrocode}
%\end{macro}
@@ -6160,17 +6166,17 @@ This work consists of the file siunitx.dtx
% all round.
% \begin{macrocode}
\AtBeginDocument {
- \tl_set:Nx \l_siunitx_tmpa_tl { \familydefault }
+ \tl_set:Nx \l_@@_tmpa_tl { \familydefault }
\@ifpackageloaded { eulervm }
{
- \cs_set:Npn \siunitx_tmp:w #1 { \mathrm {#1} }
- \cs_if_eq:NNT \siunitx_number_mathrm:n \siunitx_tmp:w
+ \cs_set:Npn \@@_tmp:w #1 { \mathrm {#1} }
+ \cs_if_eq:NNT \@@_number_mathrm:n \@@_tmp:w
{ \keys_set:nn { siunitx } { number-math-rm = \mathnormal } }
- \cs_if_eq:NNT \siunitx_unit_mathrm:n \siunitx_tmp:w
+ \cs_if_eq:NNT \@@_unit_mathrm:n \@@_tmp:w
{ \keys_set:nn { siunitx } { unit-math-rm = \mathnormal } }
}
{ }
- \tl_if_eq:NNT \l_siunitx_tmpa_tl \c_siunitx_textsf_tl
+ \tl_if_eq:NNT \l_@@_tmpa_tl \c_@@_textsf_tl
{
\@ifpackageloaded { arev }
{ }
@@ -6178,30 +6184,30 @@ This work consists of the file siunitx.dtx
\@ifpackageloaded { cmbright }
{ }
{
- \cs_set:Npn \siunitx_tmp:w #1 { \mathrm {#1} }
- \cs_if_eq:NNT \siunitx_number_mathrm:n \siunitx_tmp:w
+ \cs_set:Npn \@@_tmp:w #1 { \mathrm {#1} }
+ \cs_if_eq:NNT \@@_number_mathrm:n \@@_tmp:w
{ \keys_set:nn { siunitx } { number-math-rm = \mathsf } }
- \cs_if_eq:NNT \siunitx_unit_mathrm:n \siunitx_tmp:w
+ \cs_if_eq:NNT \@@_unit_mathrm:n \@@_tmp:w
{ \keys_set:nn { siunitx } { unit-math-rm = \mathsf } }
}
}
- \cs_set:Npn \siunitx_tmp:w { \rmfamily }
- \cs_if_eq:NNT \siunitx_number_textrm: \siunitx_tmp:w
+ \cs_set:Npn \@@_tmp:w { \rmfamily }
+ \cs_if_eq:NNT \@@_number_textrm: \@@_tmp:w
{ \keys_set:nn { siunitx } { number-text-rm = \sffamily } }
- \cs_if_eq:NNT \siunitx_unit_textrm: \siunitx_tmp:w
+ \cs_if_eq:NNT \@@_unit_textrm: \@@_tmp:w
{ \keys_set:nn { siunitx } { unit-text-rm = \sffamily } }
}
- \tl_if_eq:NNT \l_siunitx_tmpa_tl \c_siunitx_texttt_tl
+ \tl_if_eq:NNT \l_@@_tmpa_tl \c_@@_texttt_tl
{
- \cs_set:Npn \siunitx_tmp:w #1 { \mathrm {#1} }
- \cs_if_eq:NNT \siunitx_number_mathrm:n \siunitx_tmp:w
+ \cs_set:Npn \@@_tmp:w #1 { \mathrm {#1} }
+ \cs_if_eq:NNT \@@_number_mathrm:n \@@_tmp:w
{ \keys_set:nn { siunitx } { number-math-rm = \mathtt } }
- \cs_if_eq:NNT \siunitx_unit_mathrm:n \siunitx_tmp:w
+ \cs_if_eq:NNT \@@_unit_mathrm:n \@@_tmp:w
{ \keys_set:nn { siunitx } { unit-math-rm = \mathtt } }
- \cs_set:Npn \siunitx_tmp:w { \rmfamily }
- \cs_if_eq:NNT \siunitx_number_textrm: \siunitx_tmp:w
+ \cs_set:Npn \@@_tmp:w { \rmfamily }
+ \cs_if_eq:NNT \@@_number_textrm: \@@_tmp:w
{ \keys_set:nn { siunitx } { number-text-rm = \ttfamily } }
- \cs_if_eq:NNT \siunitx_unit_textrm: \siunitx_tmp:w
+ \cs_if_eq:NNT \@@_unit_textrm: \@@_tmp:w
{ \keys_set:nn { siunitx } { unit-text-rm = \ttfamily } }
}
}
@@ -6215,65 +6221,65 @@ This work consists of the file siunitx.dtx
% to have taken some steps first (this is to allow line breaks in the
% appropriate places).
%
-%\begin{macro}{\l_siunitx_print_arg_tl}
+%\begin{macro}{\l_@@_print_arg_tl}
% The text to print.
% \begin{macrocode}
-\tl_new:N \l_siunitx_print_arg_tl
+\tl_new:N \l_@@_print_arg_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_print_type_tl}
+%\begin{macro}{\l_@@_print_type_tl}
% The type of output (\texttt{number} or \texttt{unit}) is always
% needed.
% \begin{macrocode}
-\tl_new:N \l_siunitx_print_type_tl
+\tl_new:N \l_@@_print_type_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_print:nn ,
-% \siunitx_print:nV
+% \@@_print:nn ,
+% \@@_print:nV
%}
-%\begin{macro}[aux]{\siunitx_print_aux:}
+%\begin{macro}[aux]{\@@_print_aux:}
% The main printing function does everything inside a group, as
% there are category code and definition changes to make. First, set
% the fonts. Then move on to printing mode, before moving to actual
% printing.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_print:nn #1#2 {
+\cs_new_protected:Npn \@@_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
+ \tl_set:Nn \l_@@_print_type_tl {#1}
+ \tl_set:Nn \l_@@_print_arg_tl {#2}
+ \@@_detect_font:
+ \bool_if:NF \l_@@_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 }
+ \bool_if:cTF { l_@@_ #1 _math_mode_bool }
+ { \bool_set_true:N \l_@@_font_math_mode_bool }
+ { \bool_set_false:N \l_@@_font_math_mode_bool }
}
- \siunitx_print_aux:
+ \@@_print_aux:
\group_end:
}
-\cs_generate_variant:Nn \siunitx_print:nn { nV }
+\cs_generate_variant:Nn \@@_print:nn { nV }
% \end{macrocode}
% The various font changes are set up, then the correct printing
% function is called. Everything is inside \cs{text} as this allows
% proper setting of the various mode settings.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_print_aux: {
+\cs_new_protected:Npn \@@_print_aux: {
\text
{
- \siunitx_print_color:
- \siunitx_font_shape:
- \siunitx_font_weight:
+ \@@_print_color:
+ \@@_font_shape:
+ \@@_font_weight:
\use:c
{
- siunitx_ \l_siunitx_print_type_tl _
- text \l_siunitx_font_family_tl :
+ @@_ \l_@@_print_type_tl _
+ text \l_@@_font_family_tl :
}
- \bool_if:NTF \l_siunitx_font_math_mode_bool
- { \siunitx_print_math: }
- { \siunitx_print_text: }
+ \bool_if:NTF \l_@@_font_math_mode_bool
+ { \@@_print_math: }
+ { \@@_print_text: }
}
}
% \end{macrocode}
@@ -6281,36 +6287,36 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_print_color: ,
-% \siunitx_textcolor:n
+% \@@_print_color: ,
+% \@@_textcolor:n
%}
% The colour system checks if \pkg{color} is loaded, and only does
% anything if it is. This will change when \LaTeX3 proper is available:
% there will be colour out of the box!
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_print_color: {
- \tl_if_empty:cF { l_siunitx_ \l_siunitx_print_type_tl _color_tl }
+\cs_new_protected:Npn \@@_print_color: {
+ \tl_if_empty:cF { l_@@_ \l_@@_print_type_tl _color_tl }
{
\color
{
- \tl_use:c { l_siunitx_ \l_siunitx_print_type_tl _color_tl }
+ \tl_use:c { l_@@_ \l_@@_print_type_tl _color_tl }
}
}
}
\AtBeginDocument {
\@ifpackageloaded { color }
- { \cs_new_eq:NN \siunitx_textcolor:n \textcolor }
+ { \cs_new_eq:NN \@@_textcolor:n \textcolor }
{
- \cs_set_eq:NN \siunitx_print_color: \scan_stop:
- \cs_new_eq:NN \siunitx_textcolor:n \use_none:n
+ \cs_set_eq:NN \@@_print_color: \scan_stop:
+ \cs_new_eq:NN \@@_textcolor:n \use_none:n
}
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_print_math: ,
-% \siunitx_print_text:
+% \@@_print_math: ,
+% \@@_print_text:
%}
% Printing the text means replacing any awkward characters, which is
% dependent on the output mode. The rest of the package uses "_" and
@@ -6319,7 +6325,7 @@ This work consists of the file siunitx.dtx
% \pkg{underscore} package may make "_" active, or more likely
% it will be a superscript character. Both are tested for here.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_print_math:
+\cs_new_protected:Npn \@@_print_math:
{
\cs_set_eq:NN \PrintSubscript \sb
\cs_set_eq:NN \PrintSuperscript \sp
@@ -6327,10 +6333,10 @@ This work consists of the file siunitx.dtx
{
\use:c
{
- siunitx_ \l_siunitx_print_type_tl _
- math \l_siunitx_font_family_tl :n
+ @@_ \l_@@_print_type_tl _
+ math \l_@@_font_family_tl :n
}
- { \l_siunitx_print_arg_tl }
+ { \l_@@_print_arg_tl }
}
}
\group_begin:
@@ -6342,71 +6348,71 @@ This work consists of the file siunitx.dtx
\char_set_lccode:nn { `\+ } { `\^ }
\tl_to_lowercase:n {
\group_end:
- \cs_new_protected:Npn \siunitx_print_text:
- {
- \tl_replace_all:Nnn \l_siunitx_print_arg_tl { - }
- { \c_siunitx_minus_tl }
- \cs_set_eq:NN \PrintSubscript \siunitx_print_text_sub:n
- \cs_set_eq:NN \PrintSuperscript \siunitx_print_text_super:n
- \tl_replace_all:Nnn \l_siunitx_print_arg_tl { @ }
- { \siunitx_print_text_sub:n }
- \tl_replace_all:Nnn \l_siunitx_print_arg_tl { ! }
- { \siunitx_print_text_sub:n }
- \tl_replace_all:Nnn \l_siunitx_print_arg_tl { = }
- { \siunitx_print_text_sub:n }
- \tl_replace_all:Nnn \l_siunitx_print_arg_tl { ^ }
- { \siunitx_print_text_super:n }
- \tl_replace_all:Nnn \l_siunitx_print_arg_tl { + }
- { \siunitx_print_text_super:n }
- \l_siunitx_print_arg_tl
+ \cs_new_protected:Npn \@@_print_text:
+ {
+ \tl_replace_all:Nnn \l_@@_print_arg_tl { - }
+ { \c_@@_minus_tl }
+ \cs_set_eq:NN \PrintSubscript \@@_print_text_sub:n
+ \cs_set_eq:NN \PrintSuperscript \@@_print_text_super:n
+ \tl_replace_all:Nnn \l_@@_print_arg_tl { @ }
+ { \@@_print_text_sub:n }
+ \tl_replace_all:Nnn \l_@@_print_arg_tl { ! }
+ { \@@_print_text_sub:n }
+ \tl_replace_all:Nnn \l_@@_print_arg_tl { = }
+ { \@@_print_text_sub:n }
+ \tl_replace_all:Nnn \l_@@_print_arg_tl { ^ }
+ { \@@_print_text_super:n }
+ \tl_replace_all:Nnn \l_@@_print_arg_tl { + }
+ { \@@_print_text_super:n }
+ \l_@@_print_arg_tl
}
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_print_text_sub:n ,
-% \siunitx_print_text_super:n
+% \@@_print_text_sub:n ,
+% \@@_print_text_super:n
%}
-%\begin{macro}[aux]{\siunitx_print_text_sub_super:n}
+%\begin{macro}[aux]{\@@_print_text_sub_super:n}
% The appropriate macros for sub- and superscript in text mode ensure
-% the appearance is the same as math mode. . The search and replace
+% the appearance is the same as math mode. The search and replace
% code for superscripts deals with the case where a literal number has
% been given with text mode printing. There is currently an issue with
% \pkg{expl3}'s \cs{peek_\ldots} functions, which means that the peek
% code is written out here in full.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_print_text_sub:n #1
+\cs_new_protected:Npn \@@_print_text_sub:n #1
{
- \cs_set:Npn \siunitx_print_text_sub_super:n ##1
+ \cs_set:Npn \@@_print_text_sub_super:n ##1
{
- \ensuremath
+ \ensuremath
{
\sb { \text {#1} }
\sp { \text {##1} }
}
}
- \cs_set_eq:NN \l_peek_search_token \siunitx_print_text_super:n
- \cs_set:Npn \peek_true:w
+ \cs_set_eq:NN \l__peek_search_token \@@_print_text_super:n
+ \cs_set:Npn \__peek_true:w
{
- \tex_afterassignment:D \peek_true_aux:w
- \cs_set_eq:NN \peek_tmp:w
+ \tex_afterassignment:D \__peek_true_aux:w
+ \cs_set_eq:NN \__peek_tmp:w
}
- \cs_set:Npn \peek_true_aux:w { \siunitx_print_text_sub_super:n }
- \cs_set:Npn \peek_false:w { \ensuremath { \sb { \text {#1} } } }
- \peek_after:Nw \peek_execute_branches_meaning:
+ \cs_set:Npn \__peek_true_aux:w { \@@_print_text_sub_super:n }
+ \cs_set:Npn \__peek_false:w { \ensuremath { \sb { \text {#1} } } }
+ \peek_after:Nw \__peek_execute_branches_meaning:
}
-\cs_new_protected:Npn \siunitx_print_text_sub_super:n { }
-\cs_new_protected:Npn \siunitx_print_text_super:n #1 {
- \tl_set:Nn \l_siunitx_tmpa_tl {#1}
- \tl_replace_all:Nnn \l_siunitx_tmpa_tl { - }
- { \c_siunitx_minus_tl }
- \tl_set:Nx \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_print_text_sub_super:n { }
+\cs_new_protected:Npn \@@_print_text_super:n #1 {
+ \tl_set:Nn \l_@@_tmpa_tl {#1}
+ \tl_replace_all:Nnn \l_@@_tmpa_tl { - }
+ { \c_@@_minus_tl }
+ \tl_set:Nx \l_@@_tmpa_tl
{
\exp_not:N \ensuremath
- { \sp { \exp_not:N \text { \exp_not:V \l_siunitx_tmpa_tl } } }
+ { \sp { \exp_not:N \text { \exp_not:V \l_@@_tmpa_tl } } }
}
- \l_siunitx_tmpa_tl
+ \l_@@_tmpa_tl
}
% \end{macrocode}
%\end{macro}
@@ -6428,14 +6434,14 @@ This work consists of the file siunitx.dtx
% pre-process the input. The possibility that the data in can contain
% more than one number needs to be handled.
%
-%\begin{macro}{\l_siunitx_input_product_tl}
-%\begin{macro}{\l_siunitx_input_quotient_tl}
+%\begin{macro}{\l_@@_input_product_tl}
+%\begin{macro}{\l_@@_input_quotient_tl}
% There are a couple of settings which are created here as they are used
% only for pre-processing.
% \begin{macrocode}
\keys_define:nn { siunitx } {
- input-product .tl_set:N = \l_siunitx_input_product_tl,
- input-quotient .tl_set:N = \l_siunitx_input_quotient_tl,
+ input-product .tl_set:N = \l_@@_input_product_tl,
+ input-quotient .tl_set:N = \l_@@_input_quotient_tl,
}
\keys_set:nn { siunitx } {
input-product = x,
@@ -6446,87 +6452,87 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_number_arg_tl ,
-% \l_siunitx_number_next_tl
+% \l_@@_number_arg_tl ,
+% \l_@@_number_next_tl
%}
% Storage for the pre-parsed material. The \texttt{arg} variable
% contains the current argument, the \texttt{next} variable contains
% anything held-over for the next round.
% \begin{macrocode}
-\tl_new:N \l_siunitx_number_arg_tl
-\tl_new:N \l_siunitx_number_next_tl
+\tl_new:N \l_@@_number_arg_tl
+\tl_new:N \l_@@_number_next_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_multi_tl}
+%\begin{macro}{\l_@@_number_multi_tl}
% For products and quotients, a way of feeding information back.
% \begin{macrocode}
-\tl_new:N \l_siunitx_number_multi_tl
+\tl_new:N \l_@@_number_multi_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_number_denominator_tl ,
-% \l_siunitx_number_numerator_tl
+% \l_@@_number_denominator_tl ,
+% \l_@@_number_numerator_tl
%}
% When searching for quotients, some more storage is needed.
% \begin{macrocode}
-\tl_new:N \l_siunitx_number_denominator_tl
-\tl_new:N \l_siunitx_number_numerator_tl
+\tl_new:N \l_@@_number_denominator_tl
+\tl_new:N \l_@@_number_numerator_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_preprocess:n ,
-% \siunitx_number_preprocess:V
+% \@@_number_preprocess:n ,
+% \@@_number_preprocess:V
%}
% The pre-processor starts with the obvious: the most likely outcome is
% that all of the argument is passed through unchanged.
% \begin{macrocode}
-\cs_new_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_new_protected:Npn \@@_number_preprocess:n #1 {
+ \@@_number_preprocess_init:
+ \tl_set:Nn \l_@@_number_arg_tl {#1}
+ \@@_number_preprocess_product:
+ \tl_if_empty:NT \l_@@_number_multi_tl
+ { \@@_number_preprocess_quotient: }
}
-\cs_generate_variant:Nn \siunitx_number_preprocess:n { V }
+\cs_generate_variant:Nn \@@_number_preprocess:n { V }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_preprocess_init:}
+%\begin{macro}{\@@_number_preprocess_init:}
% A little initialisation as normal.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_preprocess_init: {
- \bool_set_false:N \l_siunitx_error_bool
- \tl_clear:N \l_siunitx_number_multi_tl
+\cs_new_protected:Npn \@@_number_preprocess_init: {
+ \bool_set_false:N \l_@@_error_bool
+ \tl_clear:N \l_@@_number_multi_tl
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_preprocess_product:}
-%\begin{macro}[aux]{\siunitx_number_preprocess_product_aux:N}
+%\begin{macro}{\@@_number_preprocess_product:}
+%\begin{macro}[aux]{\@@_number_preprocess_product_aux:N}
% Rather than search through the entire argument, we use the
% delimited-argument trick.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_preprocess_product: {
- \tl_map_function:NN \l_siunitx_input_product_tl
- \siunitx_number_preprocess_product_aux:N
+\cs_new_protected:Npn \@@_number_preprocess_product: {
+ \tl_map_function:NN \l_@@_input_product_tl
+ \@@_number_preprocess_product_aux:N
}
-\cs_new_protected:Npn \siunitx_number_preprocess_product_aux:N #1 {
- \tl_if_in:NnT \l_siunitx_number_arg_tl {#1}
+\cs_new_protected:Npn \@@_number_preprocess_product_aux:N #1 {
+ \tl_if_in:NnT \l_@@_number_arg_tl {#1}
{
- \cs_set:Npn \siunitx_tmp:w ##1 #1 ##2 \q_stop
+ \cs_set:Npn \@@_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 }
+ \tl_set:Nn \l_@@_number_arg_tl {##1}
+ \tl_set:Nn \l_@@_number_next_tl {##2}
+ \tl_set:Nn \l_@@_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 } }
+ \exp_after:wN \@@_tmp:w \l_@@_number_arg_tl \q_stop
+ \tl_if_empty:NT \l_@@_number_arg_tl
+ { \@@_error:n { starting-product-token } }
+ \tl_if_empty:NT \l_@@_number_next_tl
+ { \@@_error:n { ending-product-token } }
\tl_map_break:
}
}
@@ -6534,31 +6540,31 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_preprocess_quotient:}
-%\begin{macro}[aux]{\siunitx_number_preprocess_quotient_aux:N}
+%\begin{macro}{\@@_number_preprocess_quotient:}
+%\begin{macro}[aux]{\@@_number_preprocess_quotient_aux:N}
% For the quotient, only one token can appear in each part. So there
% is an additional error check.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_preprocess_quotient: {
- \tl_map_function:NN \l_siunitx_input_quotient_tl
- \siunitx_number_preprocess_quotient_aux:N
+\cs_new_protected:Npn \@@_number_preprocess_quotient: {
+ \tl_map_function:NN \l_@@_input_quotient_tl
+ \@@_number_preprocess_quotient_aux:N
}
-\cs_new_protected:Npn \siunitx_number_preprocess_quotient_aux:N #1 {
- \tl_if_in:NnT \l_siunitx_number_arg_tl {#1}
+\cs_new_protected:Npn \@@_number_preprocess_quotient_aux:N #1 {
+ \tl_if_in:NnT \l_@@_number_arg_tl {#1}
{
- \cs_set:Npn \siunitx_tmp:w ##1 #1 ##2 \q_stop
+ \cs_set:Npn \@@_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 }
+ \tl_set:Nn \l_@@_number_numerator_tl {##1}
+ \tl_set:Nn \l_@@_number_denominator_tl {##2}
+ \tl_set:Nn \l_@@_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 } }
+ \exp_after:wN \@@_tmp:w \l_@@_number_arg_tl \q_stop
+ \tl_if_empty:NT \l_@@_number_numerator_tl
+ { \@@_error:n { starting-quotient-token } }
+ \tl_if_empty:NT \l_@@_number_denominator_tl
+ { \@@_error:n { ending-quotient-token } }
+ \tl_if_in:NnT \l_@@_number_denominator_tl {#1}
+ { \@@_error:n { duplicate-quotient-token } }
\tl_map_break:
}
}
@@ -6574,132 +6580,132 @@ This work consists of the file siunitx.dtx
% quickly. For most documents, this gain more than offsets any slight
% losses with more complicated numbers.
%
-%\begin{macro}{\c_siunitx_number_part_complex_tl}
+%\begin{macro}{\c_@@_number_part_complex_tl}
% A couple of the comparisons needed for checking complex numbers
% are done using stored text. To make them a little quicker, a
% pre-stored version of the text is stored here.
% \begin{macrocode}
-\tl_new:N \c_siunitx_number_part_complex_tl
-\tl_set:Nn \c_siunitx_number_part_complex_tl { complex }
+\tl_new:N \c_@@_number_part_complex_tl
+\tl_set:Nn \c_@@_number_part_complex_tl { complex }
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_number_in_complex_bool ,
-% \l_siunitx_number_in_complex_root_bool ,
-% \l_siunitx_number_in_decimal_bool ,
-% \l_siunitx_number_in_exponent_bool ,
-% \l_siunitx_number_in_first_bool ,
-% \l_siunitx_number_in_sign_bool ,
-% \l_siunitx_number_in_uncert_bool ,
-% \l_siunitx_number_in_value_bool
+% \l_@@_number_in_complex_bool ,
+% \l_@@_number_in_complex_root_bool ,
+% \l_@@_number_in_decimal_bool ,
+% \l_@@_number_in_exponent_bool ,
+% \l_@@_number_in_first_bool ,
+% \l_@@_number_in_sign_bool ,
+% \l_@@_number_in_uncert_bool ,
+% \l_@@_number_in_value_bool
%}
% \begin{macrocode}
-\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
+\bool_new:N \l_@@_number_in_complex_bool
+\bool_new:N \l_@@_number_in_complex_root_bool
+\bool_new:N \l_@@_number_in_decimal_bool
+\bool_new:N \l_@@_number_in_exponent_bool
+\bool_new:N \l_@@_number_in_first_bool
+\bool_new:N \l_@@_number_in_sign_bool
+\bool_new:N \l_@@_number_in_uncert_bool
+\bool_new:N \l_@@_number_in_value_bool
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_in_prop}
+%\begin{macro}{\l_@@_number_in_prop}
% The parsed number is stored in a property list as its constituent
% parts.
% \begin{macrocode}
-\prop_new:N \l_siunitx_number_in_prop
+\prop_new:N \l_@@_number_in_prop
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_parsed_tl}
+%\begin{macro}{\l_@@_number_parsed_tl}
% Each part of the number parsed has to be built up in a token list.
% \begin{macrocode}
-\tl_new:N \l_siunitx_number_parsed_tl
+\tl_new:N \l_@@_number_parsed_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_number_part_tl ,
-% \l_siunitx_number_part_decimal_tl ,
-% \l_siunitx_number_part_decimal_marker_tl ,
-% \l_siunitx_number_part_integer_tl ,
-% \l_siunitx_number_part_sign_tl ,
-% \l_siunitx_number_part_uncert_tl
+% \l_@@_number_part_tl ,
+% \l_@@_number_part_decimal_tl ,
+% \l_@@_number_part_decimal_marker_tl ,
+% \l_@@_number_part_integer_tl ,
+% \l_@@_number_part_sign_tl ,
+% \l_@@_number_part_uncert_tl
%}
% The names of various parts of a number are set up as stored values.
% This lets some code be used for different parts of a number, while
% pre-storing everything brings a performance (and clarity) benefit.
% \begin{macrocode}
-\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
+\tl_new:N \l_@@_number_part_tl
+\tl_new:N \l_@@_number_part_decimal_tl
+\tl_new:N \l_@@_number_part_decimal_marker_tl
+\tl_new:N \l_@@_number_part_integer_tl
+\tl_new:N \l_@@_number_part_sign_tl
+\tl_new:N \l_@@_number_part_uncert_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_number_mantissa_length_int
-% \l_siunitx_number_uncert_tl
-% \l_siunitx_number_uncert_length_int
+% \l_@@_number_mantissa_length_int
+% \l_@@_number_uncert_tl
+% \l_@@_number_uncert_length_int
%}
% Conversion of uncertainty forms requires some storage, mainly for
% performance reasons.
% \begin{macrocode}
-\int_new:N \l_siunitx_number_mantissa_length_int
-\tl_new:N \l_siunitx_number_uncert_tl
-\int_new:N \l_siunitx_number_uncert_length_int
+\int_new:N \l_@@_number_mantissa_length_int
+\tl_new:N \l_@@_number_uncert_tl
+\int_new:N \l_@@_number_uncert_length_int
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_input_uncert_sign_tl}
+%\begin{macro}{\l_@@_input_uncert_sign_tl}
% This one is stored by some low-level code, so is declared explicitly.
% \begin{macrocode}
-\tl_new:N \l_siunitx_input_uncert_sign_tl
+\tl_new:N \l_@@_input_uncert_sign_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_input_uncert_close_tl ,
-% \l_siunitx_input_complex_tl ,
-% \l_siunitx_input_comparator_tl ,
-% \l_siunitx_input_decimal_tl ,
-% \l_siunitx_input_digit_tl ,
-% \l_siunitx_input_exponent_tl ,
-% \l_siunitx_input_ignore_tl ,
-% \l_siunitx_input_uncert_open_tl ,
-% \l_siunitx_input_protect_tl ,
-% \l_siunitx_input_sign_tl ,
-% \l_siunitx_input_symbol_tl ,
-% \l_siunitx_input_uncert_sign_tl
+% \l_@@_input_uncert_close_tl ,
+% \l_@@_input_complex_tl ,
+% \l_@@_input_comparator_tl ,
+% \l_@@_input_decimal_tl ,
+% \l_@@_input_digit_tl ,
+% \l_@@_input_exponent_tl ,
+% \l_@@_input_ignore_tl ,
+% \l_@@_input_uncert_open_tl ,
+% \l_@@_input_protect_tl ,
+% \l_@@_input_sign_tl ,
+% \l_@@_input_symbol_tl ,
+% \l_@@_input_uncert_sign_tl
%}
% The various tokens to check against when parsing are all set up here.
% These are valid inside a single number: the pre-processor has already
% set up the appropriate things for products and quotients.
% \begin{macrocode}
\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-comparators .tl_set:N = \l_siunitx_input_comparator_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 ,
+ input-close-uncertainty .tl_set:N = \l_@@_input_uncert_close_tl ,
+ input-complex-roots .tl_set:N = \l_@@_input_complex_tl ,
+ input-comparators .tl_set:N = \l_@@_input_comparator_tl ,
+ input-decimal-markers .tl_set:N = \l_@@_input_decimal_tl ,
+ input-digits .tl_set:N = \l_@@_input_digit_tl ,
+ input-exponent-markers .tl_set:N = \l_@@_input_exponent_tl ,
+ input-ignore .tl_set:N = \l_@@_input_ignore_tl ,
+ input-open-uncertainty .tl_set:N = \l_@@_input_uncert_open_tl ,
+ input-protect-tokens .tl_set:N = \l_@@_input_protect_tl ,
+ input-signs .tl_set:N = \l_@@_input_sign_tl ,
+ input-symbols .tl_set:N = \l_@@_input_symbol_tl ,
input-uncertainty-signs .code:n =
{
- \tl_set:Nn \l_siunitx_input_uncert_sign_tl {#1}
+ \tl_set:Nn \l_@@_input_uncert_sign_tl {#1}
\tl_map_inline:nn {#1}
{
- \tl_if_in:NnF \l_siunitx_input_sign_tl {##1}
- { \tl_put_right:Nn \l_siunitx_input_sign_tl {##1} }
+ \tl_if_in:NnF \l_@@_input_sign_tl {##1}
+ { \tl_put_right:Nn \l_@@_input_sign_tl {##1} }
}
} ,
}
@@ -6720,32 +6726,32 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_in_parse:n ,
-% \siunitx_number_in_parse:V
+% \@@_number_in_parse:n ,
+% \@@_number_in_parse:V
%}
-%\begin{macro}[aux]{\siunitx_number_in_parse_aux:n}
+%\begin{macro}[aux]{\@@_number_in_parse_aux:n}
% The parsing routine starts by replacing any formatting in the input
% using \cs{tl_set_rescan:Nnx}. Next, there is a quick routine to
% ensure that all signs are single tokens. The main loop then takes
% place, which will parse the input into the property list and also
% set up the flags. There are then some checks and possible corrections.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse:n #1 {
+\cs_new_protected:Npn \@@_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}
+ \@@_number_in_init:
+ \cs_set_eq:NN \@@_number_in_parse_more:N
+ \@@_number_in_parse_mantissa_aux:N
+ \@@_number_in_parse_aux:n {#1}
}
}
-\cs_generate_variant:Nn \siunitx_number_in_parse:n { V }
-\cs_new_protected:Npn \siunitx_number_in_parse_aux:n #1
+\cs_generate_variant:Nn \@@_number_in_parse:n { V }
+\cs_new_protected:Npn \@@_number_in_parse_aux:n #1
{
\group_begin:
- \siunitx_number_in_protect:
+ \@@_number_in_protect:
\cs_set_eq:NN \, \prg_do_nothing:
- \tl_set_rescan:Nnx \l_siunitx_number_arg_tl
+ \tl_set_rescan:Nnx \l_@@_number_arg_tl
{
\char_set_catcode_ignore:N \~
\char_set_catcode_other:N \,
@@ -6753,97 +6759,97 @@ This work consists of the file siunitx.dtx
}
{#1}
\exp_args:NNNV \group_end:
- \tl_set:Nn \l_siunitx_number_arg_tl \l_siunitx_number_arg_tl
- \siunitx_number_in_sign_replace:N \l_siunitx_number_arg_tl
- \siunitx_number_in_parse_relation: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
+ \tl_set:Nn \l_@@_number_arg_tl \l_@@_number_arg_tl
+ \@@_number_in_sign_replace:N \l_@@_number_arg_tl
+ \@@_number_in_parse_relation:N \l_@@_number_arg_tl
+ \tl_map_function:NN \l_@@_number_arg_tl
+ \@@_number_in_parse_loop:N
+ \tl_if_empty:NF \l_@@_number_parsed_tl
{
- \bool_if:NTF \l_siunitx_number_in_uncert_bool
- { \siunitx_error:nx { invalid-number } {#1} }
+ \bool_if:NTF \l_@@_number_in_uncert_bool
+ { \@@_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:NVn \l_@@_number_in_prop
+ \l_@@_number_part_tl { true }
+ \bool_if:NTF \l_@@_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_@@_number_in_prop
+ \l_@@_number_part_decimal_tl
+ \l_@@_number_parsed_tl
}
{
- \prop_put:NVV \l_siunitx_number_in_prop
- \l_siunitx_number_part_integer_tl
- \l_siunitx_number_parsed_tl
+ \prop_put:NVV \l_@@_number_in_prop
+ \l_@@_number_part_integer_tl
+ \l_@@_number_parsed_tl
}
}
}
- \siunitx_number_in_check:n {#1}
+ \@@_number_in_check:n {#1}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_in_init: ,
-% \siunitx_number_in_init_part:n
+% \@@_number_in_init: ,
+% \@@_number_in_init_part:n
%}
% The set up code is divided into to parts. First, code only needed
% once to start the entire parser. Then a second group, which is
% carried out at the start of each part of a number, and so is called
% from a few places.
% \begin{macrocode}
-\cs_new_protected: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_new_protected: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
+\cs_new_protected:Npn \@@_number_in_init: {
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_mantissa:N
+ \cs_set_eq:NN \@@_number_in_check:n
+ \@@_number_in_check_short:n
+ \tl_clear:N \l_@@_number_parsed_tl
+ \prop_clear:N \l_@@_number_in_prop
+ \bool_set_false:N \l_@@_error_bool
+ \bool_set_false:N \l_@@_number_in_complex_bool
+ \bool_set_false:N \l_@@_number_in_complex_root_bool
+ \bool_set_false:N \l_@@_number_in_exponent_bool
+ \bool_set_false:N \l_@@_number_in_uncert_bool
+ \@@_number_in_init_part:n { mantissa }
+}
+\cs_new_protected:Npn \@@_number_in_init_part:n #1 {
+ \bool_set_false:N \l_@@_number_in_decimal_bool
+ \bool_set_true:N \l_@@_number_in_first_bool
+ \bool_set_false:N \l_@@_number_in_sign_bool
+ \bool_set_false:N \l_@@_number_in_value_bool
+ \tl_set:Nn \l_@@_number_part_tl {#1}
+ \tl_set:Nn \l_@@_number_part_decimal_tl { #1 -decimal }
+ \tl_set:Nn \l_@@_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 }
+ \tl_set:Nn \l_@@_number_part_integer_tl { #1 -integer }
+ \tl_set:Nn \l_@@_number_part_sign_tl { #1 -sign }
+ \tl_set:Nn \l_@@_number_part_uncert_tl { #1 -uncertainty }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_protect:}
-%\begin{macro}[aux]{\siunitx_number_in_protect_aux:N}
+%\begin{macro}{\@@_number_in_protect:}
+%\begin{macro}[aux]{\@@_number_in_protect_aux:N}
% Under some circumstances (for example when loading \pkg{breqn})
% some tokens do not behave safely under \texttt{x} expansion (at the
% moment). To get round this, they are redefined here.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_protect: {
- \tl_map_function:NN \l_siunitx_input_protect_tl
- \siunitx_number_in_protect_aux:N
+\cs_new_protected:Npn \@@_number_in_protect: {
+ \tl_map_function:NN \l_@@_input_protect_tl
+ \@@_number_in_protect_aux:N
}
-\cs_new_protected:Npn \siunitx_number_in_protect_aux:N #1 {
+\cs_new_protected:Npn \@@_number_in_protect_aux:N #1 {
\cs_set_eq:NN #1 \scan_stop:
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_sign_replace:N}
+%\begin{macro}{\@@_number_in_sign_replace:N}
% A short spin-out to keep the replacement of tokens clear.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_sign_replace:N #1 {
+\cs_new_protected:Npn \@@_number_in_sign_replace:N #1 {
\tl_replace_all:Nnn #1 { -+ } { \mp }
\tl_replace_all:Nnn #1 { +- } { \pm }
\tl_replace_all:Nnn #1 { << } { \ll }
@@ -6855,48 +6861,48 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_in_parse_error:nn ,
-% \siunitx_number_in_parse_error:nV
+% \@@_number_in_parse_error:nn ,
+% \@@_number_in_parse_error:nV
%}
% There are lots of rather similar errors in the parser, all of which
% require a \cs{tl_map_break:}. To keep life simple, this is set up
% here.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse_error:nn #1#2 {
- \siunitx_error:nx {#1} { \exp_not:n {#2} }
+\cs_new_protected:Npn \@@_number_in_parse_error:nn #1#2 {
+ \@@_error:nx {#1} { \exp_not:n {#2} }
\tl_map_break:
}
-\cs_generate_variant:Nn \siunitx_number_in_parse_error:nn { nV }
+\cs_generate_variant:Nn \@@_number_in_parse_error:nn { nV }
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_in_parse_loop:N ,
-% \siunitx_number_in_parse_more:N
+% \@@_number_in_parse_loop:N ,
+% \@@_number_in_parse_more:N
%}
% The main loop is set up as a place holder, as the definition is
% varied to keep things fast. There is also a place holder for the
% extended routing for normal mantissas.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse_loop:N #1 { }
-\cs_new_protected:Npn \siunitx_number_in_parse_more:N #1 { }
+\cs_new_protected:Npn \@@_number_in_parse_loop:N #1 { }
+\cs_new_protected:Npn \@@_number_in_parse_more:N #1 { }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_parse_relation:N}
-%\begin{macro}[aux]{\siunitx_number_in_parse_relation:w}
+%\begin{macro}{\@@_number_in_parse_relation:N}
+%\begin{macro}[aux]{\@@_number_in_parse_relation:w}
% The idea here is that a relation with be the very first token in the
% input, or it is not valid. So the test for a relation can be very
% simple and hopefully efficient.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse_relation:N #1 {
- \exp_after:wN \siunitx_number_in_parse_relation:w #1 \q_stop #1
+\cs_new_protected:Npn \@@_number_in_parse_relation:N #1 {
+ \exp_after:wN \@@_number_in_parse_relation:w #1 \q_stop #1
}
-\cs_new_protected:Npn \siunitx_number_in_parse_relation:w
+\cs_new_protected:Npn \@@_number_in_parse_relation:w
#1#2 \q_stop #3 {
- \tl_if_in:NnT \l_siunitx_input_comparator_tl {#1}
+ \tl_if_in:NnT \l_@@_input_comparator_tl {#1}
{
- \prop_put:Nnn \l_siunitx_number_in_prop { comparator } {#1}
+ \prop_put:Nnn \l_@@_number_in_prop { comparator } {#1}
\tl_set:Nn #3 {#2}
}
}
@@ -6904,36 +6910,36 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_parse_restricted:N}
+%\begin{macro}{\@@_number_in_parse_restricted:N}
% When parsing numbers for the \cs{ang} function, no extended input
% is permitted at all.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse_restricted:N #1 {
- \tl_if_in:NnTF \l_siunitx_input_exponent_tl {#1}
+\cs_new_protected:Npn \@@_number_in_parse_restricted:N #1 {
+ \tl_if_in:NnTF \l_@@_input_exponent_tl {#1}
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ restricted-number } {#1}
}
{
- \tl_if_in:NnTF \l_siunitx_input_uncert_open_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_uncert_open_tl {#1}
{
- \siunitx_number_in_parse_error:nV
- { restricted-number } \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV
+ { restricted-number } \l_@@_number_arg_tl
}
{
- \tl_if_in:NnTF \l_siunitx_input_uncert_close_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_uncert_close_tl {#1}
{
- \siunitx_number_in_parse_error:nV
- { restricted-number } \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV
+ { restricted-number } \l_@@_number_arg_tl
}
{
- \tl_if_in:NnTF \l_siunitx_input_complex_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_complex_tl {#1}
{
- \siunitx_number_in_parse_error:nV
- { restricted-number } \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV
+ { restricted-number } \l_@@_number_arg_tl
}
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ restricted-number } {#1}
}
}
@@ -6943,62 +6949,62 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_parse_complex:N}
+%\begin{macro}{\@@_number_in_parse_complex:N}
% After a complex root when the root is \emph{after} the number, there
% are a very limited range of legitimate tokens. Thus most cases can be
% trapped with a modified parser.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse_complex:N #1 {
- \tl_if_in:NnTF \l_siunitx_input_exponent_tl {#1}
+\cs_new_protected:Npn \@@_number_in_parse_complex:N #1 {
+ \tl_if_in:NnTF \l_@@_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
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_mantissa:N
+ \@@_number_in_exponent:N #1
}
{
- \tl_if_in:NnF \l_siunitx_input_ignore_tl {#1}
+ \tl_if_in:NnF \l_@@_input_ignore_tl {#1}
{
- \siunitx_number_in_parse_error:nV
+ \@@_number_in_parse_error:nV
{ misplaced-complex-root-token }
- \l_siunitx_number_arg_tl
+ \l_@@_number_arg_tl
}
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_parse_exponent:N}
+%\begin{macro}{\@@_number_in_parse_exponent:N}
% When processing an exponent, the \enquote{extended} part of the
% number which is valid in a mantissa is no longer needed. So the
% auxiliary function is pointed to a series of errors instead.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse_exponent:N #1 {
- \tl_if_in:NnTF \l_siunitx_input_exponent_tl {#1}
+\cs_new_protected:Npn \@@_number_in_parse_exponent:N #1 {
+ \tl_if_in:NnTF \l_@@_input_exponent_tl {#1}
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ duplicate-exponent-token } { \token_to_str:N #1 }
}
{
- \tl_if_in:NnTF \l_siunitx_input_uncert_open_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_uncert_open_tl {#1}
{
- \siunitx_number_in_parse_error:nV
- { invalid-token-in-exponent } \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV
+ { invalid-token-in-exponent } \l_@@_number_arg_tl
}
{
- \tl_if_in:NnTF \l_siunitx_input_uncert_close_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_uncert_close_tl {#1}
{
- \siunitx_number_in_parse_error:nV
- { invalid-token-in-exponent } \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV
+ { invalid-token-in-exponent } \l_@@_number_arg_tl
}
{
- \tl_if_in:NnTF \l_siunitx_input_complex_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_complex_tl {#1}
{
- \siunitx_number_in_parse_error:nV
+ \@@_number_in_parse_error:nV
{ invalid-token-in-exponent }
- \l_siunitx_number_arg_tl
+ \l_@@_number_arg_tl
}
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ invalid-token-in-number } {#1}
}
}
@@ -7008,55 +7014,55 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_parse_mantissa:N}
-%\begin{macro}[aux]{\siunitx_number_in_parse_mantissa_aux:N}
+%\begin{macro}{\@@_number_in_parse_mantissa:N}
+%\begin{macro}[aux]{\@@_number_in_parse_mantissa_aux:N}
% For the mantissa, most things are valid. The procedure is split
% into two parts, with the simple symbols handled here and the more
% complex ones in a second part(which needs to be varied). Essentially
% everything here is a comparison, done so that the code is a fast as
% possible.
% \begin{macrocode}
-\cs_new_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} }
+\cs_new_protected:Npn \@@_number_in_parse_mantissa:N #1 {
+ \tl_if_in:NnTF \l_@@_input_digit_tl {#1}
+ { \@@_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_@@_input_decimal_tl {#1}
+ { \@@_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_@@_input_sign_tl {#1}
+ { \@@_number_in_sign:N #1 }
{
- \tl_if_in:NnTF \l_siunitx_input_symbol_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_symbol_tl {#1}
{
- \prop_put:Nnn \l_siunitx_number_in_prop { symbolic }
+ \prop_put:Nnn \l_@@_number_in_prop { symbolic }
{ true }
- \siunitx_number_in_digit:n { \ensuremath {#1} }
+ \@@_number_in_digit:n { \ensuremath {#1} }
}
{
- \tl_if_in:NnF \l_siunitx_input_ignore_tl {#1}
- { \siunitx_number_in_parse_more:N #1 }
+ \tl_if_in:NnF \l_@@_input_ignore_tl {#1}
+ { \@@_number_in_parse_more:N #1 }
}
}
}
}
}
-\cs_new_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 }
+\cs_new_protected:Npn \@@_number_in_parse_mantissa_aux:N #1 {
+ \tl_if_in:NnTF \l_@@_input_exponent_tl {#1}
+ { \@@_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_@@_input_uncert_open_tl {#1}
+ { \@@_number_in_uncert_open:N #1 }
{
- \tl_if_in:NnTF \l_siunitx_input_uncert_close_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_uncert_close_tl {#1}
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ misplaced-uncertainty-token } {#1}
}
{
- \tl_if_in:NnTF \l_siunitx_input_complex_tl {#1}
- { \siunitx_number_in_complex:N #1 }
+ \tl_if_in:NnTF \l_@@_input_complex_tl {#1}
+ { \@@_number_in_complex:N #1 }
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ invalid-token-in-number } {#1}
}
}
@@ -7067,44 +7073,44 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_parse_uncert:N}
+%\begin{macro}{\@@_number_in_parse_uncert:N}
% Within uncertainties, the range of tokens is limited. An alternative
% parsing system can therefore be used.
% \begin{macrocode}
-\cs_new_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} }
+\cs_new_protected:Npn \@@_number_in_parse_uncert:N #1 {
+ \tl_if_in:NnTF \l_@@_input_digit_tl {#1}
+ { \@@_number_in_digit:n {#1} }
{
- \tl_if_in:NnTF \l_siunitx_input_decimal_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_decimal_tl {#1}
{
- \siunitx_number_in_parse_error:nV
+ \@@_number_in_parse_error:nV
{ invalid-token-in-uncertainty }
- \l_siunitx_number_arg_tl
+ \l_@@_number_arg_tl
}
{
- \tl_if_in:NnTF \l_siunitx_input_sign_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_sign_tl {#1}
{
- \siunitx_number_in_parse_error:nV
+ \@@_number_in_parse_error:nV
{ invalid-token-in-uncertainty }
- \l_siunitx_number_arg_tl
+ \l_@@_number_arg_tl
}
{
- \tl_if_in:NnTF \l_siunitx_input_symbol_tl {#1}
+ \tl_if_in:NnTF \l_@@_input_symbol_tl {#1}
{
- \prop_put:Nnn \l_siunitx_number_in_prop { symbolic }
+ \prop_put:Nnn \l_@@_number_in_prop { symbolic }
{ true }
- \siunitx_number_in_digit:n {#1}
+ \@@_number_in_digit:n {#1}
}
{
- \tl_if_in:NnF \l_siunitx_input_ignore_tl {#1}
+ \tl_if_in:NnF \l_@@_input_ignore_tl {#1}
{
- \tl_if_in:NnTF \l_siunitx_input_uncert_close_tl
+ \tl_if_in:NnTF \l_@@_input_uncert_close_tl
{#1}
- { \siunitx_number_in_uncert_close:N #1 }
+ { \@@_number_in_uncert_close:N #1 }
{
- \siunitx_number_in_parse_error:nV
+ \@@_number_in_parse_error:nV
{ invalid-token-in-uncertainty }
- \l_siunitx_number_arg_tl
+ \l_@@_number_arg_tl
}
}
}
@@ -7115,36 +7121,36 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_parse_uncert_after:N}
+%\begin{macro}{\@@_number_in_parse_uncert_after:N}
% After an uncertainty, there is once again a very limited range of
% tokens that can be present in a valid number.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_parse_uncert_after:N #1 {
- \tl_if_in:NnTF \l_siunitx_input_exponent_tl {#1}
+\cs_new_protected:Npn \@@_number_in_parse_uncert_after:N #1 {
+ \tl_if_in:NnTF \l_@@_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
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_mantissa:N
+ \@@_number_in_exponent:N #1
}
{
- \tl_if_in:NnTF \l_siunitx_input_sign_tl {#1}
+ \tl_if_in:NnTF \l_@@_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
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_mantissa:N
+ \@@_number_in_sign:N #1
}
{
- \tl_if_in:NnF \l_siunitx_input_ignore_tl {#1}
+ \tl_if_in:NnF \l_@@_input_ignore_tl {#1}
{
- \tl_if_in:NnTF \l_siunitx_input_complex_tl {#1}
+ \tl_if_in:NnTF \l_@@_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
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_mantissa:N
+ \@@_number_in_complex:N #1
}
{
- \siunitx_number_in_parse_error:nV { invalid-number }
- \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV { invalid-number }
+ \l_@@_number_arg_tl
}
}
}
@@ -7153,8 +7159,8 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_complex:N}
-%\begin{macro}[aux]{\siunitx_number_in_complex_aux:nn}
+%\begin{macro}{\@@_number_in_complex:N}
+%\begin{macro}[aux]{\@@_number_in_complex_aux:nn}
% Only one complex root token can be give, hence the initial test.
% More tests are needed for complex numbers than other systems, so
% the additional ones are turned on, followed by some flag setting.
@@ -7162,199 +7168,199 @@ This work consists of the file siunitx.dtx
% root is at the end of the number: if it is, prevent any more tokens
% being added.
% \begin{macrocode}
-\cs_new_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
+\cs_new_protected:Npn \@@_number_in_complex:N #1 {
+ \bool_set_false:N \l_@@_number_in_first_bool
+ \bool_if:NTF \l_@@_number_in_complex_root_bool
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ 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 \@@_number_in_check:n
+ \@@_number_in_check_full:n
+ \bool_set_true:N \l_@@_number_in_complex_root_bool
+ \prop_put:Nnn \l_@@_number_in_prop { complex-root } {#1}
+ \tl_if_empty:NF \l_@@_number_parsed_tl
{
- \cs_set_eq:NN \siunitx_number_in_parse_loop:N
- \siunitx_number_in_parse_complex:N
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_complex:N
}
- \bool_if:NT \l_siunitx_number_in_decimal_bool
+ \bool_if:NT \l_@@_number_in_decimal_bool
{
- \bool_if:NF \l_siunitx_number_in_complex_bool
+ \bool_if:NF \l_@@_number_in_complex_bool
{
- \prop_if_in:NnT \l_siunitx_number_in_prop
+ \prop_if_in:NnT \l_@@_number_in_prop
{ mantissa-uncertainty }
{
- \siunitx_number_in_complex_aux:nn
+ \@@_number_in_complex_aux:nn
{ mantissa-decimal } { complex-decimal }
- \siunitx_number_in_complex_aux:nn
+ \@@_number_in_complex_aux:nn
{ mantissa-uncertainty } { complex-uncertainty }
}
- \siunitx_number_in_complex_aux:nn { mantissa-integer }
+ \@@_number_in_complex_aux:nn { mantissa-integer }
{ complex-integer }
- \siunitx_number_in_complex_aux:nn
+ \@@_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 }
+ \prop_del:Nn \l_@@_number_in_prop { mantissa }
+ \prop_put:Nnn \l_@@_number_in_prop { complex }
{ true }
}
}
- \prop_if_in:NnF \l_siunitx_number_in_prop { mantissa }
+ \prop_if_in:NnF \l_@@_number_in_prop { mantissa }
{
- \prop_if_in:NnT \l_siunitx_number_in_prop { mantissa-sign }
+ \prop_if_in:NnT \l_@@_number_in_prop { mantissa-sign }
{
- \siunitx_number_in_complex_aux:nn { mantissa-sign }
+ \@@_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
+ \bool_set_true:N \l_@@_number_in_complex_bool
+ \bool_set_false:N \l_@@_number_in_first_bool
+ \@@_number_in_init_part:n { complex }
+ \prop_if_in:NnT \l_@@_number_in_prop
{ complex-decimal-marker }
- { \bool_set_true:N \l_siunitx_number_in_decimal_bool }
- \prop_if_in:NnTF \l_siunitx_number_in_prop
+ { \bool_set_true:N \l_@@_number_in_decimal_bool }
+ \prop_if_in:NnTF \l_@@_number_in_prop
{ complex-sign }
- { \bool_set_true:N \l_siunitx_number_in_sign_bool }
- { \prop_del:Nn \l_siunitx_number_in_prop { mantissa } }
+ { \bool_set_true:N \l_@@_number_in_sign_bool }
+ { \prop_del:Nn \l_@@_number_in_prop { mantissa } }
}
}
-\cs_new_protected:Npn \siunitx_number_in_complex_aux:nn #1#2 {
- \prop_get:NnNT \l_siunitx_number_in_prop {#1} \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_in_complex_aux:nn #1#2 {
+ \prop_get:NnNT \l_@@_number_in_prop {#1} \l_@@_tmpa_tl
{
- \prop_del:Nn \l_siunitx_number_in_prop {#1}
- \prop_put:NnV \l_siunitx_number_in_prop {#2} \l_siunitx_tmpa_tl
+ \prop_del:Nn \l_@@_number_in_prop {#1}
+ \prop_put:NnV \l_@@_number_in_prop {#2} \l_@@_tmpa_tl
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_decimal:N}
+%\begin{macro}{\@@_number_in_decimal:N}
% Only one decimal marker allowed, so a test for this. If an integer
% part has been found, it is saved. The flag for the number being
% found is not set unless there is an integer, to watch for the case
% of invalid numbers.
% \begin{macrocode}
-\cs_new_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
+\cs_new_protected:Npn \@@_number_in_decimal:N #1 {
+ \bool_set_false:N \l_@@_number_in_first_bool
+ \bool_if:NTF \l_@@_number_in_decimal_bool
{
- \siunitx_number_in_parse_error:nn { duplicate-decimal-token }
+ \@@_number_in_parse_error:nn { duplicate-decimal-token }
{#1}
}
{
- \bool_set_true:N \l_siunitx_number_in_decimal_bool
- \tl_if_empty:NF \l_siunitx_number_parsed_tl
+ \bool_set_true:N \l_@@_number_in_decimal_bool
+ \tl_if_empty:NF \l_@@_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_@@_number_in_prop
+ \l_@@_number_part_tl { true }
+ \prop_put:NVV \l_@@_number_in_prop
+ \l_@@_number_part_integer_tl
+ \l_@@_number_parsed_tl
+ \tl_clear:N \l_@@_number_parsed_tl
}
- \prop_put:NVn \l_siunitx_number_in_prop
- \l_siunitx_number_part_decimal_marker_tl {#1}
+ \prop_put:NVn \l_@@_number_in_prop
+ \l_@@_number_part_decimal_marker_tl {#1}
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_digit:n}
+%\begin{macro}{\@@_number_in_digit:n}
% For digits, only in an uncertainty can the value be stored
% directly. Otherwise, there is a need to see if the value is non-zero.
% This is used to drop leading zeros and to validate any sign (as zero
% is unsigned).
% \begin{macrocode}
-\cs_new_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} }
+\cs_new_protected:Npn \@@_number_in_digit:n #1 {
+ \bool_set_false:N \l_@@_number_in_first_bool
+ \bool_if:NTF \l_@@_number_in_uncert_bool
+ { \tl_put_right:Nn \l_@@_number_parsed_tl {#1} }
{
- \bool_if:NTF \l_siunitx_number_in_decimal_bool
+ \bool_if:NTF \l_@@_number_in_decimal_bool
{
- \tl_put_right:Nn \l_siunitx_number_parsed_tl {#1}
+ \tl_put_right:Nn \l_@@_number_parsed_tl {#1}
\str_if_eq:nnF {#1} { 0 }
- { \bool_set_true:N \l_siunitx_number_in_value_bool }
+ { \bool_set_true:N \l_@@_number_in_value_bool }
}
{
\str_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 }
+ \prop_put:NVn \l_@@_number_in_prop
+ \l_@@_number_part_tl { true }
+ \prop_put:NVn \l_@@_number_in_prop
+ \l_@@_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} }
+ { \bool_set_true:N \l_@@_number_in_value_bool }
+ \bool_if:NT \l_@@_number_in_value_bool
+ { \tl_put_right:Nn \l_@@_number_parsed_tl {#1} }
}
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_exponent:N}
+%\begin{macro}{\@@_number_in_exponent:N}
% A duplicate token test starts off the code, which if passed
% leads to some simple storage manipulation. As exponents are
% more simple than the mantissa, the extra processing is swapped for
% some that only raises errors.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_exponent:N #1 {
- \bool_if:NTF \l_siunitx_number_in_exponent_bool
+\cs_new_protected:Npn \@@_number_in_exponent:N #1 {
+ \bool_if:NTF \l_@@_number_in_exponent_bool
{
- \siunitx_number_in_parse_error:nn { duplicate-exponent-token }
+ \@@_number_in_parse_error:nn { 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_eq:NN \@@_number_in_parse_more:N
+ \@@_number_in_parse_exponent:N
+ \tl_if_empty:NF \l_@@_number_parsed_tl
+ { \@@_number_in_store: }
+ \bool_set_true:N \l_@@_number_in_exponent_bool
+ \@@_number_in_init_part:n { exponent }
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_sign:N}
+%\begin{macro}{\@@_number_in_sign:N}
% The code for signs is complicated by complex numbers. A sign token
% must be the fist thing in a number, but after the real part of the
% mantissa a second sign token can appear to start a complex number.
% So most of the code here is to detect that case.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_sign:N #1 {
- \bool_if:NTF \l_siunitx_number_in_first_bool
+\cs_new_protected:Npn \@@_number_in_sign:N #1 {
+ \bool_if:NTF \l_@@_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_set_false:N \l_@@_number_in_first_bool
+ \bool_set_true:N \l_@@_number_in_sign_bool
+ \prop_put:NVn \l_@@_number_in_prop
+ \l_@@_number_part_sign_tl {#1}
}
{
- \bool_if:NTF \l_siunitx_number_in_exponent_bool
+ \bool_if:NTF \l_@@_number_in_exponent_bool
{
- \siunitx_number_in_parse_error:nn { misplaced-sign-token }
+ \@@_number_in_parse_error:nn { misplaced-sign-token }
{#1}
}
{
- \bool_if:NTF \l_siunitx_number_in_complex_bool
+ \bool_if:NTF \l_@@_number_in_complex_bool
{
- \siunitx_number_in_parse_error:nn
+ \@@_number_in_parse_error:nn
{ 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
+ \tl_if_empty:NF \l_@@_number_parsed_tl
+ { \@@_number_in_store: }
+ \cs_set_eq:NN \@@_number_in_check:n
+ \@@_number_in_check_full:n
+ \@@_number_in_init_part:n { complex }
+ \prop_put:Nnn \l_@@_number_in_prop
{ complex-sign } {#1}
- \bool_set_true:N \l_siunitx_number_in_complex_bool
+ \bool_set_true:N \l_@@_number_in_complex_bool
}
}
}
@@ -7363,8 +7369,8 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_in_uncert_open:N ,
-% \siunitx_number_in_uncert_close:N
+% \@@_number_in_uncert_open:N ,
+% \@@_number_in_uncert_close:N
%}
% Opening and closing uncertainty tokens are handled separately. For
% opening tokens, a check is made that there is something else to the
@@ -7372,67 +7378,67 @@ This work consists of the file siunitx.dtx
% uncertainty must contain some numbers. A special loop function is then
% set up to prevent any additional digits after the closing token.
% \begin{macrocode}
-\cs_new_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
+\cs_new_protected:Npn \@@_number_in_uncert_open:N #1 {
+ \bool_set_false:N \l_@@_number_in_first_bool
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_uncert:N
+ \bool_set_true:N \l_@@_number_in_uncert_bool
+ \tl_if_empty:NTF \l_@@_number_parsed_tl
{
- \prop_if_in:NVF \l_siunitx_number_in_prop
- \l_siunitx_number_part_integer_tl
+ \prop_if_in:NVF \l_@@_number_in_prop
+ \l_@@_number_part_integer_tl
{
- \siunitx_number_in_parse_error:nV { invalid-number }
- \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV { invalid-number }
+ \l_@@_number_arg_tl
}
}
- { \siunitx_number_in_store: }
+ { \@@_number_in_store: }
}
-\cs_new_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
+\cs_new_protected:Npn \@@_number_in_uncert_close:N #1 {
+ \bool_set_false:N \l_@@_number_in_uncert_bool
+ \tl_if_empty:NTF \l_@@_number_parsed_tl
{
- \siunitx_number_in_parse_error:nV { empty-uncertainty }
- \l_siunitx_number_arg_tl
+ \@@_number_in_parse_error:nV { empty-uncertainty }
+ \l_@@_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
+ \prop_put:NVV \l_@@_number_in_prop
+ \l_@@_number_part_uncert_tl \l_@@_number_parsed_tl
+ \prop_put:Nnn \l_@@_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
+ \tl_clear:N \l_@@_number_parsed_tl
+ \cs_set_eq:NN \@@_number_in_parse_loop:N
+ \@@_number_in_parse_uncert_after:N
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_in_store:}
+%\begin{macro}{\@@_number_in_store:}
% A short auxiliary function needed in various places for storing
% either the integer or decimal part of a number, as appropriate.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_store: {
- \prop_put:NVn \l_siunitx_number_in_prop \l_siunitx_number_part_tl
+\cs_new_protected:Npn \@@_number_in_store: {
+ \prop_put:NVn \l_@@_number_in_prop \l_@@_number_part_tl
{ true }
- \bool_if:NTF \l_siunitx_number_in_decimal_bool
+ \bool_if:NTF \l_@@_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_@@_number_in_prop
+ \l_@@_number_part_decimal_tl \l_@@_number_parsed_tl
}
{
- \prop_put:NVV \l_siunitx_number_in_prop
- \l_siunitx_number_part_integer_tl \l_siunitx_number_parsed_tl
+ \prop_put:NVV \l_@@_number_in_prop
+ \l_@@_number_part_integer_tl \l_@@_number_parsed_tl
}
- \tl_clear:N \l_siunitx_number_parsed_tl
+ \tl_clear:N \l_@@_number_parsed_tl
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_in_check:n ,
-% \siunitx_number_in_check_short:n ,
-% \siunitx_number_in_check_full:n
+% \@@_number_in_check:n ,
+% \@@_number_in_check_short:n ,
+% \@@_number_in_check_full:n
%}
% The checks needed for a number depend on whether there is a complex
% part. In all cases, there must be some digits, as well as a sign or
@@ -7440,63 +7446,63 @@ This work consists of the file siunitx.dtx
% has any sign deleted. For complex numbers, the check is needed in
% case there was no real part.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_check:n #1 { }
-\cs_new_protected:Npn \siunitx_number_in_check_short:n #1 {
- \prop_if_in:NVF \l_siunitx_number_in_prop
- \l_siunitx_number_part_integer_tl
+\cs_new_protected:Npn \@@_number_in_check:n #1 { }
+\cs_new_protected:Npn \@@_number_in_check_short:n #1 {
+ \prop_if_in:NVF \l_@@_number_in_prop
+ \l_@@_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} }
+ \prop_if_in:NVF \l_@@_number_in_prop
+ \l_@@_number_part_decimal_tl
+ { \@@_error:nx { invalid-number } {#1} }
}
- \bool_if:NF \l_siunitx_number_in_value_bool
+ \bool_if:NF \l_@@_number_in_value_bool
{
- \tl_if_eq:NNF \l_siunitx_number_part_tl
- \c_siunitx_number_part_complex_tl
+ \tl_if_eq:NNF \l_@@_number_part_tl
+ \c_@@_number_part_complex_tl
{
- \prop_get:NVNT \l_siunitx_number_in_prop
- \l_siunitx_number_part_sign_tl \l_siunitx_tmpa_tl
+ \prop_get:NVNT \l_@@_number_in_prop
+ \l_@@_number_part_sign_tl \l_@@_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
+ \tl_set:Nx \l_@@_tmpb_tl
+ { \l_@@_number_part_sign_tl -deleted }
+ \prop_put:NVV \l_@@_number_in_prop
+ \l_@@_tmpb_tl \l_@@_tmpa_tl
}
- \prop_del:NV \l_siunitx_number_in_prop
- \l_siunitx_number_part_sign_tl
+ \prop_del:NV \l_@@_number_in_prop
+ \l_@@_number_part_sign_tl
}
}
}
-\cs_new_protected: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
+\cs_new_protected:Npn \@@_number_in_check_full:n #1 {
+ \tl_if_eq:NNF \l_@@_number_part_tl
+ \c_@@_number_part_complex_tl
+ { \@@_number_in_check_short:n {#1} }
+ \bool_if:NF \l_@@_number_in_complex_root_bool
{
- \prop_get:NnN \l_siunitx_number_in_prop { complex-sign }
- \l_siunitx_tmpa_tl
- \tl_if_in:NVTF \l_siunitx_input_uncert_sign_tl \l_siunitx_tmpa_tl
+ \prop_get:NnN \l_@@_number_in_prop { complex-sign }
+ \l_@@_tmpa_tl
+ \tl_if_in:NVTF \l_@@_input_uncert_sign_tl \l_@@_tmpa_tl
{
- \prop_if_in:NnTF \l_siunitx_number_in_prop { uncertainty }
+ \prop_if_in:NnTF \l_@@_number_in_prop { uncertainty }
{
- \siunitx_error:nx { misplaced-sign-token }
+ \@@_error:nx { misplaced-sign-token }
{ \exp_not:n {#1} }
}
- { \siunitx_number_in_complex_to_uncert:n {#1} }
+ { \@@_number_in_complex_to_uncert:n {#1} }
}
{
- \siunitx_error:nx { misplaced-sign-token }
+ \@@_error:nx { misplaced-sign-token }
{ \exp_not:n {#1} }
}
}
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-sign }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-sign }
+ \l_@@_tmpa_tl
{
- \prop_if_in:NnF \l_siunitx_number_in_prop { mantissa }
+ \prop_if_in:NnF \l_@@_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
+ \prop_del:Nn \l_@@_number_in_prop { mantissa-sign }
+ \prop_put:NnV \l_@@_number_in_prop { complex-sign }
+ \l_@@_tmpa_tl
}
}
}
@@ -7504,10 +7510,10 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%
-%\begin{macro}{\siunitx_number_in_complex_to_uncert:n}
+%\begin{macro}{\@@_number_in_complex_to_uncert:n}
%\begin{macro}[aux]{
-% \siunitx_number_in_complex_to_uncert_int: ,
-% \siunitx_number_in_complex_to_uncert_dec:
+% \@@_number_in_complex_to_uncert_int: ,
+% \@@_number_in_complex_to_uncert_dec:
%}
% Internally, uncertainties are stored in \enquote{compact} form.
% The code here takes a putative complex part and converts it to
@@ -7515,75 +7521,75 @@ This work consists of the file siunitx.dtx
% wrong. The method needed depends on whether there is an integer
% part.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_complex_to_uncert:n #1 {
- \prop_del:Nn \l_siunitx_number_in_prop { complex }
- \prop_del:Nn \l_siunitx_number_in_prop { complex-decimal-marker }
- \prop_del:Nn \l_siunitx_number_in_prop { complex-sign }
- \prop_put:Nnn \l_siunitx_number_in_prop { uncertainty } { true }
- \prop_get:NnNTF \l_siunitx_number_in_prop { complex-integer }
- \l_siunitx_number_uncert_tl
+\cs_new_protected:Npn \@@_number_in_complex_to_uncert:n #1 {
+ \prop_del:Nn \l_@@_number_in_prop { complex }
+ \prop_del:Nn \l_@@_number_in_prop { complex-decimal-marker }
+ \prop_del:Nn \l_@@_number_in_prop { complex-sign }
+ \prop_put:Nnn \l_@@_number_in_prop { uncertainty } { true }
+ \prop_get:NnNTF \l_@@_number_in_prop { complex-integer }
+ \l_@@_number_uncert_tl
{
- \tl_if_single:NTF \l_siunitx_number_uncert_tl
+ \tl_if_single:NTF \l_@@_number_uncert_tl
{
\int_compare:nNnTF
- { \l_siunitx_number_uncert_tl } = { \c_zero }
- { \siunitx_number_in_complex_to_uncert_dec:n {#1} }
- { \siunitx_number_in_complex_to_uncert_int: }
+ { \l_@@_number_uncert_tl } = { \c_zero }
+ { \@@_number_in_complex_to_uncert_dec:n {#1} }
+ { \@@_number_in_complex_to_uncert_int: }
}
- { \siunitx_number_in_complex_to_uncert_int: }
+ { \@@_number_in_complex_to_uncert_int: }
}
- { \siunitx_number_in_complex_to_uncert_dec:n {#1} }
- \prop_del:Nn \l_siunitx_number_in_prop { complex-integer }
- \prop_del:Nn \l_siunitx_number_in_prop { complex-decimal }
+ { \@@_number_in_complex_to_uncert_dec:n {#1} }
+ \prop_del:Nn \l_@@_number_in_prop { complex-integer }
+ \prop_del:Nn \l_@@_number_in_prop { complex-decimal }
}
% \end{macrocode}
% When the input has an integer part to the uncertainty, the
% conversion is easy as all of the decimal part can be copied
% across.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_complex_to_uncert_int: {
- \prop_get:NnNF \l_siunitx_number_in_prop { complex-decimal }
- \l_siunitx_tmpa_tl
- { \tl_clear:N \l_siunitx_tmpa_tl }
- \prop_get:NnNF \l_siunitx_number_in_prop { mantissa-decimal }
- \l_siunitx_tmpb_tl
- { \tl_clear:N \l_siunitx_tmpb_tl }
- \siunitx_number_in_complex_to_uncert_pad:
+\cs_new_protected:Npn \@@_number_in_complex_to_uncert_int: {
+ \prop_get:NnNF \l_@@_number_in_prop { complex-decimal }
+ \l_@@_tmpa_tl
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \prop_get:NnNF \l_@@_number_in_prop { mantissa-decimal }
+ \l_@@_tmpb_tl
+ { \tl_clear:N \l_@@_tmpb_tl }
+ \@@_number_in_complex_to_uncert_pad:
}
% \end{macrocode}
% For a number in which all of the uncertainty is in the decimal part,
% only the significant digits are needed. This means that a loop is
% needed to drop non-significant ones.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_complex_to_uncert_dec:n
+\cs_new_protected:Npn \@@_number_in_complex_to_uncert_dec:n
#1
{
- \tl_clear:N \l_siunitx_number_uncert_tl
- \prop_get:NnNTF \l_siunitx_number_in_prop { complex-decimal }
- \l_siunitx_tmpa_tl
+ \tl_clear:N \l_@@_number_uncert_tl
+ \prop_get:NnNTF \l_@@_number_in_prop { complex-decimal }
+ \l_@@_tmpa_tl
{
- \prop_get:NnN \l_siunitx_number_in_prop { mantissa-decimal }
- \l_siunitx_tmpb_tl
- \quark_if_no_value:NT \l_siunitx_tmpb_tl
- { \tl_clear:N \l_siunitx_tmpb_tl }
+ \prop_get:NnN \l_@@_number_in_prop { mantissa-decimal }
+ \l_@@_tmpb_tl
+ \quark_if_no_value:NT \l_@@_tmpb_tl
+ { \tl_clear:N \l_@@_tmpb_tl }
\tl_map_function:NN
- \l_siunitx_tmpa_tl
- \siunitx_number_in_complex_to_uncert_dec_loop:N
- \siunitx_number_in_complex_to_uncert_pad:
+ \l_@@_tmpa_tl
+ \@@_number_in_complex_to_uncert_dec_loop:N
+ \@@_number_in_complex_to_uncert_pad:
}
- { \siunitx_error:nx { misplaced-sign-token } { \exp_not:n {#1} } }
+ { \@@_error:nx { misplaced-sign-token } { \exp_not:n {#1} } }
}
\cs_new_protected:Npn
- \siunitx_number_in_complex_to_uncert_dec_loop:N #1
+ \@@_number_in_complex_to_uncert_dec_loop:N #1
{
\str_if_eq:nnTF {#1} { 0 }
{
- \tl_set:Nf \l_siunitx_tmpa_tl
- { \tl_tail:V \l_siunitx_tmpa_tl }
- \tl_if_empty:NF \l_siunitx_tmpb_tl
+ \tl_set:Nf \l_@@_tmpa_tl
+ { \tl_tail:V \l_@@_tmpa_tl }
+ \tl_if_empty:NF \l_@@_tmpb_tl
{
- \tl_set:Nf \l_siunitx_tmpb_tl
- { \tl_tail:V \l_siunitx_tmpb_tl }
+ \tl_set:Nf \l_@@_tmpb_tl
+ { \tl_tail:V \l_@@_tmpb_tl }
}
}
{ \tl_map_break: }
@@ -7595,56 +7601,56 @@ This work consists of the file siunitx.dtx
% also re-obtains the decimal part from the mantissa, as the stored
% value may have been trimmed to drop non-significant zeros.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_in_complex_to_uncert_pad:
+\cs_new_protected:Npn \@@_number_in_complex_to_uncert_pad:
{
- \int_set:Nn \l_siunitx_number_uncert_length_int
- { \tl_length:N \l_siunitx_tmpa_tl }
- \int_set:Nn \l_siunitx_number_mantissa_length_int
- { \tl_length:N \l_siunitx_tmpb_tl }
+ \int_set:Nn \l_@@_number_uncert_length_int
+ { \tl_length:N \l_@@_tmpa_tl }
+ \int_set:Nn \l_@@_number_mantissa_length_int
+ { \tl_length:N \l_@@_tmpb_tl }
\int_compare:nNnTF
- { \l_siunitx_number_mantissa_length_int }
- > { \l_siunitx_number_uncert_length_int }
+ { \l_@@_number_mantissa_length_int }
+ > { \l_@@_number_uncert_length_int }
{
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
{
- \exp_not:V \l_siunitx_tmpa_tl
+ \exp_not:V \l_@@_tmpa_tl
\prg_replicate:nn
{
- \l_siunitx_number_mantissa_length_int
- - \l_siunitx_number_uncert_length_int
+ \l_@@_number_mantissa_length_int
+ - \l_@@_number_uncert_length_int
}
{ 0 }
}
}
{
- \prop_get:NnNF \l_siunitx_number_in_prop { mantissa-decimal }
- \l_siunitx_tmpb_tl
- { \tl_clear:N \l_siunitx_tmpb_tl }
- \tl_set:Nx \l_siunitx_tmpb_tl
+ \prop_get:NnNF \l_@@_number_in_prop { mantissa-decimal }
+ \l_@@_tmpb_tl
+ { \tl_clear:N \l_@@_tmpb_tl }
+ \tl_set:Nx \l_@@_tmpb_tl
{
- \exp_not:V \l_siunitx_tmpb_tl
+ \exp_not:V \l_@@_tmpb_tl
\prg_replicate:nn
{
- \l_siunitx_number_uncert_length_int
- - \l_siunitx_number_mantissa_length_int
+ \l_@@_number_uncert_length_int
+ - \l_@@_number_mantissa_length_int
}
{ 0 }
}
- \tl_if_empty:NF \l_siunitx_tmpb_tl
+ \tl_if_empty:NF \l_@@_tmpb_tl
{
- \prop_put:NnV \l_siunitx_number_in_prop { mantissa-decimal }
- \l_siunitx_tmpb_tl
- \prop_if_in:NnF \l_siunitx_number_in_prop
+ \prop_put:NnV \l_@@_number_in_prop { mantissa-decimal }
+ \l_@@_tmpb_tl
+ \prop_if_in:NnF \l_@@_number_in_prop
{ mantissa-decimal-marker }
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ mantissa-decimal-marker } { . }
}
}
}
- \tl_put_right:NV \l_siunitx_number_uncert_tl \l_siunitx_tmpa_tl
- \prop_put:NnV \l_siunitx_number_in_prop { mantissa-uncertainty }
- \l_siunitx_number_uncert_tl
+ \tl_put_right:NV \l_@@_number_uncert_tl \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_in_prop { mantissa-uncertainty }
+ \l_@@_number_uncert_tl
}
% \end{macrocode}
%\end{macro}
@@ -7660,146 +7666,146 @@ This work consists of the file siunitx.dtx
%
% \begin{variable}
% {
-% \l_siunitx_round_int ,
-% \l_siunitx_round_tl ,
-% \l_siunitx_round_bool ,
-% \l_siunitx_round_decimal_in_tl ,
-% \l_siunitx_round_decimal_out_tl ,
-% \l_siunitx_round_discard_tl ,
-% \l_siunitx_round_even_bool ,
-% \l_siunitx_round_integer_in_tl ,
-% \l_siunitx_round_integer_out_tl ,
-% \l_siunitx_round_half_up_bool
+% \l_@@_round_int ,
+% \l_@@_round_tl ,
+% \l_@@_round_bool ,
+% \l_@@_round_decimal_in_tl ,
+% \l_@@_round_decimal_out_tl ,
+% \l_@@_round_discard_tl ,
+% \l_@@_round_even_bool ,
+% \l_@@_round_integer_in_tl ,
+% \l_@@_round_integer_out_tl ,
+% \l_@@_round_half_up_bool
% }
% The rounding system needs a number of variables.
% \begin{macrocode}
-\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_discard_tl
-\tl_new:N \l_siunitx_round_even_bool
-\tl_new:N \l_siunitx_round_integer_in_tl
-\tl_new:N \l_siunitx_round_integer_out_tl
-\bool_new:N \l_siunitx_round_half_up_bool
+\int_new:N \l_@@_round_int
+\tl_new:N \l_@@_round_tl
+\bool_new:N \l_@@_round_bool
+\tl_new:N \l_@@_round_decimal_in_tl
+\tl_new:N \l_@@_round_decimal_out_tl
+\tl_new:N \l_@@_round_discard_tl
+\tl_new:N \l_@@_round_even_bool
+\tl_new:N \l_@@_round_integer_in_tl
+\tl_new:N \l_@@_round_integer_out_tl
+\bool_new:N \l_@@_round_half_up_bool
% \end{macrocode}
% \end{variable}
%
%\begin{macro}{
-% \l_siunitx_process_decimal_int ,
-% \l_siunitx_process_uncertainty_int ,
-% \l_siunitx_uncertainty_decimal_tl ,
-% \l_siunitx_uncertainty_integer_tl
+% \l_@@_process_decimal_int ,
+% \l_@@_process_uncertainty_int ,
+% \l_@@_uncertainty_decimal_tl ,
+% \l_@@_uncertainty_integer_tl
%}
% The code to expand uncertainties needs to know numbers of digits, and
% to store various data.
% \begin{macrocode}
-\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
+\int_new:N \l_@@_process_decimal_int
+\int_new:N \l_@@_process_uncertainty_int
+\tl_new:N \l_@@_uncertainty_decimal_tl
+\tl_new:N \l_@@_uncertainty_integer_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_process_fixed_bool ,
-% \l_siunitx_process_engineering_bool ,
-% \l_siunitx_process_scientific_bool
+% \l_@@_process_fixed_bool ,
+% \l_@@_process_engineering_bool ,
+% \l_@@_process_scientific_bool
%}
% Settings for the scientific notation system.
% \begin{macrocode}
-\bool_new:N \l_siunitx_process_fixed_bool
-\bool_new:N \l_siunitx_process_engineering_bool
-\bool_new:N \l_siunitx_process_scientific_bool
+\bool_new:N \l_@@_process_fixed_bool
+\bool_new:N \l_@@_process_engineering_bool
+\bool_new:N \l_@@_process_scientific_bool
% \end{macrocode}
%\end{macro}
%
-% \begin{variable}{\l_siunitx_process_drop_exponent_bool}
+% \begin{variable}{\l_@@_process_drop_exponent_bool}
% Used to drop the exponent when this is necessary.
% \begin{macrocode}
-\bool_new:N \l_siunitx_process_drop_exponent_bool
+\bool_new:N \l_@@_process_drop_exponent_bool
% \end{macrocode}
% \end{variable}
%
% \begin{variable}
% {
-% \l_siunitx_process_decimal_zero_bool ,
-% \l_siunitx_process_integer_zero_bool ,
-% \l_siunitx_process_sign_tl ,
-% \l_siunitx_process_fixed_int ,
-% \l_siunitx_process_integer_min_int ,
-% \l_siunitx_process_plus_bool ,
-% \l_siunitx_omit_uncert_bool ,
-% \l_siunitx_process_unity_mantissa_tl ,
-% \l_siunitx_process_zero_exponent_bool ,
-% \l_siunitx_process_int_to_dec_bool ,
-% \l_siunitx_process_round_min_tl ,
-% \l_siunitx_process_precision_int ,
-% \l_siunitx_zero_decimal_to_integer_bool
+% \l_@@_process_decimal_zero_bool ,
+% \l_@@_process_integer_zero_bool ,
+% \l_@@_process_sign_tl ,
+% \l_@@_process_fixed_int ,
+% \l_@@_process_integer_min_int ,
+% \l_@@_process_plus_bool ,
+% \l_@@_omit_uncert_bool ,
+% \l_@@_process_unity_mantissa_tl ,
+% \l_@@_process_zero_exponent_bool ,
+% \l_@@_process_int_to_dec_bool ,
+% \l_@@_process_round_min_tl ,
+% \l_@@_process_precision_int ,
+% \l_@@_zero_decimal_to_integer_bool
% }
% First, the options are set up.
% \begin{macrocode}
\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,
- fixed-exponent .int_set:N = \l_siunitx_process_fixed_int,
+ add-decimal-zero .bool_set:N = \l_@@_process_decimal_zero_bool,
+ add-integer-zero .bool_set:N = \l_@@_process_integer_zero_bool,
+ explicit-sign .tl_set:N = \l_@@_process_sign_tl,
+ fixed-exponent .int_set:N = \l_@@_process_fixed_int,
minimum-integer-digits .int_set:N =
- \l_siunitx_process_integer_min_int,
- retain-explicit-plus .bool_set:N = \l_siunitx_process_plus_bool,
- omit-uncertainty .bool_set:N = \l_siunitx_omit_uncert_bool,
+ \l_@@_process_integer_min_int,
+ retain-explicit-plus .bool_set:N = \l_@@_process_plus_bool,
+ omit-uncertainty .bool_set:N = \l_@@_omit_uncert_bool,
retain-unity-mantissa .bool_set:N =
- \l_siunitx_process_unity_mantissa_bool,
+ \l_@@_process_unity_mantissa_bool,
retain-zero-exponent .bool_set:N =
- \l_siunitx_process_zero_exponent_bool,
+ \l_@@_process_zero_exponent_bool,
round-half .choice:,
round-half / even .code:n =
- { \bool_set_false:N \l_siunitx_round_half_up_bool },
+ { \bool_set_false:N \l_@@_round_half_up_bool },
round-half / up .code:n =
- { \bool_set_true:N \l_siunitx_round_half_up_bool },
+ { \bool_set_true:N \l_@@_round_half_up_bool },
round-integer-to-decimal .bool_set:N =
- \l_siunitx_process_int_to_dec_bool,
- round-minimum .tl_set:N = \l_siunitx_process_round_min_tl,
+ \l_@@_process_int_to_dec_bool,
+ round-minimum .tl_set:N = \l_@@_process_round_min_tl,
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 },
+ { \tl_set:Nn \l_@@_round_tl { figures } },
+ round-mode / off .code:n = { \tl_clear:N \l_@@_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,
+ { \tl_set:Nn \l_@@_round_tl { places } },
+ round-precision .int_set:N = \l_@@_process_precision_int,
scientific-notation .choice: ,
scientific-notation
/ false .code:n =
{
- \bool_set_false:N \l_siunitx_process_fixed_bool
- \bool_set_false:N \l_siunitx_process_engineering_bool
- \bool_set_false:N \l_siunitx_process_scientific_bool
+ \bool_set_false:N \l_@@_process_fixed_bool
+ \bool_set_false:N \l_@@_process_engineering_bool
+ \bool_set_false:N \l_@@_process_scientific_bool
},
scientific-notation
/ engineering .code:n =
{
- \bool_set_false:N \l_siunitx_process_fixed_bool
- \bool_set_true:N \l_siunitx_process_engineering_bool
- \bool_set_true:N \l_siunitx_process_scientific_bool
+ \bool_set_false:N \l_@@_process_fixed_bool
+ \bool_set_true:N \l_@@_process_engineering_bool
+ \bool_set_true:N \l_@@_process_scientific_bool
},
scientific-notation
/ fixed .code:n =
{
- \bool_set_true:N \l_siunitx_process_fixed_bool
- \bool_set_false:N \l_siunitx_process_engineering_bool
- \bool_set_false:N \l_siunitx_process_scientific_bool
+ \bool_set_true:N \l_@@_process_fixed_bool
+ \bool_set_false:N \l_@@_process_engineering_bool
+ \bool_set_false:N \l_@@_process_scientific_bool
},
scientific-notation
/ true .code:n =
{
- \bool_set_false:N \l_siunitx_process_fixed_bool
- \bool_set_false:N \l_siunitx_process_engineering_bool
- \bool_set_true:N \l_siunitx_process_scientific_bool
+ \bool_set_false:N \l_@@_process_fixed_bool
+ \bool_set_false:N \l_@@_process_engineering_bool
+ \bool_set_true:N \l_@@_process_scientific_bool
},
zero-decimal-to-integer .bool_set:N =
- \l_siunitx_zero_decimal_to_integer_bool
+ \l_@@_zero_decimal_to_integer_bool
}
\keys_set:nn { siunitx }
{
@@ -7813,367 +7819,367 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\siunitx_number_process:}
+% \begin{macro}{\@@_number_process:}
% Post-processing is a series of small tasks.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process:
+\cs_new_protected:Npn \@@_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 }
+ \@@_number_process_sign:
+ \@@_number_process_zero_fill:
+ \@@_number_process_mantissa:
+ \prop_if_in:NnF \l_@@_number_in_prop { symbolic }
{
- \bool_if:NTF \l_siunitx_process_fixed_bool
- { \siunitx_number_process_fixed: }
+ \bool_if:NTF \l_@@_process_fixed_bool
+ { \@@_number_process_fixed: }
{
- \bool_if:NT \l_siunitx_process_scientific_bool
- { \siunitx_number_process_scientific: }
+ \bool_if:NT \l_@@_process_scientific_bool
+ { \@@_number_process_scientific: }
}
- \siunitx_number_process_exponent:
- \siunitx_number_process_uncertainty:
- \bool_if:NT \l_siunitx_exp_to_prefix_bool
+ \@@_number_process_exponent:
+ \@@_number_process_uncertainty:
+ \bool_if:NT \l_@@_exp_to_prefix_bool
{
- \tl_if_empty:NF \l_siunitx_unit_tl
- { \siunitx_number_exp_to_prefix: }
+ \tl_if_empty:NF \l_@@_unit_tl
+ { \@@_number_exp_to_prefix: }
}
- \prop_if_in:NnTF \l_siunitx_number_in_prop { uncertainty }
+ \prop_if_in:NnTF \l_@@_number_in_prop { uncertainty }
{
- \bool_if:NTF \l_siunitx_omit_uncert_bool
+ \bool_if:NTF \l_@@_omit_uncert_bool
{
- \prop_del:Nn \l_siunitx_number_in_prop { uncertainty }
- \prop_del:Nn \l_siunitx_number_in_prop { mantissa-uncertainty }
+ \prop_del:Nn \l_@@_number_in_prop { uncertainty }
+ \prop_del:Nn \l_@@_number_in_prop { mantissa-uncertainty }
}
- { \siunitx_number_process_round: }
+ { \@@_number_process_round: }
}
- { \siunitx_number_process_round: }
+ { \@@_number_process_round: }
}
- \siunitx_number_process_zero_to_integer:
- \siunitx_number_process_integer_digits:
- \bool_if:NT \l_siunitx_process_drop_exponent_bool
+ \@@_number_process_zero_to_integer:
+ \@@_number_process_integer_digits:
+ \bool_if:NT \l_@@_process_drop_exponent_bool
{
- \prop_del:Nn \l_siunitx_number_in_prop { exponent }
- \prop_del:Nn \l_siunitx_number_in_prop { exponent-integer }
+ \prop_del:Nn \l_@@_number_in_prop { exponent }
+ \prop_del:Nn \l_@@_number_in_prop { exponent-integer }
}
}
% \end{macrocode}
% \end{macro}
%
-%\begin{macro}{\siunitx_number_process_exponent:}
-%\begin{macro}[aux]{\siunitx_number_process_exponent_aux:n}
+%\begin{macro}{\@@_number_process_exponent:}
+%\begin{macro}[aux]{\@@_number_process_exponent_aux:n}
% To check for a totally zero exponent, the possibility that one or more
% of the exponent storage areas is zero needs to be considered.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_exponent: {
- \bool_if:NF \l_siunitx_process_zero_exponent_bool
+\cs_new_protected:Npn \@@_number_process_exponent: {
+ \bool_if:NF \l_@@_process_zero_exponent_bool
{
- \prop_if_in:NnT \l_siunitx_number_in_prop { exponent }
+ \prop_if_in:NnT \l_@@_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
+ \bool_set_false:N \l_@@_tmp_bool
+ \@@_number_process_exponent_aux:n { integer }
+ \bool_if:NF \l_@@_tmp_bool
+ { \@@_number_process_exponent_aux:n { decimal } }
+ \bool_if:NF \l_@@_tmp_bool
{
- \prop_del:Nn \l_siunitx_number_in_prop { exponent }
- \prop_del:Nn \l_siunitx_number_in_prop
+ \prop_del:Nn \l_@@_number_in_prop { exponent }
+ \prop_del:Nn \l_@@_number_in_prop
{ exponent-integer }
- \prop_del:Nn \l_siunitx_number_in_prop
+ \prop_del:Nn \l_@@_number_in_prop
{ exponent-decimal }
}
}
}
}
-\cs_new_protected:Npn \siunitx_number_process_exponent_aux:n #1 {
- \prop_get:NnNT \l_siunitx_number_in_prop { exponent- #1 }
- \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_process_exponent_aux:n #1 {
+ \prop_get:NnNT \l_@@_number_in_prop { exponent- #1 }
+ \l_@@_tmpa_tl
{
- \int_compare:nNnF { \l_siunitx_tmpa_tl } = { 0 }
- { \bool_set_true:N \l_siunitx_tmp_bool }
+ \int_compare:nNnF { \l_@@_tmpa_tl } = { 0 }
+ { \bool_set_true:N \l_@@_tmp_bool }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-% \begin{macro}{\siunitx_number_process_figures:n}
+% \begin{macro}{\@@_number_process_figures:n}
% \begin{macro}[aux]
% {
-% \siunitx_number_process_figures_aux:n ,
-% \siunitx_number_process_figures_init:n
+% \@@_number_process_figures_aux:n ,
+% \@@_number_process_figures_init:n
% }
% The approach here is to find how many digits there are in each part
% of the number, working out which are significant. The next stage is
% reconstruction of the number.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_figures:n #1
+\cs_new_protected:Npn \@@_number_process_figures:n #1
{
- \int_compare:nNnTF \l_siunitx_process_precision_int > \c_zero
+ \int_compare:nNnTF \l_@@_process_precision_int > \c_zero
{
- \prop_if_in:NnT \l_siunitx_number_in_prop {#1}
- { \siunitx_number_process_figures_aux:n {#1} }
+ \prop_if_in:NnT \l_@@_number_in_prop {#1}
+ { \@@_number_process_figures_aux:n {#1} }
}
{
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -sign }
- \prop_put:Nnn \l_siunitx_number_in_prop { #1 -integer } { 0 }
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal }
- \bool_if:NF \l_siunitx_process_int_to_dec_bool
- { \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal-marker } }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -sign }
+ \prop_put:Nnn \l_@@_number_in_prop { #1 -integer } { 0 }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -decimal }
+ \bool_if:NF \l_@@_process_int_to_dec_bool
+ { \prop_del:Nn \l_@@_number_in_prop { #1 -decimal-marker } }
}
}
-\cs_new_protected:Npn \siunitx_number_process_figures_aux:n #1
+\cs_new_protected:Npn \@@_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
+ \@@_number_process_figures_init:n {#1}
+ \@@_number_process_figures_count:n { integer }
+ \@@_number_process_figures_count:n { decimal }
+ \bool_if:NTF \l_@@_round_bool
{
- \bool_set_false:N \l_siunitx_round_bool
+ \bool_set_false:N \l_@@_round_bool
\int_compare:nNnTF
- \l_siunitx_round_int > \l_siunitx_process_precision_int
+ \l_@@_round_int > \l_@@_process_precision_int
{
- \siunitx_number_process_figures_round:
- \siunitx_number_process_round_tidy:n {#1}
+ \@@_number_process_figures_round:
+ \@@_number_process_round_tidy:n {#1}
}
- { \siunitx_number_process_figures_pad:n {#1} }
+ { \@@_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 }
+ \prop_put:Nnn \l_@@_number_in_prop { #1 -integer } { 0 }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -decimal }
}
}
-\cs_new_protected:Npn \siunitx_number_process_figures_init:n #1
+\cs_new_protected:Npn \@@_number_process_figures_init:n #1
{
- \int_zero:N \l_siunitx_round_int
- \bool_set_false:N \l_siunitx_round_bool
- \bool_set_false:N \l_siunitx_round_even_bool
- \prop_get:NnNF \l_siunitx_number_in_prop { #1 -decimal }
- \l_siunitx_round_decimal_in_tl
- { \tl_clear:N \l_siunitx_round_decimal_in_tl }
- \prop_get:NnNF \l_siunitx_number_in_prop { #1 -integer }
- \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
- \tl_clear:N \l_siunitx_round_discard_tl
+ \int_zero:N \l_@@_round_int
+ \bool_set_false:N \l_@@_round_bool
+ \bool_set_false:N \l_@@_round_even_bool
+ \prop_get:NnNF \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_round_decimal_in_tl
+ { \tl_clear:N \l_@@_round_decimal_in_tl }
+ \prop_get:NnNF \l_@@_number_in_prop { #1 -integer }
+ \l_@@_round_integer_in_tl
+ { \tl_clear:N \l_@@_round_integer_in_tl }
+ \tl_clear:N \l_@@_round_decimal_out_tl
+ \tl_clear:N \l_@@_round_integer_out_tl
+ \tl_clear:N \l_@@_round_discard_tl
}
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \begin{macro}{\siunitx_number_process_figures_count:n}
-% \begin{macro}[aux]{\siunitx_number_process_figures_count_aux:n}
+% \begin{macro}{\@@_number_process_figures_count:n}
+% \begin{macro}[aux]{\@@_number_process_figures_count_aux:n}
% The counting code has to check that characters are actually
% significant.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_figures_count:n #1
+\cs_new_protected:Npn \@@_number_process_figures_count:n #1
{
- \tl_if_empty:cF { l_siunitx_round_ #1 _in_tl }
+ \tl_if_empty:cF { l_@@_round_ #1 _in_tl }
{
- \prop_if_in:NnF \l_siunitx_number_in_prop { #1 -uncertainty }
- { \siunitx_number_process_figures_count_aux:n {#1} }
+ \prop_if_in:NnF \l_@@_number_in_prop { #1 -uncertainty }
+ { \@@_number_process_figures_count_aux:n {#1} }
}
}
-\cs_new_protected:Npn \siunitx_number_process_figures_count_aux:n #1
+\cs_new_protected:Npn \@@_number_process_figures_count_aux:n #1
{
- \int_set:Nn \l_siunitx_tmp_int
- { \tl_head:v { l_siunitx_round_ #1 _in_tl } }
- \tl_set:cx { l_siunitx_round_ #1 _in_tl }
- { \tl_tail:v { 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
+ \int_set:Nn \l_@@_tmp_int
+ { \tl_head:v { l_@@_round_ #1 _in_tl } }
+ \tl_set:cx { l_@@_round_ #1 _in_tl }
+ { \tl_tail:v { l_@@_round_ #1 _in_tl } }
+ \tl_put_left:cV { l_@@_round_ #1 _out_tl } \l_@@_tmp_int
+ \bool_if:NF \l_@@_round_bool
{
- \int_compare:nNnF { \l_siunitx_tmp_int } = \c_zero
- { \bool_set_true:N \l_siunitx_round_bool }
+ \int_compare:nNnF { \l_@@_tmp_int } = \c_zero
+ { \bool_set_true:N \l_@@_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 }
+ \bool_if:NT \l_@@_round_bool
+ { \int_incr:N \l_@@_round_int }
+ \tl_if_empty:cTF { l_@@_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 }
+ \tl_set_eq:cc { l_@@_round_ #1 _in_tl }
+ { l_@@_round_ #1 _out_tl }
+ \tl_clear:c { l_@@_round_ #1 _out_tl }
}
- { \siunitx_number_process_figures_count_aux:n {#1} }
+ { \@@_number_process_figures_count_aux:n {#1} }
}
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \begin{macro}{\siunitx_number_process_figures_round:}
-% \begin{macro}[aux]{\siunitx_number_process_figures_round_loop:}
+% \begin{macro}{\@@_number_process_figures_round:}
+% \begin{macro}[aux]{\@@_number_process_figures_round_loop:}
% The control macro for rounding to figures does the decimal part
% then the integer part as loops. There is then some tidying up if a
% digit is carried at the end.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_figures_round:
+\cs_new_protected:Npn \@@_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 } }
+ \int_set:Nn \l_@@_round_int
+ { \l_@@_round_int - \l_@@_process_precision_int }
+ \tl_if_empty:NF \l_@@_round_decimal_in_tl
+ { \@@_number_process_figures_round_loop: }
+ \tl_if_empty:NF \l_@@_round_integer_in_tl
+ { \@@_number_process_figures_integer: }
+ \bool_if:NT \l_@@_round_bool
+ { \tl_put_left:Nn \l_@@_round_integer_out_tl { 1 } }
}
-\cs_new_protected:Npn \siunitx_number_process_figures_round_loop:
+\cs_new_protected:Npn \@@_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: }
+ \@@_number_process_round_decimal:
+ \tl_if_empty:NF \l_@@_round_decimal_in_tl
+ { \@@_number_process_figures_round_loop: }
}
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \begin{macro}{\siunitx_number_process_figures_integer:}
+% \begin{macro}{\@@_number_process_figures_integer:}
% For figures, the integer part is a little complicated as zeros need
% to be included.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_figures_integer:
+\cs_new_protected:Npn \@@_number_process_figures_integer:
{
- \int_compare:nNnT \l_siunitx_round_int > \c_zero
- { \tl_put_left:Nn \l_siunitx_round_integer_out_tl { 0 } }
- \int_compare:nNnF \l_siunitx_round_int > \c_one
+ \int_compare:nNnT \l_@@_round_int > \c_zero
+ { \tl_put_left:Nn \l_@@_round_integer_out_tl { 0 } }
+ \int_compare:nNnF \l_@@_round_int > \c_one
{
- \int_set:Nn \l_siunitx_tmp_int
- { \tl_head:V \l_siunitx_round_integer_in_tl }
- \siunitx_number_process_round_up:
- \int_compare:nNnTF \l_siunitx_round_int = \c_one
+ \int_set:Nn \l_@@_tmp_int
+ { \tl_head:V \l_@@_round_integer_in_tl }
+ \@@_number_process_round_up:
+ \int_compare:nNnTF \l_@@_round_int = \c_one
{
- \int_compare:nNnT \l_siunitx_tmp_int > \c_four
- { \bool_set_true:N \l_siunitx_round_bool }
+ \int_compare:nNnT \l_@@_tmp_int > \c_four
+ { \bool_set_true:N \l_@@_round_bool }
}
{
- \int_compare:nNnT \l_siunitx_tmp_int = \c_ten
+ \int_compare:nNnT \l_@@_tmp_int = \c_ten
{
- \bool_set_true:N \l_siunitx_round_bool
- \int_zero:N \l_siunitx_tmp_int
+ \bool_set_true:N \l_@@_round_bool
+ \int_zero:N \l_@@_tmp_int
}
- \tl_put_left:NV \l_siunitx_round_integer_out_tl
- \l_siunitx_tmp_int
+ \tl_put_left:NV \l_@@_round_integer_out_tl
+ \l_@@_tmp_int
}
}
- \int_decr:N \l_siunitx_round_int
- \tl_set:Nx \l_siunitx_round_integer_in_tl
- { \tl_tail:V \l_siunitx_round_integer_in_tl }
- \tl_if_empty:NF \l_siunitx_round_integer_in_tl
- { \siunitx_number_process_figures_integer: }
+ \int_decr:N \l_@@_round_int
+ \tl_set:Nx \l_@@_round_integer_in_tl
+ { \tl_tail:V \l_@@_round_integer_in_tl }
+ \tl_if_empty:NF \l_@@_round_integer_in_tl
+ { \@@_number_process_figures_integer: }
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_number_process_figures_pad:n}
+%\begin{macro}{\@@_number_process_figures_pad:n}
% If the number is too short, then the reversal is undone and the
% padding routine is called.
% \begin{macrocode}
-\cs_new_protected: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}
+\cs_new_protected:Npn \@@_number_process_figures_pad:n #1 {
+ \prop_get:NnN \l_@@_number_in_prop { #1 -integer }
+ \l_@@_round_integer_in_tl
+ \prop_get:NnN \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_round_decimal_in_tl
+ \int_set:Nn \l_@@_round_int
+ { \l_@@_process_precision_int - \l_@@_round_int }
+ \@@_number_process_pad:n {#1}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_process_fixed:}
+%\begin{macro}{\@@_number_process_fixed:}
%\begin{macro}[aux]{
-% \siunitx_number_process_fixed_aux_i:nnn ,
-% \siunitx_number_process_fixed_aux_ii:nnn ,
-% \siunitx_number_process_fixed_aux_iii:nnn ,
-% \siunitx_number_process_fixed_large:nnn ,
-% \siunitx_number_process_fixed_large_aux:w ,
-% \siunitx_number_process_fixed_small:nnn ,
-% \siunitx_number_process_fixed_small_aux:w
+% \@@_number_process_fixed_aux_i:nnn ,
+% \@@_number_process_fixed_aux_ii:nnn ,
+% \@@_number_process_fixed_aux_iii:nnn ,
+% \@@_number_process_fixed_large:nnn ,
+% \@@_number_process_fixed_large_aux:w ,
+% \@@_number_process_fixed_small:nnn ,
+% \@@_number_process_fixed_small_aux:w
%}
% When working to a fixed exponent value, the idea is to use the stack
% to do the work. First, there is some set up to do.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_fixed: {
- \prop_if_in:NnF \l_siunitx_number_in_prop { complex }
- {
- \prop_get:NnNF \l_siunitx_number_in_prop { mantissa-integer }
- \l_siunitx_tmpa_tl
- { \tl_set:Nn \l_siunitx_tmpa_tl { 0 } }
- \prop_get:NnNF \l_siunitx_number_in_prop { mantissa-decimal }
- \l_siunitx_tmpb_tl
- { \tl_clear:N \l_siunitx_tmpb_tl }
- \tl_set:Nx \l_siunitx_tmpa_tl
- { { \l_siunitx_tmpa_tl } { \l_siunitx_tmpb_tl } }
- \prop_get:NnNF \l_siunitx_number_in_prop { exponent-integer }
- \l_siunitx_tmpb_tl
- { \tl_set:Nn \l_siunitx_tmpb_tl { 0 } }
+\cs_new_protected:Npn \@@_number_process_fixed: {
+ \prop_if_in:NnF \l_@@_number_in_prop { complex }
+ {
+ \prop_get:NnNF \l_@@_number_in_prop { mantissa-integer }
+ \l_@@_tmpa_tl
+ { \tl_set:Nn \l_@@_tmpa_tl { 0 } }
+ \prop_get:NnNF \l_@@_number_in_prop { mantissa-decimal }
+ \l_@@_tmpb_tl
+ { \tl_clear:N \l_@@_tmpb_tl }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { \l_@@_tmpa_tl } { \l_@@_tmpb_tl } }
+ \prop_get:NnNF \l_@@_number_in_prop { exponent-integer }
+ \l_@@_tmpb_tl
+ { \tl_set:Nn \l_@@_tmpb_tl { 0 } }
\group_begin:
- \prop_get:NnNT \l_siunitx_number_in_prop { exponent-sign }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { exponent-sign }
+ \l_@@_tmpa_tl
{
- \tl_put_left:NV \l_siunitx_tmpb_tl \l_siunitx_tmpa_tl
+ \tl_put_left:NV \l_@@_tmpb_tl \l_@@_tmpa_tl
}
\exp_args:NNNV \group_end:
- \tl_set:Nn \l_siunitx_tmpb_tl \l_siunitx_tmpb_tl
- \tl_set:Nx \l_siunitx_tmpa_tl
- { \l_siunitx_tmpa_tl { \l_siunitx_tmpb_tl } }
- \exp_after:wN \siunitx_number_process_fixed_aux_i:nnn
- \l_siunitx_tmpa_tl
+ \tl_set:Nn \l_@@_tmpb_tl \l_@@_tmpb_tl
+ \tl_set:Nx \l_@@_tmpa_tl
+ { \l_@@_tmpa_tl { \l_@@_tmpb_tl } }
+ \exp_after:wN \@@_number_process_fixed_aux_i:nnn
+ \l_@@_tmpa_tl
}
}
% \end{macrocode}
% The main loop checks to see which way to adjust the exponent then
% does the work.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_fixed_aux_i:nnn #1#2#3
+\cs_new_protected:Npn \@@_number_process_fixed_aux_i:nnn #1#2#3
{
- \prop_put:Nnn \l_siunitx_number_in_prop { exponent } { true }
- \int_compare:nNnTF { \l_siunitx_process_fixed_int } > { \c_zero }
+ \prop_put:Nnn \l_@@_number_in_prop { exponent } { true }
+ \int_compare:nNnTF { \l_@@_process_fixed_int } > { \c_zero }
{
- \prop_put:NnV \l_siunitx_number_in_prop { exponent-integer }
- \l_siunitx_process_fixed_int
- \prop_del:Nn \l_siunitx_number_in_prop { exponent-sign }
+ \prop_put:NnV \l_@@_number_in_prop { exponent-integer }
+ \l_@@_process_fixed_int
+ \prop_del:Nn \l_@@_number_in_prop { exponent-sign }
}
{
- \prop_put:Nnx \l_siunitx_number_in_prop { exponent-integer }
- { \int_eval:n { - \l_siunitx_process_fixed_int } }
- \prop_put:Nnn \l_siunitx_number_in_prop { exponent-sign } { - }
+ \prop_put:Nnx \l_@@_number_in_prop { exponent-integer }
+ { \int_eval:n { - \l_@@_process_fixed_int } }
+ \prop_put:Nnn \l_@@_number_in_prop { exponent-sign } { - }
}
- \siunitx_number_process_fixed_aux_ii:nnn {#1} {#2} {#3}
+ \@@_number_process_fixed_aux_ii:nnn {#1} {#2} {#3}
}
-\cs_new_protected:Npn \siunitx_number_process_fixed_aux_ii:nnn #1#2#3
+\cs_new_protected:Npn \@@_number_process_fixed_aux_ii:nnn #1#2#3
{
- \bool_set_true:N \l_siunitx_tmp_bool
+ \bool_set_true:N \l_@@_tmp_bool
\tl_map_inline:nn {#1#2}
{
\str_if_eq:nnF {##1} { 0 }
{
- \bool_set_false:N \l_siunitx_tmp_bool
+ \bool_set_false:N \l_@@_tmp_bool
\tl_map_break:
}
}
- \bool_if:NF \l_siunitx_tmp_bool
- { \siunitx_number_process_fixed_aux_iii:nnn {#1} {#2} {#3} }
+ \bool_if:NF \l_@@_tmp_bool
+ { \@@_number_process_fixed_aux_iii:nnn {#1} {#2} {#3} }
}
\cs_new_protected:Npn
- \siunitx_number_process_fixed_aux_iii:nnn #1#2#3 {
- \int_compare:nNnTF {#3} > { \l_siunitx_process_fixed_int }
- { \siunitx_number_process_fixed_large:nnn {#1} {#2} {#3} }
+ \@@_number_process_fixed_aux_iii:nnn #1#2#3 {
+ \int_compare:nNnTF {#3} > { \l_@@_process_fixed_int }
+ { \@@_number_process_fixed_large:nnn {#1} {#2} {#3} }
{
- \int_compare:nNnTF {#3} < { \l_siunitx_process_fixed_int }
- { \siunitx_number_process_fixed_small:nnn {#1} {#2} {#3} }
+ \int_compare:nNnTF {#3} < { \l_@@_process_fixed_int }
+ { \@@_number_process_fixed_small:nnn {#1} {#2} {#3} }
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ mantissa-integer } {#1}
\tl_if_empty:nTF {#2}
{
- \prop_del:Nn \l_siunitx_number_in_prop
+ \prop_del:Nn \l_@@_number_in_prop
{ mantissa-decimal }
- \prop_del:Nn \l_siunitx_number_in_prop
+ \prop_del:Nn \l_@@_number_in_prop
{ mantissa-decimal-marker }
}
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ mantissa-decimal } {#2}
- \prop_if_in:NnF \l_siunitx_number_in_prop
+ \prop_if_in:NnF \l_@@_number_in_prop
{ mantissa-decimal-marker }
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ mantissa-decimal-marker } { . }
}
}
@@ -8187,103 +8193,103 @@ This work consists of the file siunitx.dtx
% leading zeros to dispose of. There is also a check to avoid adding
% an additional zero to the decimal part of the number.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_fixed_large:nnn #1
+\cs_new_protected:Npn \@@_number_process_fixed_large:nnn #1
{
\int_compare:nNnTF {#1} = \c_zero
- { \siunitx_number_process_fixed_large_aux:nnn { } }
- { \siunitx_number_process_fixed_large_aux:nnn {#1} }
+ { \@@_number_process_fixed_large_aux:nnn { } }
+ { \@@_number_process_fixed_large_aux:nnn {#1} }
}
-\cs_new_protected:Npn \siunitx_number_process_fixed_large_aux:nnn #1#2#3
+\cs_new_protected:Npn \@@_number_process_fixed_large_aux:nnn #1#2#3
{
\cs_set_protected:Npn
- \siunitx_number_process_fixed_large_aux:w ##1##2 \q_stop
+ \@@_number_process_fixed_large_aux:w ##1##2 \q_stop
{
\tl_if_empty:nTF {##2}
{
\int_compare:nNnTF
- { #3 - 1 } = { \l_siunitx_process_fixed_int }
+ { #3 - 1 } = { \l_@@_process_fixed_int }
{
- \siunitx_number_process_fixed_aux_ii:nnn { #1 ##1 }
+ \@@_number_process_fixed_aux_ii:nnn { #1 ##1 }
{ } { #3 - 1 }
}
{
- \siunitx_number_process_fixed_aux_ii:nnn { #1 ##1 }
+ \@@_number_process_fixed_aux_ii:nnn { #1 ##1 }
{ 0 } { #3 - 1 }
}
}
{
\int_compare:nNnTF { 0 #1 } = { 0 }
{
- \siunitx_number_process_fixed_aux_ii:nnn {##1} {##2}
+ \@@_number_process_fixed_aux_ii:nnn {##1} {##2}
{ #3 - 1 }
}
{
- \siunitx_number_process_fixed_aux_ii:nnn { #1 ##1 }
+ \@@_number_process_fixed_aux_ii:nnn { #1 ##1 }
{##2} { #3 - 1 }
}
}
}
\tl_if_empty:nTF {#2}
- { \siunitx_number_process_fixed_aux_ii:nnn { #1 0 } { } { #3 - 1 } }
- { \siunitx_number_process_fixed_large_aux:w #2 \q_stop }
+ { \@@_number_process_fixed_aux_ii:nnn { #1 0 } { } { #3 - 1 } }
+ { \@@_number_process_fixed_large_aux:w #2 \q_stop }
}
-\cs_new_protected:Npn \siunitx_number_process_fixed_large_aux:w
+\cs_new_protected:Npn \@@_number_process_fixed_large_aux:w
{ }
\cs_new_protected:Npn
- \siunitx_number_process_fixed_small:nnn #1#2#3 {
+ \@@_number_process_fixed_small:nnn #1#2#3 {
\cs_set_protected:Npn
- \siunitx_number_process_fixed_small_aux:w ##1##2 \q_stop ##3
+ \@@_number_process_fixed_small_aux:w ##1##2 \q_stop ##3
{
\tl_if_empty:nTF {##2}
{
\tl_if_empty:nTF {##3}
{
- \siunitx_number_process_fixed_aux_ii:nnn { 0 }
+ \@@_number_process_fixed_aux_ii:nnn { 0 }
{ ##1 #2 } { #3 + 1 }
}
{
- \siunitx_number_process_fixed_aux_ii:nnn {##3}
+ \@@_number_process_fixed_aux_ii:nnn {##3}
{ ##1 #2 } { #3 + 1 }
}
}
{
- \siunitx_number_process_fixed_small_aux:w ##2 \q_stop
+ \@@_number_process_fixed_small_aux:w ##2 \q_stop
{ ##3 ##1 }
}
}
- \siunitx_number_process_fixed_small_aux:w #1 \q_stop { }
+ \@@_number_process_fixed_small_aux:w #1 \q_stop { }
}
-\cs_new_protected:Npn \siunitx_number_process_fixed_small_aux:w
+\cs_new_protected:Npn \@@_number_process_fixed_small_aux:w
{ }
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_process_integer_digits:}
+%\begin{macro}{\@@_number_process_integer_digits:}
% Producing extra digits for the integer part is a simple process
% once the target is known.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_integer_digits: {
+\cs_new_protected:Npn \@@_number_process_integer_digits: {
\int_compare:nNnT
- { \l_siunitx_process_integer_min_int } > { \c_zero }
+ { \l_@@_process_integer_min_int } > { \c_zero }
{
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-integer }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-integer }
+ \l_@@_tmpa_tl
{
- \int_set:Nn \l_siunitx_tmp_int
+ \int_set:Nn \l_@@_tmp_int
{
- \l_siunitx_process_integer_min_int
- - \tl_length:N \l_siunitx_tmpa_tl
+ \l_@@_process_integer_min_int
+ - \tl_length:N \l_@@_tmpa_tl
}
- \int_compare:nNnT { \l_siunitx_tmp_int } > { \c_zero }
+ \int_compare:nNnT { \l_@@_tmp_int } > { \c_zero }
{
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
{
- \prg_replicate:nn { \l_siunitx_tmp_int } { 0 }
- \exp_not:V \l_siunitx_tmpa_tl
+ \prg_replicate:nn { \l_@@_tmp_int } { 0 }
+ \exp_not:V \l_@@_tmpa_tl
}
- \prop_put:NnV \l_siunitx_number_in_prop
- { mantissa-integer } \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_in_prop
+ { mantissa-integer } \l_@@_tmpa_tl
}
}
}
@@ -8291,27 +8297,27 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_process_mantissa:}
-%\begin{macro}{\c_siunitx_unity_tl}
+%\begin{macro}{\@@_number_process_mantissa:}
+%\begin{macro}{\c_@@_unity_tl}
% A check for the mantissa consisting only of the token \texttt{1}, when
% an exponent is also available.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_mantissa: {
- \bool_if:NF \l_siunitx_process_unity_mantissa_bool
+\cs_new_protected:Npn \@@_number_process_mantissa: {
+ \bool_if:NF \l_@@_process_unity_mantissa_bool
{
- \prop_if_in:NnT \l_siunitx_number_in_prop { exponent }
+ \prop_if_in:NnT \l_@@_number_in_prop { exponent }
{
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-integer }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-integer }
+ \l_@@_tmpa_tl
{
- \tl_if_eq:NNT \c_siunitx_unity_tl \l_siunitx_tmpa_tl
+ \tl_if_eq:NNT \c_@@_unity_tl \l_@@_tmpa_tl
{
- \prop_if_in:NnF \l_siunitx_number_in_prop
+ \prop_if_in:NnF \l_@@_number_in_prop
{ mantissa-decimal-marker }
{
- \prop_del:Nn \l_siunitx_number_in_prop
+ \prop_del:Nn \l_@@_number_in_prop
{ mantissa }
- \prop_del:Nn \l_siunitx_number_in_prop
+ \prop_del:Nn \l_@@_number_in_prop
{ mantissa-integer }
}
}
@@ -8319,77 +8325,77 @@ This work consists of the file siunitx.dtx
}
}
}
-\tl_new:N \c_siunitx_unity_tl
-\tl_set:Nn \c_siunitx_unity_tl { 1 }
+\tl_new:N \c_@@_unity_tl
+\tl_set:Nn \c_@@_unity_tl { 1 }
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_process_pad:n}
+%\begin{macro}{\@@_number_process_pad:n}
% For padding a number by adding zero to the end repeatedly. This can
% happen if the input was zero or if the number is too short.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_pad:n #1 {
- \prop_get:NnNT \l_siunitx_number_in_prop { #1 -decimal }
- \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_process_pad:n #1 {
+ \prop_get:NnNT \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_tmpa_tl
{
- \int_while_do:nNnn { \l_siunitx_round_int } > { 0 }
+ \int_while_do:nNnn { \l_@@_round_int } > { 0 }
{
- \tl_put_right:Nn \l_siunitx_tmpa_tl { 0 }
- \int_decr:N \l_siunitx_round_int
+ \tl_put_right:Nn \l_@@_tmpa_tl { 0 }
+ \int_decr:N \l_@@_round_int
}
- \prop_put:NnV \l_siunitx_number_in_prop { #1 -decimal }
- \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_tmpa_tl
}
}
% \end{macrocode}
%\end{macro}
%
-% \begin{macro}{\siunitx_number_process_places:n}
+% \begin{macro}{\@@_number_process_places:n}
% \begin{macro}[aux]
% {
-% \siunitx_number_process_places_init:n ,
-% \siunitx_number_process_places_aux_i:n ,
-% \siunitx_number_process_places_aux_i:TF ,
-% \siunitx_number_process_places_none: ,
-% \siunitx_number_process_places_aux_ii:n ,
-% \siunitx_number_process_places_loop:n ,
-% \siunitx_number_process_places_integer:n
+% \@@_number_process_places_init:n ,
+% \@@_number_process_places_aux_i:n ,
+% \@@_number_process_places_aux_i:TF ,
+% \@@_number_process_places_none: ,
+% \@@_number_process_places_aux_ii:n ,
+% \@@_number_process_places_loop:n ,
+% \@@_number_process_places_integer:n
% }
% For rounding to a fixed number of places, a check is made to see if
% the decimal part is exactly zero. If it is, just create the
% appropriate number of zeros in the padding routine. Otherwise, do the
% real work.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_places:n #1
+\cs_new_protected:Npn \@@_number_process_places:n #1
{
- \prop_if_in:NnT \l_siunitx_number_in_prop {#1}
+ \prop_if_in:NnT \l_@@_number_in_prop {#1}
{
- \prop_if_in:NnF \l_siunitx_number_in_prop { #1 -uncertainty }
- { \siunitx_number_process_places_aux_i:n {#1} }
+ \prop_if_in:NnF \l_@@_number_in_prop { #1 -uncertainty }
+ { \@@_number_process_places_aux_i:n {#1} }
}
}
-\cs_new_protected:Npn \siunitx_number_process_places_aux_i:n #1
+\cs_new_protected:Npn \@@_number_process_places_aux_i:n #1
{
- \int_compare:nNnTF \l_siunitx_process_precision_int = \c_zero
- { \siunitx_number_process_places_none:n {#1} }
+ \int_compare:nNnTF \l_@@_process_precision_int = \c_zero
+ { \@@_number_process_places_none:n {#1} }
{
- \prop_get:NnNT \l_siunitx_number_in_prop { #1 -decimal }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_tmpa_tl
{
- \tl_if_empty:NT \l_siunitx_tmpa_tl
- { \tl_set:Nn \l_siunitx_tmpa_tl { 0 } }
- \siunitx_number_process_places_aux_i:TF
+ \tl_if_empty:NT \l_@@_tmpa_tl
+ { \tl_set:Nn \l_@@_tmpa_tl { 0 } }
+ \@@_number_process_places_aux_i:TF
{
- \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}
+ \prop_put:Nnn \l_@@_number_in_prop { #1 -decimal } { }
+ \int_set:Nn \l_@@_round_int
+ { \l_@@_process_precision_int }
+ \@@_number_process_pad:n {#1}
}
{
- \int_set:Nn \l_siunitx_round_int
- { \tl_length:N \l_siunitx_tmpa_tl }
- \siunitx_number_process_places_aux_ii:n {#1}
+ \int_set:Nn \l_@@_round_int
+ { \tl_length:N \l_@@_tmpa_tl }
+ \@@_number_process_places_aux_ii:n {#1}
}
}
}
@@ -8398,192 +8404,192 @@ This work consists of the file siunitx.dtx
% The number of digits in the decimal part could be more that \TeX{} can
% handle, so a slow loop is used to see if we need to round.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_places_aux_i:TF
+\cs_new_protected:Npn \@@_number_process_places_aux_i:TF
{
- \bool_set_true:N \l_siunitx_tmp_bool
- \tl_map_inline:Nn \l_siunitx_tmpa_tl
+ \bool_set_true:N \l_@@_tmp_bool
+ \tl_map_inline:Nn \l_@@_tmpa_tl
{
\int_compare:nNnF {##1} = \c_zero
{
- \bool_set_false:N \l_siunitx_tmp_bool
+ \bool_set_false:N \l_@@_tmp_bool
\tl_map_break:
}
}
- \bool_if:NTF \l_siunitx_tmp_bool
+ \bool_if:NTF \l_@@_tmp_bool
}
% \end{macrocode}
% Rounding to no places at all requires a few checks to see if there is any
% work to do. That includes a check for rounding half to even, where if
% the decimal part is exactly half then special action is required.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_places_none:n #1
+\cs_new_protected:Npn \@@_number_process_places_none:n #1
{
- \prop_get:NnNT \l_siunitx_number_in_prop { #1 -decimal } \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { #1 -decimal } \l_@@_tmpa_tl
{
- \int_compare:nNnTF { \tl_head:V \l_siunitx_tmpa_tl } > \c_four
+ \int_compare:nNnTF { \tl_head:V \l_@@_tmpa_tl } > \c_four
{
- \prop_get:NnNTF \l_siunitx_number_in_prop { #1 -integer }
- \l_siunitx_tmpb_tl
+ \prop_get:NnNTF \l_@@_number_in_prop { #1 -integer }
+ \l_@@_tmpb_tl
{
- \tl_set:Nx \l_siunitx_tmpb_tl
- { \int_eval:n { \l_siunitx_tmpb_tl + 1 } }
- \bool_if:NF \l_siunitx_round_half_up_bool
+ \tl_set:Nx \l_@@_tmpb_tl
+ { \int_eval:n { \l_@@_tmpb_tl + 1 } }
+ \bool_if:NF \l_@@_round_half_up_bool
{
\int_compare:nNnT
- { 0 \tl_tail:V \l_siunitx_tmpa_tl } = \c_zero
+ { 0 \tl_tail:V \l_@@_tmpa_tl } = \c_zero
{
- \int_if_odd:nT \l_siunitx_tmpb_tl
+ \int_if_odd:nT \l_@@_tmpb_tl
{
- \tl_set:Nx \l_siunitx_tmpb_tl
- { \int_eval:n { \l_siunitx_tmpb_tl - 1 } }
+ \tl_set:Nx \l_@@_tmpb_tl
+ { \int_eval:n { \l_@@_tmpb_tl - 1 } }
}
}
}
}
- { \tl_set:Nn \l_siunitx_tmpb_tl { 1 } }
- \prop_put:NnV \l_siunitx_number_in_prop
- { #1 -integer } \l_siunitx_tmpb_tl
+ { \tl_set:Nn \l_@@_tmpb_tl { 1 } }
+ \prop_put:NnV \l_@@_number_in_prop
+ { #1 -integer } \l_@@_tmpb_tl
}
{
- \prop_if_in:NnF \l_siunitx_number_in_prop { #1 -integer }
+ \prop_if_in:NnF \l_@@_number_in_prop { #1 -integer }
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ #1 -integer } { 0 }
}
}
}
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal }
- \bool_if:NF \l_siunitx_process_int_to_dec_bool
- { \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal-marker } }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -decimal }
+ \bool_if:NF \l_@@_process_int_to_dec_bool
+ { \prop_del:Nn \l_@@_number_in_prop { #1 -decimal-marker } }
}
% \end{macrocode}
% For rounding to a fixed number of places, the package finds the
% difference in length between what is present and what is required.
% If the number is too short, there is some simple padding to do.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_places_aux_ii:n #1
+\cs_new_protected:Npn \@@_number_process_places_aux_ii:n #1
{
- \int_sub:Nn \l_siunitx_round_int
- { \l_siunitx_process_precision_int }
- \int_compare:nNnTF \l_siunitx_round_int < \c_zero
+ \int_sub:Nn \l_@@_round_int
+ { \l_@@_process_precision_int }
+ \int_compare:nNnTF \l_@@_round_int < \c_zero
{
- \int_set:Nn \l_siunitx_round_int { - \l_siunitx_round_int }
- \siunitx_number_process_pad:n {#1}
+ \int_set:Nn \l_@@_round_int { - \l_@@_round_int }
+ \@@_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}
+ \@@_number_process_places_init:n {#1}
+ \@@_number_process_places_loop:n {#1}
+ \@@_number_process_round_tidy:n {#1}
}
}
% \end{macrocode}
% To keep the code a little clearer.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_places_init:n #1
+\cs_new_protected:Npn \@@_number_process_places_init:n #1
{
- \prop_get:NnNF \l_siunitx_number_in_prop { #1 -integer }
- \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
- \tl_clear:N \l_siunitx_round_discard_tl
- \bool_set_false:N \l_siunitx_round_bool
- \bool_set_false:N \l_siunitx_round_even_bool
+ \prop_get:NnNF \l_@@_number_in_prop { #1 -integer }
+ \l_@@_round_integer_in_tl
+ { \tl_clear:N \l_@@_round_integer_in_tl }
+ \prop_get:NnN \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_round_decimal_in_tl
+ \tl_reverse:N \l_@@_round_integer_in_tl
+ \tl_reverse:N \l_@@_round_decimal_in_tl
+ \tl_clear:N \l_@@_round_integer_out_tl
+ \tl_clear:N \l_@@_round_decimal_out_tl
+ \tl_clear:N \l_@@_round_discard_tl
+ \bool_set_false:N \l_@@_round_bool
+ \bool_set_false:N \l_@@_round_even_bool
}
% \end{macrocode}
% If there is a decimal, do the decimal processing then come back here.
% If there is an integer, do the same. Only if both are empty does the
% loop stop.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_places_loop:n #1
+\cs_new_protected:Npn \@@_number_process_places_loop:n #1
{
- \tl_if_empty:NTF \l_siunitx_round_decimal_in_tl
+ \tl_if_empty:NTF \l_@@_round_decimal_in_tl
{
- \tl_if_empty:NF \l_siunitx_round_integer_in_tl
+ \tl_if_empty:NF \l_@@_round_integer_in_tl
{
- \siunitx_number_process_places_integer:n {#1}
- \siunitx_number_process_places_loop:n {#1}
+ \@@_number_process_places_integer:n {#1}
+ \@@_number_process_places_loop:n {#1}
}
- \bool_if:NT \l_siunitx_round_bool
+ \bool_if:NT \l_@@_round_bool
{
- \tl_put_left:Nn \l_siunitx_round_integer_out_tl { 1 }
- \bool_set_false:N \l_siunitx_round_bool
+ \tl_put_left:Nn \l_@@_round_integer_out_tl { 1 }
+ \bool_set_false:N \l_@@_round_bool
}
}
{
- \siunitx_number_process_round_decimal:
- \siunitx_number_process_places_loop:n {#1}
+ \@@_number_process_round_decimal:
+ \@@_number_process_places_loop:n {#1}
}
}
% \end{macrocode}
% Rounding for integers is just a case of carrying digits.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_places_integer:n #1
+\cs_new_protected:Npn \@@_number_process_places_integer:n #1
{
- \int_set:Nn \l_siunitx_tmp_int
- { \tl_head:V \l_siunitx_round_integer_in_tl }
- \tl_set:Nx \l_siunitx_round_integer_in_tl
- { \tl_tail:V \l_siunitx_round_integer_in_tl }
- \siunitx_number_process_round_up:
- \bool_set_false:N \l_siunitx_round_bool
- \int_compare:nNnT \l_siunitx_tmp_int = \c_ten
+ \int_set:Nn \l_@@_tmp_int
+ { \tl_head:V \l_@@_round_integer_in_tl }
+ \tl_set:Nx \l_@@_round_integer_in_tl
+ { \tl_tail:V \l_@@_round_integer_in_tl }
+ \@@_number_process_round_up:
+ \bool_set_false:N \l_@@_round_bool
+ \int_compare:nNnT \l_@@_tmp_int = \c_ten
{
- \int_zero:N \l_siunitx_tmp_int
- \bool_set_true:N \l_siunitx_round_bool
+ \int_zero:N \l_@@_tmp_int
+ \bool_set_true:N \l_@@_round_bool
}
- \tl_put_left:NV \l_siunitx_round_integer_out_tl \l_siunitx_tmp_int
+ \tl_put_left:NV \l_@@_round_integer_out_tl \l_@@_tmp_int
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-% \begin{macro}{\siunitx_number_process_round:}
+% \begin{macro}{\@@_number_process_round:}
% The lead-off for rounding is the same for decimal places and
% significant figures.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_round:
+\cs_new_protected:Npn \@@_number_process_round:
{
- \tl_if_empty:NF \l_siunitx_round_tl
+ \tl_if_empty:NF \l_@@_round_tl
{
- \bool_if:NT \l_siunitx_process_int_to_dec_bool
+ \bool_if:NT \l_@@_process_int_to_dec_bool
{
- \prop_if_in:NnF \l_siunitx_number_in_prop { mantissa-decimal }
+ \prop_if_in:NnF \l_@@_number_in_prop { mantissa-decimal }
{
- \prop_put:Nnn \l_siunitx_number_in_prop { mantissa-decimal }
+ \prop_put:Nnn \l_@@_number_in_prop { mantissa-decimal }
{ 0 }
}
- \prop_if_in:NnF \l_siunitx_number_in_prop
+ \prop_if_in:NnF \l_@@_number_in_prop
{ mantissa-decimal-marker }
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ mantissa-decimal-marker } { . }
}
}
\clist_map_function:nc { mantissa , complex }
- { siunitx_number_process_ \l_siunitx_round_tl :n }
+ { @@_number_process_ \l_@@_round_tl :n }
}
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\siunitx_number_process_round_decimal:}
-% \begin{macro}[aux]{\siunitx_number_process_round_decimal_aux:}
+% \begin{macro}{\@@_number_process_round_decimal:}
+% \begin{macro}[aux]{\@@_number_process_round_decimal_aux:}
% The rounding routine for decimals is the same for figures and places,
% so there is a generalised function here. Unfortunately, it is also
% complicated!
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_round_decimal:
+\cs_new_protected:Npn \@@_number_process_round_decimal:
{
- \int_compare:nNnF \l_siunitx_round_int > \c_one
- { \siunitx_number_process_round_decimal_aux: }
- \tl_put_right:Nx \l_siunitx_round_discard_tl
- { \tl_head:V \l_siunitx_round_decimal_in_tl }
- \tl_set:Nx \l_siunitx_round_decimal_in_tl
- { \tl_tail:V \l_siunitx_round_decimal_in_tl }
- \int_decr:N \l_siunitx_round_int
+ \int_compare:nNnF \l_@@_round_int > \c_one
+ { \@@_number_process_round_decimal_aux: }
+ \tl_put_right:Nx \l_@@_round_discard_tl
+ { \tl_head:V \l_@@_round_decimal_in_tl }
+ \tl_set:Nx \l_@@_round_decimal_in_tl
+ { \tl_tail:V \l_@@_round_decimal_in_tl }
+ \int_decr:N \l_@@_round_int
}
% \end{macrocode}
% The logic here has to deal with the (simpler) rounding up method and the
@@ -8593,187 +8599,187 @@ This work consists of the file siunitx.dtx
% for that, along with a somewhat simpler check when carrying out the
% rounding.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_round_decimal_aux:
+\cs_new_protected:Npn \@@_number_process_round_decimal_aux:
{
- \int_set:Nn \l_siunitx_tmp_int
- { \tl_head:V \l_siunitx_round_decimal_in_tl }
- \siunitx_number_process_round_up:
- \int_compare:nNnTF \l_siunitx_round_int = \c_one
+ \int_set:Nn \l_@@_tmp_int
+ { \tl_head:V \l_@@_round_decimal_in_tl }
+ \@@_number_process_round_up:
+ \int_compare:nNnTF \l_@@_round_int = \c_one
{
- \int_compare:nNnT \l_siunitx_tmp_int > \c_four
+ \int_compare:nNnT \l_@@_tmp_int > \c_four
{
- \bool_set_true:N \l_siunitx_round_bool
- \bool_if:NF \l_siunitx_round_half_up_bool
+ \bool_set_true:N \l_@@_round_bool
+ \bool_if:NF \l_@@_round_half_up_bool
{
\int_compare:nNnT
- { \l_siunitx_round_discard_tl \int_use:N \l_siunitx_tmp_int }
+ { \l_@@_round_discard_tl \int_use:N \l_@@_tmp_int }
= \c_five
- { \bool_set_true:N \l_siunitx_round_even_bool }
+ { \bool_set_true:N \l_@@_round_even_bool }
}
}
}
{
- \int_compare:nNnT \l_siunitx_tmp_int = \c_ten
+ \int_compare:nNnT \l_@@_tmp_int = \c_ten
{
- \bool_set_true:N \l_siunitx_round_bool
- \int_zero:N \l_siunitx_tmp_int
+ \bool_set_true:N \l_@@_round_bool
+ \int_zero:N \l_@@_tmp_int
}
- \tl_put_left:NV \l_siunitx_round_decimal_out_tl
- \l_siunitx_tmp_int
+ \tl_put_left:NV \l_@@_round_decimal_out_tl
+ \l_@@_tmp_int
}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \begin{macro}{\siunitx_number_process_round_up:}
+% \begin{macro}{\@@_number_process_round_up:}
% This is needed a few times, to round up the current digit unless
% it is even and \enquote{half to even} is active.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_round_up:
+\cs_new_protected:Npn \@@_number_process_round_up:
{
- \bool_if:NT \l_siunitx_round_bool
+ \bool_if:NT \l_@@_round_bool
{
- \bool_if:NTF \l_siunitx_round_even_bool
+ \bool_if:NTF \l_@@_round_even_bool
{
- \bool_set_false:N \l_siunitx_round_even_bool
- \int_if_even:nF \l_siunitx_tmp_int
- { \int_incr:N \l_siunitx_tmp_int }
+ \bool_set_false:N \l_@@_round_even_bool
+ \int_if_even:nF \l_@@_tmp_int
+ { \int_incr:N \l_@@_tmp_int }
}
- { \int_incr:N \l_siunitx_tmp_int }
+ { \int_incr:N \l_@@_tmp_int }
}
- \bool_set_false:N \l_siunitx_round_bool
+ \bool_set_false:N \l_@@_round_bool
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\siunitx_number_process_round_tidy:n}
-% \begin{macro}[aux]{\siunitx_number_process_round_tidy_aux:w}
+% \begin{macro}{\@@_number_process_round_tidy:n}
+% \begin{macro}[aux]{\@@_number_process_round_tidy_aux:w}
% To put data back again: there is a check to see if the number has been
% r ounded to zero and a minimal value has been requested.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_round_tidy:n #1
+\cs_new_protected:Npn \@@_number_process_round_tidy:n #1
{
\int_compare:nNnTF
{
- 0 \l_siunitx_round_integer_out_tl +
- 0 \l_siunitx_round_decimal_out_tl
+ 0 \l_@@_round_integer_out_tl +
+ 0 \l_@@_round_decimal_out_tl
}
= \c_zero
{
- \str_if_eq:VnTF \l_siunitx_process_round_min_tl { 0 }
+ \str_if_eq:VnTF \l_@@_process_round_min_tl { 0 }
{
- \prop_put:Nnn \l_siunitx_number_in_prop { #1 -integer } { 0 }
- \prop_put:NnV \l_siunitx_number_in_prop { #1 -decimal }
- \l_siunitx_round_decimal_out_tl
+ \prop_put:Nnn \l_@@_number_in_prop { #1 -integer } { 0 }
+ \prop_put:NnV \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_round_decimal_out_tl
}
{
- \exp_after:wN \siunitx_number_process_round_tidy_aux:w
- \l_siunitx_process_round_min_tl . . \q_stop {#1}
+ \exp_after:wN \@@_number_process_round_tidy_aux:w
+ \l_@@_process_round_min_tl . . \q_stop {#1}
}
}
{
- \prop_put:NnV \l_siunitx_number_in_prop { #1 -integer }
- \l_siunitx_round_integer_out_tl
- \tl_if_empty:NTF \l_siunitx_round_decimal_out_tl
+ \prop_put:NnV \l_@@_number_in_prop { #1 -integer }
+ \l_@@_round_integer_out_tl
+ \tl_if_empty:NTF \l_@@_round_decimal_out_tl
{
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal }
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal-marker }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -decimal }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -decimal-marker }
}
{
- \prop_put:NnV \l_siunitx_number_in_prop { #1 -decimal }
- \l_siunitx_round_decimal_out_tl
+ \prop_put:NnV \l_@@_number_in_prop { #1 -decimal }
+ \l_@@_round_decimal_out_tl
}
}
}
-\cs_new_protected:Npn \siunitx_number_process_round_tidy_aux:w
+\cs_new_protected:Npn \@@_number_process_round_tidy_aux:w
#1 . #2 . #3 \q_stop #4
{
- \prop_put:Nnn \l_siunitx_number_in_prop { comparator } { < }
- \prop_put:Nnn \l_siunitx_number_in_prop { #4 -integer } {#1}
+ \prop_put:Nnn \l_@@_number_in_prop { comparator } { < }
+ \prop_put:Nnn \l_@@_number_in_prop { #4 -integer } {#1}
\tl_if_empty:nTF {#2}
- { \prop_del:Nn \l_siunitx_number_in_prop { #4 -decimal } }
- { \prop_put:Nnn \l_siunitx_number_in_prop { #4 -decimal } {#2} }
+ { \prop_del:Nn \l_@@_number_in_prop { #4 -decimal } }
+ { \prop_put:Nnn \l_@@_number_in_prop { #4 -decimal } {#2} }
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-%\begin{macro}{\siunitx_number_process_scientific:}
+%\begin{macro}{\@@_number_process_scientific:}
%\begin{macro}[aux]{
-% \siunitx_number_process_scientific_aux_i:nnn ,
-% \siunitx_number_process_scientific_aux_ii:nnn ,
-% \siunitx_number_process_scientific_large:nnn ,
-% \siunitx_number_process_scientific_small:wn ,
-% \siunitx_number_process_scientific_store:nnn ,
-% \siunitx_number_process_scientific_engineering:nnn ,
-% \siunitx_number_process_scientific_engineering_0:nnn ,
-% \siunitx_number_process_scientific_engineering_1:nnn ,
-% \siunitx_number_process_scientific_engineering_1:nw ,
-% \siunitx_number_process_scientific_engineering_2:nnn ,
-% \siunitx_number_process_scientific_engineering_2_i:nw ,
-% \siunitx_number_process_scientific_engineering_2_ii:nw
+% \@@_number_process_scientific_aux_i:nnn ,
+% \@@_number_process_scientific_aux_ii:nnn ,
+% \@@_number_process_scientific_large:nnn ,
+% \@@_number_process_scientific_small:wn ,
+% \@@_number_process_scientific_store:nnn ,
+% \@@_number_process_scientific_engineering:nnn ,
+% \@@_number_process_scientific_engineering_0:nnn ,
+% \@@_number_process_scientific_engineering_1:nnn ,
+% \@@_number_process_scientific_engineering_1:nw ,
+% \@@_number_process_scientific_engineering_2:nnn ,
+% \@@_number_process_scientific_engineering_2_i:nw ,
+% \@@_number_process_scientific_engineering_2_ii:nw
%}
% Converting a number to scientific form is done such that the number
% of places involved is unchanged. The first step is to skip any
% complex-number containing input and to recover the stored data.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_scientific: {
- \prop_if_in:NnF \l_siunitx_number_in_prop { complex }
- {
- \prop_get:NnNF \l_siunitx_number_in_prop { mantissa-integer }
- \l_siunitx_tmpa_tl
- { \tl_set:Nn \l_siunitx_tmpa_tl { 0 } }
- \prop_get:NnNF \l_siunitx_number_in_prop { mantissa-decimal }
- \l_siunitx_tmpb_tl
- { \tl_clear:N \l_siunitx_tmpb_tl }
- \tl_set:Nx \l_siunitx_tmpa_tl
- { { \l_siunitx_tmpa_tl } { \l_siunitx_tmpb_tl } }
- \prop_get:NnNF \l_siunitx_number_in_prop { exponent-integer }
- \l_siunitx_tmpb_tl
- { \tl_set:Nn \l_siunitx_tmpb_tl { 0 } }
+\cs_new_protected:Npn \@@_number_process_scientific: {
+ \prop_if_in:NnF \l_@@_number_in_prop { complex }
+ {
+ \prop_get:NnNF \l_@@_number_in_prop { mantissa-integer }
+ \l_@@_tmpa_tl
+ { \tl_set:Nn \l_@@_tmpa_tl { 0 } }
+ \prop_get:NnNF \l_@@_number_in_prop { mantissa-decimal }
+ \l_@@_tmpb_tl
+ { \tl_clear:N \l_@@_tmpb_tl }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { \l_@@_tmpa_tl } { \l_@@_tmpb_tl } }
+ \prop_get:NnNF \l_@@_number_in_prop { exponent-integer }
+ \l_@@_tmpb_tl
+ { \tl_set:Nn \l_@@_tmpb_tl { 0 } }
\group_begin:
- \prop_get:NnNT \l_siunitx_number_in_prop { exponent-sign }
- \l_siunitx_tmpa_tl
- { \tl_put_left:NV \l_siunitx_tmpb_tl \l_siunitx_tmpa_tl }
+ \prop_get:NnNT \l_@@_number_in_prop { exponent-sign }
+ \l_@@_tmpa_tl
+ { \tl_put_left:NV \l_@@_tmpb_tl \l_@@_tmpa_tl }
\exp_args:NNNV \group_end:
- \tl_set:Nn \l_siunitx_tmpb_tl \l_siunitx_tmpb_tl
- \tl_set:Nx \l_siunitx_tmpa_tl
- { \l_siunitx_tmpa_tl { \l_siunitx_tmpb_tl } }
- \exp_after:wN \siunitx_number_process_scientific_aux_i:nnn
- \l_siunitx_tmpa_tl
+ \tl_set:Nn \l_@@_tmpb_tl \l_@@_tmpb_tl
+ \tl_set:Nx \l_@@_tmpa_tl
+ { \l_@@_tmpa_tl { \l_@@_tmpb_tl } }
+ \exp_after:wN \@@_number_process_scientific_aux_i:nnn
+ \l_@@_tmpa_tl
}
}
-\cs_new_protected:Npn \siunitx_number_process_scientific_aux_i:nnn #1#2#3
+\cs_new_protected:Npn \@@_number_process_scientific_aux_i:nnn #1#2#3
{
- \bool_set_true:N \l_siunitx_tmp_bool
+ \bool_set_true:N \l_@@_tmp_bool
\tl_map_inline:nn {#1#2}
{
\str_if_eq:nnF {##1} { 0 }
{
- \bool_set_false:N \l_siunitx_tmp_bool
+ \bool_set_false:N \l_@@_tmp_bool
\tl_map_break:
}
}
- \bool_if:NF \l_siunitx_tmp_bool
- { \siunitx_number_process_scientific_aux_ii:nnn {#1} {#2} {#3} }
+ \bool_if:NF \l_@@_tmp_bool
+ { \@@_number_process_scientific_aux_ii:nnn {#1} {#2} {#3} }
}
% \end{macrocode}
% The code here works on a loop, standardising the mantissa into the
% range \( 1 \le x < 10 \).
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_number_process_scientific_aux_ii:nnn #1#2#3 {
+ \@@_number_process_scientific_aux_ii:nnn #1#2#3 {
\int_compare:nNnTF {#1} > { 9 }
- { \siunitx_number_process_scientific_large:nnn {#1} {#2} {#3} }
+ { \@@_number_process_scientific_large:nnn {#1} {#2} {#3} }
{
\int_compare:nNnTF {#1} > { 0 }
{
- \bool_if:NTF \l_siunitx_process_engineering_bool
- { \siunitx_number_process_scientific_engineering:nnn }
- { \siunitx_number_process_scientific_store:nnn }
+ \bool_if:NTF \l_@@_process_engineering_bool
+ { \@@_number_process_scientific_engineering:nnn }
+ { \@@_number_process_scientific_store:nnn }
{#1} {#2} {#3}
}
{
- \siunitx_number_process_scientific_small:wn
+ \@@_number_process_scientific_small:wn
#2 \q_stop {#3}
}
}
@@ -8784,67 +8790,67 @@ This work consists of the file siunitx.dtx
% in real cases this should not be an issue.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_number_process_scientific_large:nnn #1#2#3 {
- \int_set:Nn \l_siunitx_tmp_int { \int_div_truncate:nn {#1} { 10 } }
- \tl_set:Nx \l_siunitx_tmpa_tl { \int_use:N \l_siunitx_tmp_int }
- \int_set:Nn \l_siunitx_tmp_int { #1 - 10 * \l_siunitx_tmp_int }
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \@@_number_process_scientific_large:nnn #1#2#3 {
+ \int_set:Nn \l_@@_tmp_int { \int_div_truncate:nn {#1} { 10 } }
+ \tl_set:Nx \l_@@_tmpa_tl { \int_use:N \l_@@_tmp_int }
+ \int_set:Nn \l_@@_tmp_int { #1 - 10 * \l_@@_tmp_int }
+ \tl_set:Nx \l_@@_tmpa_tl
{
- { \l_siunitx_tmpa_tl } { \int_use:N \l_siunitx_tmp_int #2 }
+ { \l_@@_tmpa_tl } { \int_use:N \l_@@_tmp_int #2 }
{ #3 + 1 }
}
- \exp_after:wN \siunitx_number_process_scientific_aux_ii:nnn
- \l_siunitx_tmpa_tl
+ \exp_after:wN \@@_number_process_scientific_aux_ii:nnn
+ \l_@@_tmpa_tl
}
% \end{macrocode}
% For small numbers, the important digit is easy to find.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_number_process_scientific_small:wn #1#2 \q_stop #3
- { \siunitx_number_process_scientific_aux_ii:nnn {#1} {#2} { #3 - 1 } }
+ \@@_number_process_scientific_small:wn #1#2 \q_stop #3
+ { \@@_number_process_scientific_aux_ii:nnn {#1} {#2} { #3 - 1 } }
% \end{macrocode}
% A tidy-up and store routine.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_number_process_scientific_store:nnn #1#2#3
+ \@@_number_process_scientific_store:nnn #1#2#3
{
- \prop_put:Nnn \l_siunitx_number_in_prop { mantissa-integer } {#1}
+ \prop_put:Nnn \l_@@_number_in_prop { mantissa-integer } {#1}
\tl_if_empty:nTF {#2}
{
- \prop_del:Nn \l_siunitx_number_in_prop { mantissa-decimal }
- \prop_del:Nn \l_siunitx_number_in_prop
+ \prop_del:Nn \l_@@_number_in_prop { mantissa-decimal }
+ \prop_del:Nn \l_@@_number_in_prop
{ mantissa-decimal-marker }
}
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ mantissa-decimal } {#2}
- \prop_if_in:NnF \l_siunitx_number_in_prop
+ \prop_if_in:NnF \l_@@_number_in_prop
{ mantissa-decimal-marker }
{
- \prop_put:Nnn \l_siunitx_number_in_prop
+ \prop_put:Nnn \l_@@_number_in_prop
{ mantissa-decimal-marker } { . }
}
}
\int_compare:nNnTF {#3} = { 0 }
{
- \prop_del:Nn \l_siunitx_number_in_prop { exponent }
- \prop_del:Nn \l_siunitx_number_in_prop { exponent-sign }
- \prop_del:Nn \l_siunitx_number_in_prop { exponent-integer }
+ \prop_del:Nn \l_@@_number_in_prop { exponent }
+ \prop_del:Nn \l_@@_number_in_prop { exponent-sign }
+ \prop_del:Nn \l_@@_number_in_prop { exponent-integer }
}
{
- \prop_put:Nnn \l_siunitx_number_in_prop { exponent } { true }
+ \prop_put:Nnn \l_@@_number_in_prop { exponent } { true }
\int_compare:nNnTF {#3} > { 0 }
{
- \int_set:Nn \l_siunitx_tmp_int {#3}
- \prop_put:NnV \l_siunitx_number_in_prop
- { exponent-integer } \l_siunitx_tmp_int
- \prop_del:Nn \l_siunitx_number_in_prop { exponent-sign }
+ \int_set:Nn \l_@@_tmp_int {#3}
+ \prop_put:NnV \l_@@_number_in_prop
+ { exponent-integer } \l_@@_tmp_int
+ \prop_del:Nn \l_@@_number_in_prop { exponent-sign }
}
{
- \int_set:Nn \l_siunitx_tmp_int { 0 - (#3) }
- \prop_put:NnV \l_siunitx_number_in_prop
- { exponent-integer } \l_siunitx_tmp_int
- \prop_put:Nnn \l_siunitx_number_in_prop { exponent-sign }
+ \int_set:Nn \l_@@_tmp_int { 0 - (#3) }
+ \prop_put:NnV \l_@@_number_in_prop
+ { exponent-integer } \l_@@_tmp_int
+ \prop_put:Nnn \l_@@_number_in_prop { exponent-sign }
{ - }
}
}
@@ -8855,14 +8861,14 @@ This work consists of the file siunitx.dtx
% is known.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_number_process_scientific_engineering:nnn #1#2#3
+ \@@_number_process_scientific_engineering:nnn #1#2#3
{
\use:c
{
- siunitx_number_process_scientific_engineering_
+ @@_number_process_scientific_engineering_
\int_compare:nNnTF {#3} < { 0 }
{
- \prg_case_int:nnn { \int_mod:nn { 0 - (#3) } { 3 } }
+ \int_case:nnn { \int_mod:nn { 0 - (#3) } { 3 } }
{
{ 1 } { 2 }
{ 2 } { 1 }
@@ -8875,119 +8881,119 @@ This work consists of the file siunitx.dtx
{#1} {#2} {#3}
}
\cs_new_eq:cN
- { siunitx_number_process_scientific_engineering_0:nnn }
- \siunitx_number_process_scientific_store:nnn
+ { @@_number_process_scientific_engineering_0:nnn }
+ \@@_number_process_scientific_store:nnn
\cs_new_protected:cpn
- { siunitx_number_process_scientific_engineering_1:nnn } #1#2#3
+ { @@_number_process_scientific_engineering_1:nnn } #1#2#3
{
\tl_if_empty:nTF {#2}
{
- \siunitx_number_process_scientific_store:nnn { #1 0 } { }
+ \@@_number_process_scientific_store:nnn { #1 0 } { }
{ #3 - 1 }
}
{
\use:c
- { siunitx_number_process_scientific_engineering_1:nw }
+ { @@_number_process_scientific_engineering_1:nw }
{#1} #2 \q_stop {#3}
}
}
\cs_new_protected:cpn
- { siunitx_number_process_scientific_engineering_1:nw }
+ { @@_number_process_scientific_engineering_1:nw }
#1#2#3 \q_stop #4
{
- \siunitx_number_process_scientific_store:nnn
+ \@@_number_process_scientific_store:nnn
{#1#2} {#3} { #4 - 1 }
}
\cs_new_protected:cpn
- { siunitx_number_process_scientific_engineering_2:nnn } #1#2#3
+ { @@_number_process_scientific_engineering_2:nnn } #1#2#3
{
\tl_if_empty:nTF {#2}
{
- \siunitx_number_process_scientific_store:nnn { #1 00 } { }
+ \@@_number_process_scientific_store:nnn { #1 00 } { }
{ #3 - 2 }
}
{
\use:c
- { siunitx_number_process_scientific_engineering_2_i:nw }
+ { @@_number_process_scientific_engineering_2_i:nw }
{#1} #2 \q_stop {#3}
}
}
\cs_new_protected:cpn
- { siunitx_number_process_scientific_engineering_2_i:nw }
+ { @@_number_process_scientific_engineering_2_i:nw }
#1#2#3 \q_stop #4
{
\tl_if_empty:nTF {#3}
{
- \siunitx_number_process_scientific_store:nnn { #1#2 0 } { }
+ \@@_number_process_scientific_store:nnn { #1#2 0 } { }
{ #4 - 2 }
}
{
\use:c
- { siunitx_number_process_scientific_engineering_2_ii:nw }
+ { @@_number_process_scientific_engineering_2_ii:nw }
{#1#2} #3 \q_stop {#4}
}
}
\cs_new_protected:cpn
- { siunitx_number_process_scientific_engineering_2_ii:nw }
+ { @@_number_process_scientific_engineering_2_ii:nw }
#1#2#3 \q_stop #4
{
- \siunitx_number_process_scientific_store:nnn { #1#2 } {#3}
+ \@@_number_process_scientific_store:nnn { #1#2 } {#3}
{ #4 - 2 }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_process_sign:}
+%\begin{macro}{\@@_number_process_sign:}
%\begin{macro}[aux]{
-% \siunitx_number_process_sign_add:n ,
-% \siunitx_number_process_sign_plus:n
+% \@@_number_process_sign_add:n ,
+% \@@_number_process_sign_plus:n
%}
-%\begin{macro}{\c_siunitx_plus_tl}
+%\begin{macro}{\c_@@_plus_tl}
% Sorting out signs consists of two parts: retaining a plus if necessary
% and adding an explicit sign.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_sign: {
- \bool_if:NF \l_siunitx_process_plus_bool
+\cs_new_protected:Npn \@@_number_process_sign: {
+ \bool_if:NF \l_@@_process_plus_bool
{
- \prop_if_in:NnTF \l_siunitx_number_in_prop { mantissa-sign }
- { \siunitx_number_process_sign_plus:n { mantissa } }
+ \prop_if_in:NnTF \l_@@_number_in_prop { mantissa-sign }
+ { \@@_number_process_sign_plus:n { mantissa } }
{
- \prop_if_in:NnT \l_siunitx_number_in_prop { complex-sign }
+ \prop_if_in:NnT \l_@@_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:NnF \l_@@_number_in_prop { mantissa }
+ { \@@_number_process_sign_plus:n { complex } }
}
}
- \prop_if_in:NnT \l_siunitx_number_in_prop { exponent-sign }
- { \siunitx_number_process_sign_plus:n { exponent } }
+ \prop_if_in:NnT \l_@@_number_in_prop { exponent-sign }
+ { \@@_number_process_sign_plus:n { exponent } }
}
- \tl_if_empty:NF \l_siunitx_process_sign_tl
+ \tl_if_empty:NF \l_@@_process_sign_tl
{
- \siunitx_number_process_sign_add:n { mantissa }
- \prop_if_in:NnTF \l_siunitx_number_in_prop { complex }
- { \siunitx_number_process_sign_add:n { complex } }
+ \@@_number_process_sign_add:n { mantissa }
+ \prop_if_in:NnTF \l_@@_number_in_prop { complex }
+ { \@@_number_process_sign_add:n { complex } }
}
}
% \end{macrocode}
% Adding a sign to an existing number needs a couple of to make sure
% there is a number to add to, and to see if there is a sign already.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_sign_add:n #1 {
- \prop_if_in:NnF \l_siunitx_number_in_prop { #1 -sign }
+\cs_new_protected:Npn \@@_number_process_sign_add:n #1 {
+ \prop_if_in:NnF \l_@@_number_in_prop { #1 -sign }
{
- \prop_if_in:NnF \l_siunitx_number_in_prop { #1 -had-sign }
+ \prop_if_in:NnF \l_@@_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_get:NnN \l_@@_number_in_prop {#1}
+ \l_@@_tmpa_tl
+ \tl_if_empty:NTF \l_@@_tmpa_tl
{
- \prop_put:NnV \l_siunitx_number_in_prop { sign }
- \l_siunitx_process_sign_tl
+ \prop_put:NnV \l_@@_number_in_prop { sign }
+ \l_@@_process_sign_tl
}
{
- \prop_put:NnV \l_siunitx_number_in_prop { #1 -sign }
- \l_siunitx_process_sign_tl
+ \prop_put:NnV \l_@@_number_in_prop { #1 -sign }
+ \l_@@_process_sign_tl
}
}
}
@@ -8997,195 +9003,195 @@ This work consists of the file siunitx.dtx
% some quick tests and an assignment. Using a pre-defined token list is
% a speed-related choice: very slightly faster comparison.
% \begin{macrocode}
-\cs_new_protected: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
+\cs_new_protected:Npn \@@_number_process_sign_plus:n #1 {
+ \prop_get:NnN \l_@@_number_in_prop { #1 -sign }
+ \l_@@_tmpa_tl
+ \tl_if_eq:NNT \c_@@_plus_tl \l_@@_tmpa_tl
{
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -sign }
- \prop_put:Nnn \l_siunitx_number_in_prop { #1 -had-sign } { true }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -sign }
+ \prop_put:Nnn \l_@@_number_in_prop { #1 -had-sign } { true }
}
}
-\tl_new:N \c_siunitx_plus_tl
-\tl_set:Nn \c_siunitx_plus_tl { + }
+\tl_new:N \c_@@_plus_tl
+\tl_set:Nn \c_@@_plus_tl { + }
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_process_uncertainty:}
-%\begin{macro}[aux]{\siunitx_number_process_uncertainty_aux:n}
+%\begin{macro}{\@@_number_process_uncertainty:}
+%\begin{macro}[aux]{\@@_number_process_uncertainty_aux:n}
% There may be a need to expand uncertainties into a decimal and integer
% part. This is done here so that the core \texttt{in} code is faster.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_uncertainty: {
+\cs_new_protected:Npn \@@_number_process_uncertainty: {
\clist_map_function:nN { mantissa , complex }
- \siunitx_number_process_uncertainty_aux:n
+ \@@_number_process_uncertainty_aux:n
}
\cs_new_protected:Npn
- \siunitx_number_process_uncertainty_aux:n #1 {
- \prop_if_in:NnT \l_siunitx_number_in_prop { #1 -uncertainty }
+ \@@_number_process_uncertainty_aux:n #1 {
+ \prop_if_in:NnT \l_@@_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} }
+ \prop_if_in:NnTF \l_@@_number_in_prop { #1 -decimal-marker }
+ { \@@_number_process_uncertainty_decimal:n {#1} }
+ { \@@_number_process_uncertainty_integer:n {#1} }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\begin{macro}{\siunitx_number_process_uncertainty_decimal:n}
-%\begin{macro}[aux]{\siunitx_number_process_uncertainty_count:nn}
+%\begin{macro}{\@@_number_process_uncertainty_decimal:n}
+%\begin{macro}[aux]{\@@_number_process_uncertainty_count:nn}
% To deal with an error in the decimal part, care needs to be taken to
% correctly pad with zeros and also to allow for the possibility that
% the error crosses the decimal--integer boundary.
% \begin{macrocode}
\cs_new_protected: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
+ \@@_number_process_uncertainty_decimal:n #1 {
+ \@@_number_process_uncertainty_count:nn {#1} { decimal }
+ \@@_number_process_uncertainty_count:nn {#1} { uncertainty }
+ \tl_clear:N \l_@@_uncertainty_decimal_tl
+ \tl_clear:N \l_@@_uncertainty_integer_tl
\int_compare:nNnTF
- { \l_siunitx_process_uncertainty_int } >
- { \l_siunitx_process_decimal_int }
- { \siunitx_number_process_uncertainty_separate: }
- { \siunitx_number_process_uncertainty_pad: }
- \tl_if_empty:NF \l_siunitx_uncertainty_integer_tl
+ { \l_@@_process_uncertainty_int } >
+ { \l_@@_process_decimal_int }
+ { \@@_number_process_uncertainty_separate: }
+ { \@@_number_process_uncertainty_pad: }
+ \tl_if_empty:NF \l_@@_uncertainty_integer_tl
{
- \prop_put:NnV \l_siunitx_number_in_prop
+ \prop_put:NnV \l_@@_number_in_prop
{ #1 -uncertainty-integer }
- \l_siunitx_uncertainty_integer_tl
+ \l_@@_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
+ \prop_put:NnV \l_@@_number_in_prop { #1 -uncertainty-decimal }
+ \l_@@_uncertainty_decimal_tl
+ \prop_get:NnN \l_@@_number_in_prop { #1 -decimal-marker }
+ \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_in_prop
+ { #1 -uncertainty-decimal-marker } \l_@@_tmpa_tl
}
\cs_new_protected: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_length:N \l_siunitx_tmpa_tl }
+ \@@_number_process_uncertainty_count:nn #1#2 {
+ \prop_get:NnN \l_@@_number_in_prop { #1 - #2 }
+ \l_@@_tmpa_tl
+ \int_set:cn { l_@@_process_ #2 _int }
+ { \tl_length:N \l_@@_tmpa_tl }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\begin{macro}{\siunitx_number_process_uncertainty_pad:}
+%\begin{macro}{\@@_number_process_uncertainty_pad:}
% Uncertainty is short: add zeros.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_uncertainty_pad: {
+\cs_new_protected:Npn \@@_number_process_uncertainty_pad: {
\int_while_do:nNnn
- { \l_siunitx_process_uncertainty_int } <
- { \l_siunitx_process_decimal_int }
+ { \l_@@_process_uncertainty_int } <
+ { \l_@@_process_decimal_int }
{
- \tl_put_right:Nn \l_siunitx_uncertainty_decimal_tl {0}
- \int_incr:N \l_siunitx_process_uncertainty_int
+ \tl_put_right:Nn \l_@@_uncertainty_decimal_tl {0}
+ \int_incr:N \l_@@_process_uncertainty_int
}
- \tl_put_right:NV \l_siunitx_uncertainty_decimal_tl
- \l_siunitx_tmpa_tl
+ \tl_put_right:NV \l_@@_uncertainty_decimal_tl
+ \l_@@_tmpa_tl
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_number_process_uncertainty_separate:}
-%\begin{macro}[aux]{\siunitx_number_process_uncertainty_separate_aux:N}
+%\begin{macro}{\@@_number_process_uncertainty_separate:}
+%\begin{macro}[aux]{\@@_number_process_uncertainty_separate_aux:N}
% Find the integer--decimal boundary and work appropriately.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_number_process_uncertainty_separate: {
- \tl_map_function:NN \l_siunitx_tmpa_tl
- \siunitx_number_process_uncertainty_separate_aux:N
+ \@@_number_process_uncertainty_separate: {
+ \tl_map_function:NN \l_@@_tmpa_tl
+ \@@_number_process_uncertainty_separate_aux:N
}
\cs_new_protected:Npn
- \siunitx_number_process_uncertainty_separate_aux:N #1 {
+ \@@_number_process_uncertainty_separate_aux:N #1 {
\int_compare:nNnTF
- { \l_siunitx_process_uncertainty_int } >
- { \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
+ { \l_@@_process_uncertainty_int } >
+ { \l_@@_process_decimal_int }
+ { \tl_put_right:Nn \l_@@_uncertainty_integer_tl {#1} }
+ { \tl_put_right:Nn \l_@@_uncertainty_decimal_tl {#1} }
+ \int_decr:N \l_@@_process_uncertainty_int
}
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\begin{macro}{\siunitx_number_process_uncertainty_integer:n}
+%\begin{macro}{\@@_number_process_uncertainty_integer:n}
% Relatively easy: the uncertainty is in the integer part of the number,
% and so there is no need to generate zeros.
% \begin{macrocode}
\cs_new_protected: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
+ \@@_number_process_uncertainty_integer:n #1 {
+ \prop_get:NnN \l_@@_number_in_prop { #1 -uncertainty }
+ \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_in_prop { #1 -uncertainty-integer }
+ \l_@@_tmpa_tl
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_process_zero_fill:}
+%\begin{macro}{\@@_number_process_zero_fill:}
%\begin{macro}[aux]{
-% \siunitx_number_process_zero_fill_aux:n ,
-% \siunitx_number_process_zero_fill_aux:nn
+% \@@_number_process_zero_fill_aux:n ,
+% \@@_number_process_zero_fill_aux:nn
%}
% Checks for adding zeros to each component are carried out. The nesting
% here makes checking the appropriate flag a little more efficient.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_process_zero_fill: {
- \siunitx_number_process_zero_fill_aux:n { integer }
- \siunitx_number_process_zero_fill_aux:n { decimal }
+\cs_new_protected:Npn \@@_number_process_zero_fill: {
+ \@@_number_process_zero_fill_aux:n { integer }
+ \@@_number_process_zero_fill_aux:n { decimal }
}
-\cs_new:Npn \siunitx_number_process_zero_fill_aux:n #1 {
- \bool_if:cT { l_siunitx_process_ #1 _zero_bool }
+\cs_new:Npn \@@_number_process_zero_fill_aux:n #1 {
+ \bool_if:cT { l_@@_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}
+ \@@_number_process_zero_fill_aux:nn { mantissa } {#1}
+ \@@_number_process_zero_fill_aux:nn { complex } {#1}
+ \@@_number_process_zero_fill_aux:nn { exponent } {#1}
}
}
\cs_new_protected:Npn
- \siunitx_number_process_zero_fill_aux:nn #1#2 {
- \prop_if_in:NnT \l_siunitx_number_in_prop { #1 -decimal-marker }
+ \@@_number_process_zero_fill_aux:nn #1#2 {
+ \prop_if_in:NnT \l_@@_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_if_in:NnF \l_@@_number_in_prop { #1 - #2 }
+ { \prop_put:Nnn \l_@@_number_in_prop { #1 - #2 } { 0 } }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-% \begin{macro}{\siunitx_number_process_zero_to_integer:}
-% \begin{macro}[aux]{\siunitx_number_process_zero_to_integer_aux:n}
+% \begin{macro}{\@@_number_process_zero_to_integer:}
+% \begin{macro}[aux]{\@@_number_process_zero_to_integer_aux:n}
% Look for a decimal part which is simply zero, and if found delete it.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \siunitx_number_process_zero_to_integer:
+\cs_new_protected_nopar:Npn \@@_number_process_zero_to_integer:
{
- \bool_if:NT \l_siunitx_zero_decimal_to_integer_bool
+ \bool_if:NT \l_@@_zero_decimal_to_integer_bool
{
- \siunitx_number_process_zero_to_integer_aux:n { mantissa }
- \siunitx_number_process_zero_to_integer_aux:n { complex }
+ \@@_number_process_zero_to_integer_aux:n { mantissa }
+ \@@_number_process_zero_to_integer_aux:n { complex }
}
}
-\cs_new_protected:Npn \siunitx_number_process_zero_to_integer_aux:n #1
+\cs_new_protected:Npn \@@_number_process_zero_to_integer_aux:n #1
{
- \prop_get:NnNT \l_siunitx_number_in_prop { #1 -decimal } \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { #1 -decimal } \l_@@_tmpa_tl
{
- \bool_set_true:N \l_siunitx_tmp_bool
- \tl_map_inline:Nn \l_siunitx_tmpa_tl
+ \bool_set_true:N \l_@@_tmp_bool
+ \tl_map_inline:Nn \l_@@_tmpa_tl
{
\str_if_eq:nnF {##1} { 0 }
{
- \bool_set_false:N \l_siunitx_tmp_bool
+ \bool_set_false:N \l_@@_tmp_bool
\tl_map_break:
}
}
- \bool_if:NT \l_siunitx_tmp_bool
+ \bool_if:NT \l_@@_tmp_bool
{
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal }
- \prop_del:Nn \l_siunitx_number_in_prop { #1 -decimal-marker }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -decimal }
+ \prop_del:Nn \l_@@_number_in_prop { #1 -decimal-marker }
}
}
}
@@ -9193,43 +9199,43 @@ This work consists of the file siunitx.dtx
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\siunitx_number_exp_to_prefix:}
+% \begin{macro}{\@@_number_exp_to_prefix:}
% This function is a bit awkward, as it essentially cuts across the
% unit processor. The idea here is first to recover the numerical exponent,
% and sign if there is one.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_exp_to_prefix:
+\cs_new_protected:Npn \@@_number_exp_to_prefix:
{
- \prop_set_eq:NN \l_siunitx_unit_prop \l_siunitx_unit_saved_prop
- \prop_get:NnNT \l_siunitx_number_in_prop { exponent-integer }
- \l_siunitx_tmpa_tl
+ \prop_set_eq:NN \l_@@_unit_prop \l_@@_unit_saved_prop
+ \prop_get:NnNT \l_@@_number_in_prop { exponent-integer }
+ \l_@@_tmpa_tl
{
- \prop_get:NnNT \l_siunitx_number_in_prop { exponent-sign }
- \l_siunitx_tmpb_tl
- { \tl_put_left:NV \l_siunitx_tmpa_tl \l_siunitx_tmpb_tl }
- \prop_get:NnNT \l_siunitx_unit_prop { prefix-1 } \l_siunitx_tmpb_tl
+ \prop_get:NnNT \l_@@_number_in_prop { exponent-sign }
+ \l_@@_tmpb_tl
+ { \tl_put_left:NV \l_@@_tmpa_tl \l_@@_tmpb_tl }
+ \prop_get:NnNT \l_@@_unit_prop { prefix-1 } \l_@@_tmpb_tl
{
- \prop_del:Nn \l_siunitx_unit_prop { prefix-1 }
- \prop_del:Nn \l_siunitx_unit_prop { prefix-symbol-1 }
- \prop_get:NVN \l_siunitx_prefix_forward_prop \l_siunitx_tmpb_tl
- \l_siunitx_tmpb_tl
- \tl_set:Nx \l_siunitx_tmpa_tl
- { \int_eval:n { \l_siunitx_tmpa_tl + \l_siunitx_tmpb_tl } }
+ \prop_del:Nn \l_@@_unit_prop { prefix-1 }
+ \prop_del:Nn \l_@@_unit_prop { prefix-symbol-1 }
+ \prop_get:NVN \l_@@_prefix_forward_prop \l_@@_tmpb_tl
+ \l_@@_tmpb_tl
+ \tl_set:Nx \l_@@_tmpa_tl
+ { \int_eval:n { \l_@@_tmpa_tl + \l_@@_tmpb_tl } }
}
- \prop_get:NVNTF \l_siunitx_prefix_reverse_prop \l_siunitx_tmpa_tl
- \l_siunitx_tmpb_tl
+ \prop_get:NVNTF \l_@@_prefix_reverse_prop \l_@@_tmpa_tl
+ \l_@@_tmpb_tl
{
- \prop_del:Nn \l_siunitx_number_in_prop { exponent }
+ \prop_del:Nn \l_@@_number_in_prop { exponent }
\use:c
{
- siunitx_ \exp_after:wN \token_to_str:N \l_siunitx_tmpb_tl
+ @@_ \exp_after:wN \token_to_str:N \l_@@_tmpb_tl
_function:w
}
- \siunitx_unit_format:
+ \@@_unit_format:
}
{
\msg_error:nnx { siunitx } { non-convertible-exponent }
- { \l_siunitx_tmpa_tl }
+ { \l_@@_tmpa_tl }
}
}
}
@@ -9245,106 +9251,106 @@ This work consists of the file siunitx.dtx
% \texttt{out} store is that the later can include formatting such as
% hard spaces.
%
-%\begin{macro}{\l_siunitx_number_out_prop}
+%\begin{macro}{\l_@@_number_out_prop}
% Like the \texttt{in} version!
% \begin{macrocode}
-\prop_new:N \l_siunitx_number_out_prop
+\prop_new:N \l_@@_number_out_prop
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_group_sep_tl ,
-% \l_siunitx_output_decimal_tl
+% \l_@@_group_sep_tl ,
+% \l_@@_output_decimal_tl
%}
% A couple of variables are declared here, as they need a little more
% work than just storage.
% \begin{macrocode}
-\tl_new:N \l_siunitx_group_sep_tl
-\tl_new:N \l_siunitx_output_decimal_tl
+\tl_new:N \l_@@_group_sep_tl
+\tl_new:N \l_@@_output_decimal_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_complex_after_bool}
+%\begin{macro}{\l_@@_complex_after_bool}
% A setting for where complex numbers go.
% \begin{macrocode}
-\bool_new:N \l_siunitx_complex_after_bool
+\bool_new:N \l_@@_complex_after_bool
% \end{macrocode}
%\end{macro}
%
% \begin{variable}
-% {\l_siunitx_group_decimal_bool, \l_siunitx_group_integer_bool}
+% {\l_@@_group_decimal_bool, \l_@@_group_integer_bool}
% Used for grouping digits.
% \begin{macrocode}
-\bool_new:N \l_siunitx_group_decimal_bool
-\bool_new:N \l_siunitx_group_integer_bool
+\bool_new:N \l_@@_group_decimal_bool
+\bool_new:N \l_@@_group_integer_bool
% \end{macrocode}
% \end{variable}
%
%\begin{macro}{
-% \l_siunitx_negative_bracket_bool ,
-% \l_siunitx_brackets_bool ,
-% \l_siunitx_bracket_close_tl ,
-% \l_siunitx_output_complex_copy_bool ,
-% \l_siunitx_output_decimal_copy_bool ,
-% \l_siunitx_exponent_base_tl ,
-% \l_siunitx_exponent_product_tl ,
-% \l_siunitx_group_min_int ,
-% \l_siunitx_negative_color_tl ,
-% \l_siunitx_bracket_open_tl ,
-% \l_siunitx_output_uncert_close_tl ,
-% \l_siunitx_output_complex_tl ,
-% \l_siunitx_output_exponent_tl ,
-% \l_siunitx_output_uncert_open_tl ,
-% \l_siunitx_uncert_sep_bool ,
-% \l_siunitx_tight_bool ,
-% \l_siunitx_uncert_sep_tl
+% \l_@@_negative_bracket_bool ,
+% \l_@@_brackets_bool ,
+% \l_@@_bracket_close_tl ,
+% \l_@@_output_complex_copy_bool ,
+% \l_@@_output_decimal_copy_bool ,
+% \l_@@_exponent_base_tl ,
+% \l_@@_exponent_product_tl ,
+% \l_@@_group_min_int ,
+% \l_@@_negative_color_tl ,
+% \l_@@_bracket_open_tl ,
+% \l_@@_output_uncert_close_tl ,
+% \l_@@_output_complex_tl ,
+% \l_@@_output_exponent_tl ,
+% \l_@@_output_uncert_open_tl ,
+% \l_@@_uncert_sep_bool ,
+% \l_@@_tight_bool ,
+% \l_@@_uncert_sep_tl
%}
% Lots of settings, some used only for numbers, some more widely.
% \begin{macrocode}
\keys_define:nn { siunitx } {
bracket-negative-numbers .bool_set:N =
- \l_siunitx_negative_bracket_bool ,
- bracket-numbers .bool_set:N = \l_siunitx_brackets_bool,
- close-bracket .tl_set:N = \l_siunitx_bracket_close_tl,
+ \l_@@_negative_bracket_bool ,
+ bracket-numbers .bool_set:N = \l_@@_brackets_bool,
+ close-bracket .tl_set:N = \l_@@_bracket_close_tl,
complex-root-position .choice:,
complex-root-position
/ after-number .code:n =
- { \bool_set_true:N \l_siunitx_complex_after_bool } ,
+ { \bool_set_true:N \l_@@_complex_after_bool } ,
complex-root-position
/ before-number .code:n =
- { \bool_set_false:N \l_siunitx_complex_after_bool } ,
+ { \bool_set_false:N \l_@@_complex_after_bool } ,
copy-complex-root .bool_set:N =
- \l_siunitx_output_complex_copy_bool,
+ \l_@@_output_complex_copy_bool,
copy-decimal-marker .bool_set:N =
- \l_siunitx_output_decimal_copy_bool,
- exponent-base .tl_set:N = \l_siunitx_exponent_base_tl,
+ \l_@@_output_decimal_copy_bool,
+ exponent-base .tl_set:N = \l_@@_exponent_base_tl,
exponent-product .tl_set:N =
- \l_siunitx_exponent_product_tl,
+ \l_@@_exponent_product_tl,
group-decimal-digits .meta:n = { group-digits = decimal },
group-digits .choice: ,
group-digits /
decimal .code:n =
{
- \bool_set_true:N \l_siunitx_group_decimal_bool
- \bool_set_false:N \l_siunitx_group_integer_bool
+ \bool_set_true:N \l_@@_group_decimal_bool
+ \bool_set_false:N \l_@@_group_integer_bool
},
group-digits /
false .code:n =
{
- \bool_set_false:N \l_siunitx_group_decimal_bool
- \bool_set_false:N \l_siunitx_group_integer_bool
+ \bool_set_false:N \l_@@_group_decimal_bool
+ \bool_set_false:N \l_@@_group_integer_bool
},
group-digits /
integer .code:n =
{
- \bool_set_false:N \l_siunitx_group_decimal_bool
- \bool_set_true:N \l_siunitx_group_integer_bool
+ \bool_set_false:N \l_@@_group_decimal_bool
+ \bool_set_true:N \l_@@_group_integer_bool
},
group-digits /
true .code:n =
{
- \bool_set_true:N \l_siunitx_group_decimal_bool
- \bool_set_true:N \l_siunitx_group_integer_bool
+ \bool_set_true:N \l_@@_group_decimal_bool
+ \bool_set_true:N \l_@@_group_integer_bool
},
group-digits .default:n = true ,
group-four-digits .choice:,
@@ -9354,22 +9360,22 @@ This work consists of the file siunitx.dtx
true .meta:n = { group-minimum-digits = 4 },
group-four-digits .default:n = true,
group-integer-digits .meta:n = { group-digits = integer },
- group-minimum-digits .int_set:N = \l_siunitx_group_min_int,
+ group-minimum-digits .int_set:N = \l_@@_group_min_int,
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,
+ { \tl_set:Nn \l_@@_group_sep_tl { {#1} } },
+ negative-color .tl_set:N = \l_@@_negative_color_tl,
+ open-bracket .tl_set:N = \l_@@_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 ,
+ \l_@@_output_uncert_close_tl,
+ output-complex-root .tl_set:N = \l_@@_output_complex_tl ,
output-decimal-marker .code:n =
- { \tl_set:Nn \l_siunitx_output_decimal_tl { {#1} } },
- output-exponent-marker .tl_set:N = \l_siunitx_output_exponent_tl,
+ { \tl_set:Nn \l_@@_output_decimal_tl { {#1} } },
+ output-exponent-marker .tl_set:N = \l_@@_output_exponent_tl,
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,
+ \l_@@_output_uncert_open_tl,
+ separate-uncertainty .bool_set:N = \l_@@_uncert_sep_bool,
+ tight-spacing .bool_set:N = \l_@@_tight_bool,
+ uncertainty-separator .tl_set:N = \l_@@_uncert_sep_tl,
}
\keys_set:nn { siunitx }
{
@@ -9391,79 +9397,79 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format:}
+%\begin{macro}{\@@_number_format:}
% The master control function for formatting output: the usual set up.
% The number is put back together in stages.
% \begin{macrocode}
-\cs_new_protected: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_relation:
- \siunitx_number_format_color:
- \siunitx_number_format_final:
+\cs_new_protected:Npn \@@_number_format: {
+ \prop_if_empty:NF \l_@@_number_in_prop
+ {
+ \prop_clear:N \l_@@_number_out_prop
+ \@@_number_format_reassemble:
+ \@@_number_format_complex:
+ \@@_number_format_sign:n { mantissa }
+ \@@_number_format_sign:n { exponent }
+ \@@_number_format_relation:
+ \@@_number_format_color:
+ \@@_number_format_final:
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_brackets:n}
-%\begin{macro}[aux]{\siunitx_number_format_brackets_aux:n}
+%\begin{macro}{\@@_number_format_brackets:n}
+%\begin{macro}[aux]{\@@_number_format_brackets_aux:n}
% There are various points at which brackets might be added to
% avoid ambiguity. The function here adds the appropriate tokens
% around whatever is in the supplied named store.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_brackets:n #1 {
- \bool_if:NT \l_siunitx_brackets_bool
+\cs_new_protected:Npn \@@_number_format_brackets:n #1 {
+ \bool_if:NT \l_@@_brackets_bool
{
- \prop_if_in:NnT \l_siunitx_number_out_prop { #1 -bracket }
+ \prop_if_in:NnT \l_@@_number_out_prop { #1 -bracket }
{
- \siunitx_number_format_brackets_aux:n {#1}
- \prop_del:Nn \l_siunitx_number_out_prop { #1 -bracket }
+ \@@_number_format_brackets_aux:n {#1}
+ \prop_del:Nn \l_@@_number_out_prop { #1 -bracket }
}
}
}
-\cs_new_protected:Npn \siunitx_number_format_brackets_aux:n #1 {
- \prop_get:NnNF \l_siunitx_number_out_prop { #1 -result }
- \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_format_brackets_aux:n #1 {
+ \prop_get:NnNF \l_@@_number_out_prop { #1 -result }
+ \l_@@_tmpa_tl
{
- \prop_get:NnN \l_siunitx_number_out_prop {#1} \l_siunitx_tmpa_tl
+ \prop_get:NnN \l_@@_number_out_prop {#1} \l_@@_tmpa_tl
}
- \tl_put_left:NV \l_siunitx_tmpa_tl \l_siunitx_bracket_open_tl
- \tl_put_right:NV \l_siunitx_tmpa_tl \l_siunitx_bracket_close_tl
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_bracket_open_tl
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_bracket_close_tl
\str_if_eq:nnTF {#1} { result }
- { \prop_put:NnV \l_siunitx_number_out_prop {#1} \l_siunitx_tmpa_tl }
+ { \prop_put:NnV \l_@@_number_out_prop {#1} \l_@@_tmpa_tl }
{
- \prop_put:NnV \l_siunitx_number_out_prop { #1 -result }
- \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { #1 -result }
+ \l_@@_tmpa_tl
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_color:}
-%\begin{macro}[aux]{\siunitx_number_format_color_aux:n}
+%\begin{macro}{\@@_number_format_color:}
+%\begin{macro}[aux]{\@@_number_format_color_aux:n}
% If the mantissa is negative, then any colour for output might change.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_color: {
- \tl_if_empty:NF \l_siunitx_negative_color_tl
+\cs_new_protected:Npn \@@_number_format_color: {
+ \tl_if_empty:NF \l_@@_negative_color_tl
{
- \siunitx_number_format_color_aux:n { mantissa-sign }
- \siunitx_number_format_color_aux:n { sign }
+ \@@_number_format_color_aux:n { mantissa-sign }
+ \@@_number_format_color_aux:n { sign }
}
}
-\cs_new_protected:Npn \siunitx_number_format_color_aux:n #1 {
- \prop_get:NnNT \l_siunitx_number_in_prop {#1} \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_format_color_aux:n #1 {
+ \prop_get:NnNT \l_@@_number_in_prop {#1} \l_@@_tmpa_tl
{
- \str_if_eq:VnT \l_siunitx_tmpa_tl { - }
+ \str_if_eq:VnT \l_@@_tmpa_tl { - }
{
- \prop_put:NnV \l_siunitx_number_out_prop { color }
- \l_siunitx_negative_color_tl
+ \prop_put:NnV \l_@@_number_out_prop { color }
+ \l_@@_negative_color_tl
}
}
}
@@ -9471,71 +9477,71 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_complex:}
+%\begin{macro}{\@@_number_format_complex:}
%\begin{macro}[aux]{
-% \siunitx_number_format_complex_aux:n ,
-% \siunitx_number_format_complex_aux:
+% \@@_number_format_complex_aux:n ,
+% \@@_number_format_complex_aux:
%}
% The real and complex parts of each number are reassembled, with
% brackets if needed.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_complex: {
- \prop_if_in:NnT \l_siunitx_number_in_prop { complex-root }
+\cs_new_protected:Npn \@@_number_format_complex: {
+ \prop_if_in:NnT \l_@@_number_in_prop { complex-root }
{
- \prop_if_in:NnTF \l_siunitx_number_out_prop { complex }
+ \prop_if_in:NnTF \l_@@_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
+ \@@_number_format_brackets:n { complex }
+ \@@_number_format_complex_aux:n { complex }
+ \@@_number_format_complex_aux:n { complex-result }
+ \prop_if_in:NnT \l_@@_number_out_prop
{ complex-uncertainty }
{
- \siunitx_number_format_complex_aux:n
+ \@@_number_format_complex_aux:n
{ complex-uncertainty }
}
}
{
- \prop_put:NnV \l_siunitx_number_out_prop { complex }
- \l_siunitx_output_complex_tl
+ \prop_put:NnV \l_@@_number_out_prop { complex }
+ \l_@@_output_complex_tl
}
- \siunitx_number_format_join_complex:
+ \@@_number_format_join_complex:
}
}
-\cs_new_protected:Npn \siunitx_number_format_complex_aux:n #1 {
- \bool_if:NTF \l_siunitx_output_complex_copy_bool
+\cs_new_protected:Npn \@@_number_format_complex_aux:n #1 {
+ \bool_if:NTF \l_@@_output_complex_copy_bool
{
- \prop_get:NnN \l_siunitx_number_in_prop { complex-root }
- \l_siunitx_tmpa_tl
+ \prop_get:NnN \l_@@_number_in_prop { complex-root }
+ \l_@@_tmpa_tl
}
- { \tl_set_eq:NN \l_siunitx_tmpa_tl \l_siunitx_output_complex_tl }
- \prop_get:NnN \l_siunitx_number_out_prop {#1} \l_siunitx_tmpb_tl
- \bool_if:NTF \l_siunitx_complex_after_bool
- { \tl_put_right:NV \l_siunitx_tmpb_tl \l_siunitx_tmpa_tl }
- { \tl_put_left:NV \l_siunitx_tmpb_tl \l_siunitx_tmpa_tl }
- \prop_put:NnV \l_siunitx_number_out_prop {#1} \l_siunitx_tmpb_tl
+ { \tl_set_eq:NN \l_@@_tmpa_tl \l_@@_output_complex_tl }
+ \prop_get:NnN \l_@@_number_out_prop {#1} \l_@@_tmpb_tl
+ \bool_if:NTF \l_@@_complex_after_bool
+ { \tl_put_right:NV \l_@@_tmpb_tl \l_@@_tmpa_tl }
+ { \tl_put_left:NV \l_@@_tmpb_tl \l_@@_tmpa_tl }
+ \prop_put:NnV \l_@@_number_out_prop {#1} \l_@@_tmpb_tl
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_format_copy:n ,
-% \siunitx_number_format_copy:nn
+% \@@_number_format_copy:n ,
+% \@@_number_format_copy:nn
%}
% Just copy across.
% \begin{macrocode}
-\cs_new_protected: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_new_protected:Npn \@@_number_format_copy:n #1 {
+ \prop_get:NnN \l_@@_number_in_prop {#1} \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop {#1} \l_@@_tmpa_tl
}
-\cs_new_protected: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_new_protected:Npn \@@_number_format_copy:nn #1#2 {
+ \prop_get:NnN \l_@@_number_out_prop {#1} \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop {#2} \l_@@_tmpa_tl
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_final:}
+%\begin{macro}{\@@_number_format_final:}
% For numbers which do not contain an exponent, the mantissa result is
% simply copied to the final output position. On the other hand, for
% exponents there are further checks, which are handed off to dedicated
@@ -9543,213 +9549,213 @@ This work consists of the file siunitx.dtx
% part, which needs to be \enquote{copied} to the standard result
% slot.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_final: {
- \prop_if_in:NnT \l_siunitx_number_out_prop { complex }
+\cs_new_protected:Npn \@@_number_format_final: {
+ \prop_if_in:NnT \l_@@_number_out_prop { complex }
{
- \prop_if_in:NnF \l_siunitx_number_out_prop { mantissa-result }
+ \prop_if_in:NnF \l_@@_number_out_prop { mantissa-result }
{
- \siunitx_number_format_copy:nn { complex }
+ \@@_number_format_copy:nn { complex }
{ mantissa-result }
}
}
- \prop_if_in:NnTF \l_siunitx_number_out_prop { exponent }
+ \prop_if_in:NnTF \l_@@_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: }
+ \@@_number_format_final_exponent:
+ \prop_if_in:NnTF \l_@@_number_out_prop { mantissa-result }
+ { \@@_number_format_final_combined: }
+ { \@@_number_format_final_exponent_only: }
}
- { \siunitx_number_format_copy:nn { mantissa-result } { result } }
- \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa-bracket }
+ { \@@_number_format_copy:nn { mantissa-result } { result } }
+ \prop_if_in:NnT \l_@@_number_out_prop { mantissa-bracket }
{
- \prop_put:Nnn \l_siunitx_number_out_prop { result-bracket }
+ \prop_put:Nnn \l_@@_number_out_prop { result-bracket }
{ true }
- \prop_del:Nn \l_siunitx_number_out_prop { mantissa-bracket }
+ \prop_del:Nn \l_@@_number_out_prop { mantissa-bracket }
}
- \prop_if_in:NnT \l_siunitx_number_out_prop { comparator }
- {
- \siunitx_number_format_brackets:n { result }
- \prop_get:NnN \l_siunitx_number_out_prop { comparator }
- \l_siunitx_tmpa_tl
- \prop_get:NnN \l_siunitx_number_out_prop { result }
- \l_siunitx_tmpb_tl
- \tl_put_right:No \l_siunitx_tmpa_tl { \l_siunitx_tmpb_tl }
- \prop_put:NnV \l_siunitx_number_out_prop { result }
- \l_siunitx_tmpa_tl
+ \prop_if_in:NnT \l_@@_number_out_prop { comparator }
+ {
+ \@@_number_format_brackets:n { result }
+ \prop_get:NnN \l_@@_number_out_prop { comparator }
+ \l_@@_tmpa_tl
+ \prop_get:NnN \l_@@_number_out_prop { result }
+ \l_@@_tmpb_tl
+ \tl_put_right:No \l_@@_tmpa_tl { \l_@@_tmpb_tl }
+ \prop_put:NnV \l_@@_number_out_prop { result }
+ \l_@@_tmpa_tl
}
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_number_format_final_combined:}
+%\begin{macro}{\@@_number_format_final_combined:}
% When there is both a mantissa and an exponent, the mantissa is
% combined with the product sign before adding the exponent part on.
% The combined result is then stored. The marker
% \texttt{result-bracket-exponent} indicates that the number needs
% brackets due to the exponent part, but not in other cases.
% \begin{macrocode}
-\cs_new_protected: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_if_empty:NT \l_siunitx_output_exponent_tl
+\cs_new_protected:Npn \@@_number_format_final_combined: {
+ \@@_number_format_brackets:n { mantissa }
+ \prop_get:NnN \l_@@_number_out_prop { mantissa-result }
+ \l_@@_tmpa_tl
+ \tl_if_empty:NT \l_@@_output_exponent_tl
{
- \tl_put_right:Nx \l_siunitx_tmpa_tl
+ \tl_put_right:Nx \l_@@_tmpa_tl
{
\exp_not:N \ensuremath
{
- \bool_if:NTF \l_siunitx_tight_bool
- { { \exp_not:V \l_siunitx_exponent_product_tl } }
- { { } \exp_not:V \l_siunitx_exponent_product_tl { } }
+ \bool_if:NTF \l_@@_tight_bool
+ { { \exp_not:V \l_@@_exponent_product_tl } }
+ { { } \exp_not:V \l_@@_exponent_product_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
+ \prop_get:NnN \l_@@_number_out_prop { exponent-result }
+ \l_@@_tmpb_tl
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop { result }
+ \l_@@_tmpa_tl
+ \prop_put:Nnn \l_@@_number_out_prop
{ result-bracket-exponent } { true }
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_number_format_final_exponent:}
+%\begin{macro}{\@@_number_format_final_exponent:}
% When there is an exponent, the base always needs to be added to the
% front of the number itself. The number must be superscripted, of
% course.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_final_exponent: {
- \prop_get:NnN \l_siunitx_number_out_prop { exponent }
- \l_siunitx_tmpa_tl
- \tl_if_empty:NTF \l_siunitx_output_exponent_tl
+\cs_new_protected:Npn \@@_number_format_final_exponent: {
+ \prop_get:NnN \l_@@_number_out_prop { exponent }
+ \l_@@_tmpa_tl
+ \tl_if_empty:NTF \l_@@_output_exponent_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
+ \tl_set:Nx \l_@@_tmpa_tl
+ { ^ { \exp_not:V \l_@@_tmpa_tl } }
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_exponent_base_tl
}
{
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
{
- \exp_not:V \l_siunitx_output_exponent_tl
- { \exp_not:V \l_siunitx_tmpa_tl }
+ \exp_not:V \l_@@_output_exponent_tl
+ { \exp_not:V \l_@@_tmpa_tl }
}
}
- \prop_put:NnV \l_siunitx_number_out_prop { exponent-result }
- \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { exponent-result }
+ \l_@@_tmpa_tl
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_number_format_final_exponent_only:}
+%\begin{macro}{\@@_number_format_final_exponent_only:}
% When there is only an exponent, a check must be made for a
% sign in the mantissa part. If there is one, it is copied across.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_number_format_final_exponent_only: {
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-sign }
- \l_siunitx_tmpa_tl
+ \@@_number_format_final_exponent_only: {
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-sign }
+ \l_@@_tmpa_tl
{
- \bool_if:NT \l_siunitx_tight_bool
+ \bool_if:NT \l_@@_tight_bool
{
- \tl_set:Nx \l_siunitx_tmpa_tl
- { { \exp_not:V \l_siunitx_tmpa_tl } }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { \exp_not:V \l_@@_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
+ \prop_get:NnN \l_@@_number_out_prop { exponent-result }
+ \l_@@_tmpb_tl
+ \@@_tl_put_left_math:NV \l_@@_tmpb_tl
+ \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { exponent-result }
+ \l_@@_tmpb_tl
}
- \siunitx_number_format_copy:nn { exponent-result } { result }
+ \@@_number_format_copy:nn { exponent-result } { result }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_group:n}
-%\begin{macro}[aux]{\siunitx_number_format_group_aux:nn}
+%\begin{macro}{\@@_number_format_group:n}
+%\begin{macro}[aux]{\@@_number_format_group_aux:nn}
% Grouping digits only happens if there are no symbols in the input, and
% of course if grouping has been requested.
% \begin{macrocode}
-\cs_new_protected: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:NnNT \l_siunitx_number_in_prop { #1 -decimal-marker }
- \l_siunitx_tmpb_tl
- {
- \bool_if:NTF \l_siunitx_output_decimal_copy_bool
- { \tl_set:Nx \l_siunitx_tmpb_tl { { \l_siunitx_tmpb_tl } } }
+\cs_new_protected:Npn \@@_number_format_group:n #1 {
+ \@@_number_format_group_aux:nn {#1} { integer }
+ \@@_number_format_group_aux:nn {#1} { decimal }
+ \prop_if_in:NnTF \l_@@_number_out_prop { #1 -integer }
+ { \@@_number_format_copy:nn { #1 -integer } {#1} }
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \prop_get:NnNT \l_@@_number_in_prop { #1 -decimal-marker }
+ \l_@@_tmpb_tl
+ {
+ \bool_if:NTF \l_@@_output_decimal_copy_bool
+ { \tl_set:Nx \l_@@_tmpb_tl { { \l_@@_tmpb_tl } } }
{
- \tl_set_eq:NN \l_siunitx_tmpb_tl
- \l_siunitx_output_decimal_tl
+ \tl_set_eq:NN \l_@@_tmpb_tl
+ \l_@@_output_decimal_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:NnNF \l_siunitx_number_out_prop { #1 -decimal }
- \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
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop { #1 -decimal-marker }
+ \l_@@_tmpb_tl
+ \prop_get:NnNF \l_@@_number_out_prop { #1 -decimal }
+ \l_@@_tmpb_tl
+ { \tl_clear:N \l_@@_tmpb_tl }
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop {#1} \l_@@_tmpa_tl
}
}
-\cs_new_protected:Npn \siunitx_number_format_group_aux:nn #1#2 {
- \prop_if_in:NnT \l_siunitx_number_in_prop { #1 - #2 }
+\cs_new_protected:Npn \@@_number_format_group_aux:nn #1#2 {
+ \prop_if_in:NnT \l_@@_number_in_prop { #1 - #2 }
{
- \bool_if:cTF { l_siunitx_group_ #2 _bool }
- { \siunitx_number_format_group:nn {#1} {#2} }
- { \siunitx_number_format_copy:n { #1 - #2 } }
+ \bool_if:cTF { l_@@_group_ #2 _bool }
+ { \@@_number_format_group:nn {#1} {#2} }
+ { \@@_number_format_copy:n { #1 - #2 } }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
-% \begin{macro}{\siunitx_number_format_group:nn}
+% \begin{macro}{\@@_number_format_group:nn}
% The idea here is that grouping is only needed for numbers with sufficient
% digits: this is done simply by counting up all of the digits.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_group:nn #1#2
+\cs_new_protected:Npn \@@_number_format_group:nn #1#2
{
- \prop_get:NnN \l_siunitx_number_in_prop { #1 - #2 } \l_siunitx_tmpa_tl
+ \prop_get:NnN \l_@@_number_in_prop { #1 - #2 } \l_@@_tmpa_tl
\int_compare:nNnTF
- { \tl_length:N \l_siunitx_tmpa_tl } < \l_siunitx_group_min_int
- { \siunitx_number_format_copy:n { #1 - #2 } }
+ { \tl_length:N \l_@@_tmpa_tl } < \l_@@_group_min_int
+ { \@@_number_format_copy:n { #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
+ \tl_clear:N \l_@@_tmpb_tl
+ \use:c { @@_number_format_group_ #2 : }
+ \prop_put:NnV \l_@@_number_out_prop { #1 - #2 } \l_@@_tmpb_tl
}
}
% \end{macrocode}
% \end{macro}
-%\begin{macro}{\siunitx_number_format_group_decimal:}
-%\begin{macro}[aux]{\siunitx_number_format_group_decimal_aux:}
+%\begin{macro}{\@@_number_format_group_decimal:}
+%\begin{macro}[aux]{\@@_number_format_group_decimal_aux:}
% Using the \enquote{keep everything on the stack} approach, relatively
% simple recursion is needed. This trick is taken more or less directly
% from \pkg{numprint}.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_group_decimal: {
- \tl_if_empty:NF \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_format_group_decimal: {
+ \tl_if_empty:NF \l_@@_tmpa_tl
{
- \exp_after:wN \siunitx_number_format_group_decimal_aux:NNNN
- \l_siunitx_tmpa_tl { } { } { }
+ \exp_after:wN \@@_number_format_group_decimal_aux:NNNN
+ \l_@@_tmpa_tl { } { } { }
}
}
-\cs_new_protected:Npn \siunitx_number_format_group_decimal_aux:NNNN
+\cs_new_protected:Npn \@@_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_put_right:Nn \l_@@_tmpb_tl {#1} }
{
\tl_if_empty:nTF {#3}
- { \tl_put_right:Nn \l_siunitx_tmpb_tl { #1 #2 } }
+ { \tl_put_right:Nn \l_@@_tmpb_tl { #1 #2 } }
{
- \tl_put_right:Nn \l_siunitx_tmpb_tl { #1 #2 #3 }
+ \tl_put_right:Nn \l_@@_tmpb_tl { #1 #2 #3 }
\tl_if_empty:nF {#4}
{
- \tl_put_right:NV \l_siunitx_tmpb_tl \l_siunitx_group_sep_tl
- \siunitx_number_format_group_decimal_aux:NNNN #4
+ \tl_put_right:NV \l_@@_tmpb_tl \l_@@_group_sep_tl
+ \@@_number_format_group_decimal_aux:NNNN #4
}
}
}
@@ -9757,84 +9763,84 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\begin{macro}{\siunitx_number_format_group_integer:}
+%\begin{macro}{\@@_number_format_group_integer:}
%\begin{macro}[aux]{
-% \siunitx_number_format_group_integer_setup:n ,
-% \siunitx_number_format_group_integer_setup:V ,
-% \siunitx_number_format_group_integer_setup_aux:NNNN ,
-% \siunitx_number_format_group_integer_aux:NNNN
+% \@@_number_format_group_integer_setup:n ,
+% \@@_number_format_group_integer_setup:V ,
+% \@@_number_format_group_integer_setup_aux:NNNN ,
+% \@@_number_format_group_integer_aux:NNNN
%}
% By keeping everything on the stack, recursion can occur quite
% efficiently here.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_group_integer: {
- \tl_if_empty:NF \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_format_group_integer: {
+ \tl_if_empty:NF \l_@@_tmpa_tl
{
- \siunitx_number_format_group_integer_setup:V \l_siunitx_tmpa_tl
+ \@@_number_format_group_integer_setup:V \l_@@_tmpa_tl
}
}
-\cs_new_protected:Npn \siunitx_number_format_group_integer_setup:n #1 {
- \siunitx_number_format_group_integer_setup_aux:NNNN
+\cs_new_protected:Npn \@@_number_format_group_integer_setup:n #1 {
+ \@@_number_format_group_integer_setup_aux:NNNN
{ } #1 { } { } { }
}
-\cs_generate_variant:Nn \siunitx_number_format_group_integer_setup:n
+\cs_generate_variant:Nn \@@_number_format_group_integer_setup:n
{ V }
\cs_new_protected:Npn
- \siunitx_number_format_group_integer_setup_aux:NNNN #1#2#3#4 {
+ \@@_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 }
+ { \@@_number_format_group_integer_aux:NNNN #1 \q_nil }
{
\tl_if_empty:nTF {#3}
{
- \siunitx_number_format_group_integer_aux:NNNN { } { } #1#2
+ \@@_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
+ \@@_number_format_group_integer_aux:NNNN { } #1#2#3
\q_nil
}
{
- \siunitx_number_format_group_integer_setup_aux:NNNN
+ \@@_number_format_group_integer_setup_aux:NNNN
{#1#2#3#4}
}
}
}
}
\cs_new_protected:Npn
- \siunitx_number_format_group_integer_aux:NNNN #1#2#3#4 {
- \tl_put_right:Nn \l_siunitx_tmpb_tl {#1#2#3}
+ \@@_number_format_group_integer_aux:NNNN #1#2#3#4 {
+ \tl_put_right:Nn \l_@@_tmpb_tl {#1#2#3}
\quark_if_nil:nF {#4}
{
- \tl_put_right:NV \l_siunitx_tmpb_tl \l_siunitx_group_sep_tl
- \siunitx_number_format_group_integer_aux:NNNN #4
+ \tl_put_right:NV \l_@@_tmpb_tl \l_@@_group_sep_tl
+ \@@_number_format_group_integer_aux:NNNN #4
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_join_complex:}
+%\begin{macro}{\@@_number_format_join_complex:}
% For adding the complex part to the main part of a number.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_join_complex: {
- \siunitx_number_format_sign_complex:
- \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa }
+\cs_new_protected:Npn \@@_number_format_join_complex: {
+ \@@_number_format_sign_complex:
+ \prop_if_in:NnT \l_@@_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:NnNF \l_siunitx_number_out_prop { complex-result }
- \l_siunitx_tmpb_tl
+ \@@_number_format_brackets:n { mantissa }
+ \prop_get:NnN \l_@@_number_out_prop { mantissa-result }
+ \l_@@_tmpa_tl
+ \prop_get:NnNF \l_@@_number_out_prop { complex-result }
+ \l_@@_tmpb_tl
{
- \prop_get:NnN \l_siunitx_number_out_prop { complex }
- \l_siunitx_tmpb_tl
+ \prop_get:NnN \l_@@_number_out_prop { complex }
+ \l_@@_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 }
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop { mantissa-result }
+ \l_@@_tmpa_tl
+ \prop_put:Nnn \l_@@_number_out_prop { mantissa-bracket }
{ true }
}
}
@@ -9842,37 +9848,37 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_format_join_uncert: ,
-% \siunitx_number_format_join_uncert:n
+% \@@_number_format_join_uncert: ,
+% \@@_number_format_join_uncert:n
%}
-%\begin{macro}[aux]{\siunitx_number_format_join_uncert_pm:N}
+%\begin{macro}[aux]{\@@_number_format_join_uncert_pm:N}
% For adding separated uncertainties to the main part of a number.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_join_uncert: {
- \siunitx_number_format_join_uncert:n { mantissa }
- \siunitx_number_format_join_uncert:n { complex }
+\cs_new_protected:Npn \@@_number_format_join_uncert: {
+ \@@_number_format_join_uncert:n { mantissa }
+ \@@_number_format_join_uncert:n { complex }
}
-\cs_new_protected:Npn \siunitx_number_format_join_uncert:n #1 {
- \prop_get:NnNT \l_siunitx_number_out_prop {#1}
- \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_format_join_uncert:n #1 {
+ \prop_get:NnNT \l_@@_number_out_prop {#1}
+ \l_@@_tmpa_tl
{
- \prop_get:NnNTF \l_siunitx_number_out_prop { #1 -uncertainty }
- \l_siunitx_tmpb_tl
+ \prop_get:NnNTF \l_@@_number_out_prop { #1 -uncertainty }
+ \l_@@_tmpb_tl
{
- \bool_if:NT \l_siunitx_uncert_sep_bool
- { \siunitx_number_format_join_uncert_pm: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 -result }
- \l_siunitx_tmpa_tl
- \prop_put:Nnn \l_siunitx_number_out_prop { #1 -bracket }
+ \bool_if:NT \l_@@_uncert_sep_bool
+ { \@@_number_format_join_uncert_pm:N \l_@@_tmpb_tl }
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop { #1 -result }
+ \l_@@_tmpa_tl
+ \prop_put:Nnn \l_@@_number_out_prop { #1 -bracket }
{ true }
}
- { \siunitx_number_format_copy:nn {#1} { #1 -result } }
+ { \@@_number_format_copy:nn {#1} { #1 -result } }
}
}
-\cs_new_protected:Npn \siunitx_number_format_join_uncert_pm:N #1
+\cs_new_protected:Npn \@@_number_format_join_uncert_pm:N #1
{
- \bool_if:NTF \l_siunitx_tight_bool
+ \bool_if:NTF \l_@@_tight_bool
{ \tl_put_left:Nn #1 { \ensuremath { { \pm } } } }
{ \tl_put_left:Nn #1 { \ensuremath { { } \pm { } } } }
}
@@ -9880,145 +9886,145 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_reassemble:}
+%\begin{macro}{\@@_number_format_reassemble:}
% The integer, decimal and any non-separated uncertainty parts are
% put back together. This gives a \enquote{minimal} unit which cannot
% need any brackets or repeated units (if applicable). If the
% uncertainty is separate, it is stored at this stage pending later
% re-attachment.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_reassemble: {
- \prop_if_in:NnT \l_siunitx_number_in_prop { mantissa }
+\cs_new_protected:Npn \@@_number_format_reassemble: {
+ \prop_if_in:NnT \l_@@_number_in_prop { mantissa }
{
- \siunitx_number_format_group:n { mantissa }
- \siunitx_number_format_uncertainty:n { mantissa }
+ \@@_number_format_group:n { mantissa }
+ \@@_number_format_uncertainty:n { mantissa }
}
- \prop_if_in:NnT \l_siunitx_number_in_prop { complex }
+ \prop_if_in:NnT \l_@@_number_in_prop { complex }
{
- \siunitx_number_format_group:n { complex }
- \siunitx_number_format_uncertainty:n { complex }
+ \@@_number_format_group:n { complex }
+ \@@_number_format_uncertainty:n { complex }
}
- \prop_if_in:NnT \l_siunitx_number_in_prop { exponent }
- { \siunitx_number_format_group:n { exponent } }
+ \prop_if_in:NnT \l_@@_number_in_prop { exponent }
+ { \@@_number_format_group:n { exponent } }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_relation:}
+%\begin{macro}{\@@_number_format_relation:}
% A simple check and copy operation for a relation: this will still need
% to be added to the result, of course.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_relation: {
- \prop_get:NnNT \l_siunitx_number_in_prop { comparator }
- \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_number_format_relation: {
+ \prop_get:NnNT \l_@@_number_in_prop { comparator }
+ \l_@@_tmpa_tl
{
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
{
\exp_not:N \ensuremath
- { \exp_not:V \l_siunitx_tmpa_tl }
+ { \exp_not:V \l_@@_tmpa_tl }
}
- \prop_put:NnV \l_siunitx_number_out_prop { comparator }
- \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { comparator }
+ \l_@@_tmpa_tl
}
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_format_sign:n ,
-% \siunitx_number_format_sign_complex:
+% \@@_number_format_sign:n ,
+% \@@_number_format_sign_complex:
%}
%\begin{macro}[aux]{
-% \siunitx_number_format_sign_aux:n ,
-% \siunitx_number_format_sign_negative_brackets:n ,
-% \siunitx_number_format_sign_complex:n
+% \@@_number_format_sign_aux:n ,
+% \@@_number_format_sign_negative_brackets:n ,
+% \@@_number_format_sign_complex:n
%}
% Some simple sign manipulation: for tight signs, a little shuffling.
% In the complex number case, there is a need for a correction to get
% the right formatting in text mode. For speed reasons, this is done in
% a separate function.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_sign:n #1 {
- \prop_if_in:NnT \l_siunitx_number_out_prop {#1}
+\cs_new_protected:Npn \@@_number_format_sign:n #1 {
+ \prop_if_in:NnT \l_@@_number_out_prop {#1}
{
- \prop_get:NnNT \l_siunitx_number_in_prop { #1 -sign }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { #1 -sign }
+ \l_@@_tmpa_tl
{
- \bool_if:NTF \l_siunitx_negative_bracket_bool
+ \bool_if:NTF \l_@@_negative_bracket_bool
{
- \str_if_eq:VnTF \l_siunitx_tmpa_tl { - }
- { \siunitx_number_format_sign_negative_brackets:n {#1} }
- { \siunitx_number_format_sign_aux:n {#1} }
+ \str_if_eq:VnTF \l_@@_tmpa_tl { - }
+ { \@@_number_format_sign_negative_brackets:n {#1} }
+ { \@@_number_format_sign_aux:n {#1} }
}
- { \siunitx_number_format_sign_aux:n {#1} }
+ { \@@_number_format_sign_aux:n {#1} }
}
}
}
-\cs_new_protected:Npn \siunitx_number_format_sign_aux:n #1 {
- \bool_if:NT \l_siunitx_tight_bool
+\cs_new_protected:Npn \@@_number_format_sign_aux:n #1 {
+ \bool_if:NT \l_@@_tight_bool
{
- \tl_set:Nx \l_siunitx_tmpa_tl
- { { \exp_not:V \l_siunitx_tmpa_tl } }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { \exp_not:V \l_@@_tmpa_tl } }
}
- \tl_clear:N \l_siunitx_tmpb_tl
- \tl_put_left: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:NnNT \l_siunitx_number_out_prop { #1 -result }
- \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
+ \tl_clear:N \l_@@_tmpb_tl
+ \tl_put_left:NV \l_@@_tmpb_tl \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { #1 -sign }
+ \l_@@_tmpb_tl
+ \prop_get:NnN \l_@@_number_out_prop {#1} \l_@@_tmpa_tl
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop {#1} \l_@@_tmpa_tl
+ \prop_get:NnNT \l_@@_number_out_prop { #1 -result }
+ \l_@@_tmpa_tl
+ {
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop { #1 -result }
+ \l_@@_tmpa_tl
}
}
\cs_new_protected:Npn
- \siunitx_number_format_sign_negative_brackets:n #1
+ \@@_number_format_sign_negative_brackets:n #1
{
- \siunitx_number_format_brackets_aux:n {#1}
- \prop_get:NnNT \l_siunitx_number_out_prop { #1 }
- \l_siunitx_tmpa_tl
+ \@@_number_format_brackets_aux:n {#1}
+ \prop_get:NnNT \l_@@_number_out_prop { #1 }
+ \l_@@_tmpa_tl
{
- \tl_put_left:NV \l_siunitx_tmpa_tl \l_siunitx_bracket_open_tl
- \tl_put_right:NV \l_siunitx_tmpa_tl \l_siunitx_bracket_close_tl
- \prop_put:NnV \l_siunitx_number_out_prop { #1 }
- \l_siunitx_tmpa_tl
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_bracket_open_tl
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_bracket_close_tl
+ \prop_put:NnV \l_@@_number_out_prop { #1 }
+ \l_@@_tmpa_tl
}
}
-\cs_new_protected:Npn \siunitx_number_format_sign_complex: {
- \siunitx_number_format_sign_complex:n { complex }
- \siunitx_number_format_sign_complex:n { complex-result }
+\cs_new_protected:Npn \@@_number_format_sign_complex: {
+ \@@_number_format_sign_complex:n { complex }
+ \@@_number_format_sign_complex:n { complex-result }
}
-\cs_new_protected:Npn \siunitx_number_format_sign_complex:n #1 {
- \prop_if_in:NnT \l_siunitx_number_out_prop {#1}
+\cs_new_protected:Npn \@@_number_format_sign_complex:n #1 {
+ \prop_if_in:NnT \l_@@_number_out_prop {#1}
{
- \prop_get:NnNT \l_siunitx_number_in_prop { complex-sign }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { complex-sign }
+ \l_@@_tmpa_tl
{
- \bool_if:NTF \l_siunitx_tight_bool
+ \bool_if:NTF \l_@@_tight_bool
{
- \tl_set:Nx \l_siunitx_tmpa_tl
- { { \exp_not:V \l_siunitx_tmpa_tl } }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { \exp_not:V \l_@@_tmpa_tl } }
}
{
- \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa }
+ \prop_if_in:NnT \l_@@_number_out_prop { mantissa }
{
- \tl_set:Nx \l_siunitx_tmpa_tl
- { { } \exp_not:V \l_siunitx_tmpa_tl { } }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { } \exp_not:V \l_@@_tmpa_tl { } }
}
}
- \tl_clear:N \l_siunitx_tmpb_tl
- \tl_put_left: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
+ \tl_clear:N \l_@@_tmpb_tl
+ \tl_put_left:NV \l_@@_tmpb_tl \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { complex-sign }
+ \l_@@_tmpb_tl
+ \prop_get:NnN \l_@@_number_out_prop {#1}
+ \l_@@_tmpa_tl
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \prop_put:NnV \l_@@_number_out_prop {#1}
+ \l_@@_tmpa_tl
}
}
}
@@ -10026,50 +10032,50 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_format_uncertainty:n}
+%\begin{macro}{\@@_number_format_uncertainty:n}
%\begin{macro}[aux]{
-% \siunitx_number_format_uncertainty_joined:n ,
-% \siunitx_number_format_uncertainty_sep:n
+% \@@_number_format_uncertainty_joined:n ,
+% \@@_number_format_uncertainty_sep:n
%}
% Uncertainty output varies depending on whether there is a need to
% separate the error form the number in the output.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_format_uncertainty:n #1 {
- \prop_if_in:NnTF \l_siunitx_number_in_prop { #1 -uncertainty }
+\cs_new_protected:Npn \@@_number_format_uncertainty:n #1 {
+ \prop_if_in:NnTF \l_@@_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:
+ \bool_if:NTF \l_@@_uncert_sep_bool
+ { \@@_number_format_uncertainty_sep:n {#1} }
+ { \@@_number_format_uncertainty_joined:n {#1} }
+ \@@_number_format_join_uncert:
}
- { \siunitx_number_format_copy:nn {#1} { #1 -result } }
+ { \@@_number_format_copy:nn {#1} { #1 -result } }
}
\cs_new_protected: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 }
- \tl_put_left:NV \l_siunitx_tmpa_tl \l_siunitx_output_uncert_open_tl
- \tl_put_left:NV \l_siunitx_tmpa_tl \l_siunitx_uncert_sep_tl
- \tl_put_right: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
+ \@@_number_format_uncertainty_joined:n #1 {
+ \prop_get:NnN \l_@@_number_in_prop { #1 -uncertainty }
+ \l_@@_tmpa_tl
+ \prop_del:Nn \l_@@_number_in_prop { #1 -uncertainty }
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_output_uncert_open_tl
+ \tl_put_left:NV \l_@@_tmpa_tl \l_@@_uncert_sep_tl
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_output_uncert_close_tl
+ \prop_get:NnN \l_@@_number_out_prop {#1} \l_@@_tmpb_tl
+ \tl_put_right:NV \l_@@_tmpb_tl \l_@@_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop {#1} \l_@@_tmpb_tl
}
\cs_new_protected:Npn
- \siunitx_number_format_uncertainty_sep:n #1 {
- \prop_if_in:NnT \l_siunitx_number_out_prop { #1 -integer }
+ \@@_number_format_uncertainty_sep:n #1 {
+ \prop_if_in:NnT \l_@@_number_out_prop { #1 -integer }
{
- \prop_if_in:NnF \l_siunitx_number_out_prop
+ \prop_if_in:NnF \l_@@_number_out_prop
{ #1 -uncertainty-integer }
{
- \prop_put:Nnn \l_siunitx_number_out_prop
+ \prop_put:Nnn \l_@@_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
+ \@@_number_format_group:n { #1 -uncertainty }
+ \prop_put:NnV \l_@@_number_out_prop { #1 -uncertainty }
+ \l_@@_tmpa_tl
}
% \end{macrocode}
%\end{macro}
@@ -10080,62 +10086,62 @@ This work consists of the file siunitx.dtx
% The outer level of number processing for actually printing things.
%
%\begin{macro}{
-% \l_siunitx_number_out_tl ,
-% \l_siunitx_number_out_saved_tl
+% \l_@@_number_out_tl ,
+% \l_@@_number_out_saved_tl
%}
% The final result, plus a version for loops.
% \begin{macrocode}
-\tl_new:N \l_siunitx_number_out_tl
-\tl_new:N \l_siunitx_number_out_saved_tl
+\tl_new:N \l_@@_number_out_tl
+\tl_new:N \l_@@_number_out_saved_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_fraction_tl}
+%\begin{macro}{\l_@@_number_fraction_tl}
% Fractions need to be build separately, so that there is no problem
% with stack order.
% \begin{macrocode}
-\tl_new:N \l_siunitx_number_fraction_tl
+\tl_new:N \l_@@_number_fraction_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_compound_bool}
+%\begin{macro}{\l_@@_number_compound_bool}
% To help with brackets.
% \begin{macrocode}
-\bool_new:N \l_siunitx_number_compound_bool
+\bool_new:N \l_@@_number_compound_bool
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_quotient_mode_tl}
+%\begin{macro}{\l_@@_quotient_mode_tl}
% The action for quotients is stored as a token list variable.
% \begin{macrocode}
-\tl_new:N \l_siunitx_quotient_mode_tl
+\tl_new:N \l_@@_quotient_mode_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_fraction:nn}
+%\begin{macro}{\@@_fraction:nn}
% The function used for fractions should be stored here.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_fraction:nn { }
+\cs_new_protected:Npn \@@_fraction:nn { }
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_output_quotient_tl ,
+% \l_@@_output_quotient_tl ,
% \l_siunix_number_parse_bool
%}
% Some options related to numbers at the output stage.
% \begin{macrocode}
\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,
+ { \cs_set_eq:NN \@@_fraction:nn #1 },
+ output-product .tl_set:N = \l_@@_output_product_tl,
+ output-quotient .tl_set:N = \l_@@_output_quotient_tl,
+ parse-numbers .bool_set:N = \l_@@_number_parse_bool,
quotient-mode .choice:,
quotient-mode / fraction .code:n =
- { \tl_set:Nn \l_siunitx_quotient_mode_tl { fraction } },
+ { \tl_set:Nn \l_@@_quotient_mode_tl { fraction } },
quotient-mode / symbol .code:n =
- { \tl_set:Nn \l_siunitx_quotient_mode_tl { symbol } },
+ { \tl_set:Nn \l_@@_quotient_mode_tl { symbol } },
}
\keys_set:nn { siunitx } {
fraction-function = \frac ,
@@ -10148,69 +10154,69 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_output:n ,
-% \siunitx_number_output:V
+% \@@_number_output:n ,
+% \@@_number_output:V
%}
% The number output system simply sets up for the combined number and
% unit system.
% \begin{macrocode}
-\cs_new_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_new_protected:Npn \@@_number_output:n #1 {
+ \tl_clear:N \l_@@_unit_tl
+ \tl_clear:N \l_@@_preunit_tl
+ \@@_combined_output:n {#1}
}
-\cs_generate_variant:Nn \siunitx_number_output:n { V }
+\cs_generate_variant:Nn \@@_number_output:n { V }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_output_bracket:}
+%\begin{macro}{\@@_number_output_bracket:}
% Compound numbers may need brackets adding.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_bracket: {
- \bool_if:NF \l_siunitx_error_bool
+\cs_new_protected:Npn \@@_number_output_bracket: {
+ \bool_if:NF \l_@@_error_bool
{
- \bool_if:NT \l_siunitx_number_compound_bool
- { \siunitx_number_format_brackets:n { result } }
+ \bool_if:NT \l_@@_number_compound_bool
+ { \@@_number_format_brackets:n { result } }
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_output_color:}
+%\begin{macro}{\@@_number_output_color:}
% If a colour needs to be set, it is recovered here and put into the
% appropriate place.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_color: {
- \prop_if_in:NnT \l_siunitx_number_out_prop { color }
+\cs_new_protected:Npn \@@_number_output_color: {
+ \prop_if_in:NnT \l_@@_number_out_prop { color }
{
- \prop_get:NnN \l_siunitx_number_out_prop { color }
- \l_siunitx_number_color_tl
+ \prop_get:NnN \l_@@_number_out_prop { color }
+ \l_@@_number_color_tl
}
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_number_output_parse:n ,
-% \siunitx_number_output_parse:V
+% \@@_number_output_parse:n ,
+% \@@_number_output_parse:V
%}
-%\begin{macro}[aux]{\siunitx_number_output_parse_aux:}
+%\begin{macro}[aux]{\@@_number_output_parse_aux:}
% The parsing system just has to check if there are multiple parts to
% worry about.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_parse:n #1 {
- \siunitx_number_preprocess:n {#1}
- \bool_if:NF \l_siunitx_error_bool
+\cs_new_protected:Npn \@@_number_output_parse:n #1 {
+ \@@_number_preprocess:n {#1}
+ \bool_if:NF \l_@@_error_bool
{
- \tl_if_empty:NTF \l_siunitx_number_multi_tl
- { \siunitx_number_output_parse_aux: }
+ \tl_if_empty:NTF \l_@@_number_multi_tl
+ { \@@_number_output_parse_aux: }
{
\use:c
- { siunitx_number_output_ \l_siunitx_number_multi_tl : }
+ { @@_number_output_ \l_@@_number_multi_tl : }
}
}
}
-\cs_generate_variant:Nn \siunitx_number_output_parse:n { V }
+\cs_generate_variant:Nn \@@_number_output_parse:n { V }
% \end{macrocode}
% There are a few additional tests for printing partwise, as this is
% only needed if there are brackets to add and these are not due to
@@ -10218,20 +10224,20 @@ This work consists of the file siunitx.dtx
% the units to come at the end of the number, and there then have to
% be brackets in the output if there are any separate parts.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_parse_aux: {
- \siunitx_number_in_parse:V \l_siunitx_number_arg_tl
- \bool_if:NF \l_siunitx_error_bool
+\cs_new_protected:Npn \@@_number_output_parse_aux: {
+ \@@_number_in_parse:V \l_@@_number_arg_tl
+ \bool_if:NF \l_@@_error_bool
{
- \siunitx_number_process:
- \siunitx_number_format:
- \siunitx_number_output_color:
- \bool_if:NTF \l_siunitx_brackets_bool
- { \siunitx_number_output_single: }
+ \@@_number_process:
+ \@@_number_format:
+ \@@_number_output_color:
+ \bool_if:NTF \l_@@_brackets_bool
+ { \@@_number_output_single: }
{
- \prop_if_in:NnTF \l_siunitx_number_out_prop
+ \prop_if_in:NnTF \l_@@_number_out_prop
{ result-bracket }
- { \siunitx_number_output_parts: }
- { \siunitx_number_output_single: }
+ { \@@_number_output_parts: }
+ { \@@_number_output_single: }
}
}
}
@@ -10239,248 +10245,248 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_output_parts:}
+%\begin{macro}{\@@_number_output_parts:}
%\begin{macro}[aux]{
-% \siunitx_number_output_parts_aux: ,
-% \siunitx_number_output_parts_aux:n ,
-% \siunitx_number_output_parts_print:n
+% \@@_number_output_parts_aux: ,
+% \@@_number_output_parts_aux:n ,
+% \@@_number_output_parts_print:n
%}
% Printing numbers by parts is necessary when there are units to
% repeat. That means doing things that have already been done by the
% number formatter again.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_parts: {
+\cs_new_protected:Npn \@@_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
+ \tl_if_empty_p:N \l_@@_pre_unit_tl &&
+ \tl_if_empty_p:N \l_@@_unit_tl
}
- { \siunitx_number_output_single: }
- { \siunitx_number_output_parts_aux: }
+ { \@@_number_output_single: }
+ { \@@_number_output_parts_aux: }
}
-\cs_new_protected:Npn \siunitx_number_output_parts_aux: {
- \bool_if:NTF \l_siunitx_multi_repeat_bool
+\cs_new_protected:Npn \@@_number_output_parts_aux: {
+ \bool_if:NTF \l_@@_multi_repeat_bool
{
- \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa-result }
+ \prop_if_in:NnT \l_@@_number_out_prop { mantissa-result }
{
- \siunitx_number_output_parts_aux:n { mantissa }
- \siunitx_number_output_parts_aux:n { complex }
+ \@@_number_output_parts_aux:n { mantissa }
+ \@@_number_output_parts_aux:n { complex }
}
- \prop_get:NnNT \l_siunitx_number_out_prop { exponent-result }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_out_prop { exponent-result }
+ \l_@@_tmpa_tl
{
- \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa-result }
+ \prop_if_in:NnT \l_@@_number_out_prop { mantissa-result }
{
- \tl_put_left:Nx \l_siunitx_tmpa_tl
+ \tl_put_left:Nx \l_@@_tmpa_tl
{
\exp_not:N \ensuremath
{
- \bool_if:NTF \l_siunitx_tight_bool
- { { \exp_not:V \l_siunitx_exponent_product_tl } }
- { { } \exp_not:V \l_siunitx_exponent_product_tl { } }
+ \bool_if:NTF \l_@@_tight_bool
+ { { \exp_not:V \l_@@_exponent_product_tl } }
+ { { } \exp_not:V \l_@@_exponent_product_tl { } }
}
}
- \prop_put:NnV \l_siunitx_number_out_prop { exponent }
- \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { exponent }
+ \l_@@_tmpa_tl
}
- \siunitx_number_output_parts_print:n { exponent }
+ \@@_number_output_parts_print:n { exponent }
}
}
- { \siunitx_number_output_single: }
+ { \@@_number_output_single: }
}
-\cs_new_protected: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 }
+\cs_new_protected:Npn \@@_number_output_parts_aux:n #1 {
+ \prop_if_in:NnT \l_@@_number_out_prop {#1}
+ { \@@_number_output_parts_print:n {#1} }
+ \prop_if_in:NnT \l_@@_number_out_prop { #1 -uncertainty }
{
- \bool_if:NTF \l_siunitx_tight_bool
- { \siunitx_print:nn { number } { \ensuremath { { \pm } } } }
- { \siunitx_print:nn { number } { \ensuremath { { } \pm { } } } }
- \siunitx_number_output_parts_print:n { #1 -uncertainty }
+ \bool_if:NTF \l_@@_tight_bool
+ { \@@_print:nn { number } { \ensuremath { { \pm } } } }
+ { \@@_print:nn { number } { \ensuremath { { } \pm { } } } }
+ \@@_number_output_parts_print:n { #1 -uncertainty }
}
}
-\cs_new_protected: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_new_protected:Npn \@@_number_output_parts_print:n #1 {
+ \@@_unit_output_pre_print:
+ \prop_get:NnN \l_@@_number_out_prop {#1} \l_@@_tmpa_tl
+ \@@_print:nV { number } \l_@@_tmpa_tl
+ \@@_unit_output_print:
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_output_product:}
+%\begin{macro}{\@@_number_output_product:}
% For products, there may need to be the addition of brackets if there
% are units about. When not repeating units, some work has to be done to
% print everything correctly. The extra group here is necessary
% otherwise looping will delete the units entirely!
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_product: {
- \bool_if:NTF \l_siunitx_product_brackets_bool
+\cs_new_protected:Npn \@@_number_output_product: {
+ \bool_if:NTF \l_@@_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
+ \tl_if_empty_p:N \l_@@_pre_unit_tl &&
+ \tl_if_empty_p:N \l_@@_unit_tl
}
- { \siunitx_number_output_product_aux: }
- { \siunitx_number_output_product_brackets: }
+ { \@@_number_output_product_aux: }
+ { \@@_number_output_product_brackets: }
}
{
- \bool_if:NTF \l_siunitx_product_repeat_bool
- { \siunitx_number_output_product_aux: }
+ \bool_if:NTF \l_@@_product_repeat_bool
+ { \@@_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
+ \@@_unit_output_pre_print:
+ \tl_set_eq:NN \l_@@_unit_saved_tl \l_@@_unit_tl
+ \tl_clear:N \l_@@_pre_unit_tl
+ \tl_clear:N \l_@@_unit_tl
\group_begin:
- \siunitx_number_output_product_aux:
+ \@@_number_output_product_aux:
\group_end:
- \tl_set_eq:NN \l_siunitx_unit_tl \l_siunitx_unit_saved_tl
- \siunitx_unit_output_print:
+ \tl_set_eq:NN \l_@@_unit_tl \l_@@_unit_saved_tl
+ \@@_unit_output_print:
}
}
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}[aux]{\siunitx_number_output_product_brackets:}
+%\begin{macro}[aux]{\@@_number_output_product_brackets:}
% When printing products that have to be bracketed, there is a need to
% shuffle the units about a bit.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_product_brackets: {
- \siunitx_unit_output_pre_print:
- \siunitx_print:nV { number } \l_siunitx_bracket_open_tl
+\cs_new_protected:Npn \@@_number_output_product_brackets: {
+ \@@_unit_output_pre_print:
+ \@@_print:nV { number } \l_@@_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:
+ \tl_set_eq:NN \l_@@_unit_saved_tl \l_@@_unit_tl
+ \tl_clear:N \l_@@_pre_unit_tl
+ \tl_clear:N \l_@@_unit_tl
+ \@@_number_output_product_aux:
\nobreak
- \tl_set_eq:NN \l_siunitx_unit_tl \l_siunitx_unit_saved_tl
- \siunitx_print:nV { number } \l_siunitx_bracket_close_tl
- \siunitx_unit_output_print:
+ \tl_set_eq:NN \l_@@_unit_tl \l_@@_unit_saved_tl
+ \@@_print:nV { number } \l_@@_bracket_close_tl
+ \@@_unit_output_print:
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}[aux]{\siunitx_number_output_product_aux:}
+%\begin{macro}[aux]{\@@_number_output_product_aux:}
% Printing the products needs a looping function.
% \begin{macrocode}
-\cs_new_protected: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
+\cs_new_protected:Npn \@@_number_output_product_aux: {
+ \bool_set_true:N \l_@@_number_compound_bool
+ \@@_number_preprocess:V \l_@@_number_arg_tl
+ \bool_if:NF \l_@@_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
+ \tl_if_empty:NTF \l_@@_number_multi_tl
+ { \@@_number_output_parse_aux: }
+ { \@@_number_output_quotient: }
+ \tl_if_empty:NF \l_@@_number_next_tl
{
- \bool_if:NTF \l_siunitx_tight_bool
+ \bool_if:NTF \l_@@_tight_bool
{
- \siunitx_print:nn { number }
- { \ensuremath { \l_siunitx_output_product_tl } }
+ \@@_print:nn { number }
+ { \ensuremath { \l_@@_output_product_tl } }
}
{
- \siunitx_print:nn { number }
- { \ensuremath { { } \l_siunitx_output_product_tl { } } }
+ \@@_print:nn { number }
+ { \ensuremath { { } \l_@@_output_product_tl { } } }
}
- \siunitx_number_output_parse:V \l_siunitx_number_next_tl
+ \@@_number_output_parse:V \l_@@_number_next_tl
}
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_output_quotient:}
+%\begin{macro}{\@@_number_output_quotient:}
% For quotients, there are two options.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_quotient: {
+\cs_new_protected:Npn \@@_number_output_quotient: {
\use:c
- { siunitx_number_output_quotient_ \l_siunitx_quotient_mode_tl : }
+ { @@_number_output_quotient_ \l_@@_quotient_mode_tl : }
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_number_output_quotient_fraction:}
+%\begin{macro}{\@@_number_output_quotient_fraction:}
% For fraction output, there are quite a lot of braces to construct,
% unfortunately.
% \begin{macrocode}
-\cs_new_protected: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
+\cs_new_protected:Npn \@@_number_output_quotient_fraction: {
+ \bool_set_false:N \l_@@_number_compound_bool
+ \@@_number_output_quotient_aux_i:
+ \tl_set:Nx \l_@@_number_out_tl
+ { { \exp_not:V \l_@@_number_numerator_tl } }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { \exp_not:V \l_@@_number_denominator_tl } }
+ \tl_put_right:NV \l_@@_number_out_tl \l_@@_tmpa_tl
+ \tl_put_left:Nn \l_@@_number_out_tl { \@@_fraction:nn }
+ \tl_set:Nx \l_@@_number_out_tl
{
\exp_not:N \ensuremath
- { \exp_not:V \l_siunitx_number_out_tl }
+ { \exp_not:V \l_@@_number_out_tl }
}
- \siunitx_number_output_single_aux:
+ \@@_number_output_single_aux:
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_number_output_quotient_symbol:}
+%\begin{macro}{\@@_number_output_quotient_symbol:}
% If a symbol is used for the division, the build process is less
% complex.
% \begin{macrocode}
-\cs_new_protected: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
- \tl_put_right: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_new_protected:Npn \@@_number_output_quotient_symbol: {
+ \bool_set_true:N \l_@@_number_compound_bool
+ \@@_number_output_quotient_aux_i:
+ \tl_set_eq:NN \l_@@_number_out_tl
+ \l_@@_number_numerator_tl
+ \tl_put_right:NV \l_@@_number_out_tl \l_@@_output_quotient_tl
+ \tl_put_right:NV \l_@@_number_out_tl
+ \l_@@_number_denominator_tl
+ \@@_number_output_single_aux:
}
% \end{macrocode}
%\end{macro}
%\begin{macro}[aux]{
-% \siunitx_number_output_quotient_aux_i: ,
-% \siunitx_number_output_quotient_aux_ii:
+% \@@_number_output_quotient_aux_i: ,
+% \@@_number_output_quotient_aux_ii:
%}
% The two parts of the number are parsed and formatted.
% \begin{macrocode}
-\cs_new_protected: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_if_in:NnT \l_siunitx_number_out_prop { complex }
+\cs_new_protected:Npn \@@_number_output_quotient_aux_i: {
+ \@@_number_in_parse:V \l_@@_number_numerator_tl
+ \@@_number_output_quotient_aux_ii:
+ \@@_number_output_color:
+ \prop_if_in:NnT \l_@@_number_out_prop { complex }
{
- \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa }
+ \prop_if_in:NnT \l_@@_number_out_prop { mantissa }
{
- \prop_put:Nnn \l_siunitx_number_out_prop
+ \prop_put:Nnn \l_@@_number_out_prop
{ result-bracket } { true }
- \siunitx_number_format_brackets:n { result }
+ \@@_number_format_brackets:n { result }
}
}
- \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
+ \prop_get:NnN \l_@@_number_out_prop { result }
+ \l_@@_number_numerator_tl
+ \@@_number_in_parse:V \l_@@_number_denominator_tl
+ \@@_number_output_quotient_aux_ii:
+ \prop_if_in:NnT \l_@@_number_out_prop
{ result-bracket-exponent }
{
- \prop_put:Nnn \l_siunitx_number_out_prop { result-bracket }
+ \prop_put:Nnn \l_@@_number_out_prop { result-bracket }
{ true }
}
- \siunitx_number_output_bracket:
- \prop_get:NnN \l_siunitx_number_out_prop { result }
- \l_siunitx_number_denominator_tl
+ \@@_number_output_bracket:
+ \prop_get:NnN \l_@@_number_out_prop { result }
+ \l_@@_number_denominator_tl
}
-\cs_new_protected:Npn \siunitx_number_output_quotient_aux_ii: {
- \siunitx_number_process:
- \siunitx_number_format:
+\cs_new_protected:Npn \@@_number_output_quotient_aux_ii: {
+ \@@_number_process:
+ \@@_number_format:
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_number_output_single:}
-%\begin{macro}[aux]{\siunitx_number_output_single_aux:}
+%\begin{macro}{\@@_number_output_single:}
+%\begin{macro}[aux]{\@@_number_output_single_aux:}
% Printing a number with no multiple parts is easy. There is a check for
% any units, which if present may force the number to have brackets
% added. there is then simply a short run to print the units and number.
@@ -10488,27 +10494,27 @@ This work consists of the file siunitx.dtx
% exponent: if there is, any other parts will already be bracketed and
% mathematically there is no need for brackets at this point.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_number_output_single: {
+\cs_new_protected:Npn \@@_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
+ \tl_if_empty_p:N \l_@@_pre_unit_tl &&
+ \tl_if_empty_p:N \l_@@_unit_tl
}
{
- \prop_if_in:NnF \l_siunitx_number_out_prop { exponent }
- { \siunitx_number_format_brackets:n { result } }
+ \prop_if_in:NnF \l_@@_number_out_prop { exponent }
+ { \@@_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:
+ \@@_number_output_bracket:
+ \prop_get:NnN \l_@@_number_out_prop { result }
+ \l_@@_number_out_tl
+ \@@_number_output_single_aux:
}
-\cs_new_protected:Npn \siunitx_number_output_single_aux: {
- \siunitx_unit_output_pre_print:
- \quark_if_no_value:NTF \l_siunitx_number_out_tl
- { \tl_clear:N \l_siunitx_number_unit_product_tl }
- { \siunitx_print:nV { number } \l_siunitx_number_out_tl }
- \siunitx_unit_output_print:
+\cs_new_protected:Npn \@@_number_output_single_aux: {
+ \@@_unit_output_pre_print:
+ \quark_if_no_value:NTF \l_@@_number_out_tl
+ { \tl_clear:N \l_@@_number_unit_product_tl }
+ { \@@_print:nV { number } \l_@@_number_out_tl }
+ \@@_unit_output_print:
}
% \end{macrocode}
%\end{macro}
@@ -10522,195 +10528,195 @@ This work consists of the file siunitx.dtx
% to be handled correctly.
%
%\begin{macro}{
-% \l_siunitx_angle_degree_space_bool ,
-% \l_siunitx_angle_minute_space_bool
+% \l_@@_angle_degree_space_bool ,
+% \l_@@_angle_minute_space_bool
%}
% The need for spaces between parts of an arc needs to be accommodated:
% this is achieved by flagging up the need for such spaces using two
% switches.
% \begin{macrocode}
-\bool_new:N \l_siunitx_angle_degree_space_bool
-\bool_new:N \l_siunitx_angle_minute_space_bool
+\bool_new:N \l_@@_angle_degree_space_bool
+\bool_new:N \l_@@_angle_minute_space_bool
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_angle_marker_box ,
-% \l_siunitx_angle_unit_box ,
-% \l_siunitx_angle_marker_dim ,
-% \l_siunitx_angle_unit_dim
+% \l_@@_angle_marker_box ,
+% \l_@@_angle_unit_box ,
+% \l_@@_angle_marker_dim ,
+% \l_@@_angle_unit_dim
%}
% When creating astronomy-style angles, the decimal marker and angle
% symbol have to be boxed up and measured.
% \begin{macrocode}
-\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
+\box_new:N \l_@@_angle_marker_box
+\box_new:N \l_@@_angle_unit_box
+\dim_new:N \l_@@_angle_marker_dim
+\dim_new:N \l_@@_angle_unit_dim
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_angle_degree_prop ,
-% \l_siunitx_angle_minute_prop ,
-% \l_siunitx_angle_second_prop
+% \l_@@_angle_degree_prop ,
+% \l_@@_angle_minute_prop ,
+% \l_@@_angle_second_prop
%}
% As there are potentially three numbers to parse, three properly lists
% are made available to hold the results. This allows the code to be
% generalised, with only the name of the storage area varying.
% \begin{macrocode}
-\prop_new:N \l_siunitx_angle_degree_prop
-\prop_new:N \l_siunitx_angle_minute_prop
-\prop_new:N \l_siunitx_angle_second_prop
+\prop_new:N \l_@@_angle_degree_prop
+\prop_new:N \l_@@_angle_minute_prop
+\prop_new:N \l_@@_angle_second_prop
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_angle_degree_zero_bool ,
-% \l_siunitx_angle_minute_zero_bool ,
-% \l_siunitx_angle_second_zero_bool ,
-% \l_siunitx_angle_arc_separator_tl ,
-% \l_siunitx_angle_astronomy_bool ,
-% \l_siunitx_angle_unit_product_tl
+% \l_@@_angle_degree_zero_bool ,
+% \l_@@_angle_minute_zero_bool ,
+% \l_@@_angle_second_zero_bool ,
+% \l_@@_angle_arc_separator_tl ,
+% \l_@@_angle_astronomy_bool ,
+% \l_@@_angle_unit_product_tl
%}
% The angle-specific options are created here.
% \begin{macrocode}
\keys_define:nn { siunitx } {
add-arc-degree-zero .bool_set:N =
- \l_siunitx_angle_degree_zero_bool ,
+ \l_@@_angle_degree_zero_bool ,
add-arc-minute-zero .bool_set:N =
- \l_siunitx_angle_minute_zero_bool ,
+ \l_@@_angle_minute_zero_bool ,
add-arc-second-zero .bool_set:N =
- \l_siunitx_angle_second_zero_bool ,
+ \l_@@_angle_second_zero_bool ,
angle-symbol-over-decimal .bool_set:N =
- \l_siunitx_angle_astronomy_bool ,
+ \l_@@_angle_astronomy_bool ,
arc-separator .tl_set:N =
- \l_siunitx_angle_arc_separator_tl ,
+ \l_@@_angle_arc_separator_tl ,
number-angle-product .tl_set:N =
- \l_siunitx_angle_unit_product_tl ,
+ \l_@@_angle_unit_product_tl ,
number-angle-separator .tl_set:N =
- \l_siunitx_angle_unit_product_tl ,
+ \l_@@_angle_unit_product_tl ,
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_angle_output:nnn}
-%\begin{macro}[aux]{\siunitx_angle_output_aux:nnn}
+%\begin{macro}{\@@_angle_output:nnn}
+%\begin{macro}[aux]{\@@_angle_output_aux:nnn}
% The input will have been split up by \pkg{xparse}, and so the various
% possible inputs can be picked up. To keep to a minimal route through
% the code, a decimal angle is simply treated like an arc, but with
% any zero-filling disabled.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_angle_output:nnn #1#2#3 {
- \siunitx_angle_init:
+\cs_new_protected:Npn \@@_angle_output:nnn #1#2#3 {
+ \@@_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} { } { }
+ \bool_set_false:N \l_@@_angle_minute_zero_bool
+ \bool_set_false:N \l_@@_angle_second_zero_bool
+ \@@_angle_output_aux:nnn {#1} { } { }
}
{
\IfNoValueTF {#3}
- { \siunitx_error:nx { invalid-arc-format } { #1 ; #2 } }
- { \siunitx_angle_output_aux:nnn {#1} {#2} {#3} }
+ { \@@_error:nx { invalid-arc-format } { #1 ; #2 } }
+ { \@@_angle_output_aux:nnn {#1} {#2} {#3} }
}
}
-\cs_new_protected:Npn \siunitx_angle_output_aux:nnn #1#2#3 {
+\cs_new_protected:Npn \@@_angle_output_aux:nnn #1#2#3 {
\tl_if_empty:nTF { #1#2#3 }
- { \siunitx_error:n { empty-arc } }
+ { \@@_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} }
+ \bool_if:NTF \l_@@_number_parse_bool
+ { \@@_angle_parse:nnn {#1} {#2} {#3} }
+ { \@@_angle_direct:nnn {#1} {#2} {#3} }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_angle_init:}
+%\begin{macro}{\@@_angle_init:}
% The usual separation of initial storage resets.
% \begin{macrocode}
-\cs_new_protected: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_product_tl
- \l_siunitx_angle_unit_product_tl
- \cs_set_eq:NN \siunitx_number_in_parse_more:N
- \siunitx_number_in_parse_restricted:N
+\cs_new_protected:Npn \@@_angle_init: {
+ \bool_set_false:N \l_@@_angle_degree_space_bool
+ \bool_set_false:N \l_@@_angle_minute_space_bool
+ \prop_clear:N \l_@@_angle_degree_prop
+ \prop_clear:N \l_@@_angle_minute_prop
+ \prop_clear:N \l_@@_angle_second_prop
+ \tl_clear:N \l_@@_preunit_tl
+ \tl_set_eq:NN \l_@@_number_unit_product_tl
+ \l_@@_angle_unit_product_tl
+ \cs_set_eq:NN \@@_number_in_parse_more:N
+ \@@_number_in_parse_restricted:N
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_angle_direct:nnn}
+%\begin{macro}{\@@_angle_direct:nnn}
%\begin{macro}[aux]{
-% \siunitx_angle_direct_aux_i:nnn ,
-% \siunitx_angle_direct_aux_ii:nnn ,
-% \siunitx_angle_direct_aux_iii:nnn
+% \@@_angle_direct_aux_i:nnn ,
+% \@@_angle_direct_aux_ii:nnn ,
+% \@@_angle_direct_aux_iii:nnn
%}
% When printing an arc directly, there is still the need to fill in
% any zero values required and to check the spacing is correct. That
% is done using a chain approach, which is easy to implement and
% reasonably clear.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_angle_direct:nnn #1 {
+\cs_new_protected:Npn \@@_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 { } }
+ \bool_if:NTF \l_@@_angle_degree_zero_bool
+ { \@@_angle_direct_aux_i:nnn { 0 } }
+ { \@@_angle_direct_aux_i:nnn { } }
}
- { \siunitx_angle_direct_aux_i:nnn {#1} }
+ { \@@_angle_direct_aux_i:nnn {#1} }
}
-\cs_new_protected:Npn \siunitx_angle_direct_aux_i:nnn #1#2 {
+\cs_new_protected:Npn \@@_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} { } }
+ \bool_if:NTF \l_@@_angle_minte_zero_bool
+ { \@@_angle_direct_aux_ii:nnn {#1} { 0 } }
+ { \@@_angle_direct_aux_ii:nnn {#1} { } }
}
- { \siunitx_angle_direct_aux_ii:nnn {#1} {#2} }
+ { \@@_angle_direct_aux_ii:nnn {#1} {#2} }
}
-\cs_new_protected:Npn \siunitx_angle_direct_aux_ii:nnn #1#2#3 {
+\cs_new_protected:Npn \@@_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} { } }
+ \bool_if:NTF \l_@@_angle_second_zero_bool
+ { \@@_angle_direct_aux_iii:nnn {#1} {#2} { 0 } }
+ { \@@_angle_direct_aux_iii:nnn {#1} {#2} { } }
}
- { \siunitx_angle_direct_aux_iii:nnn {#1} {#2} {#3} }
+ { \@@_angle_direct_aux_iii:nnn {#1} {#2} {#3} }
}
-\cs_new_protected:Npn \siunitx_angle_direct_aux_iii:nnn #1#2#3 {
+\cs_new_protected:Npn \@@_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 }
+ { \bool_set_true:N \l_@@_angle_degree_space_bool }
}
\tl_if_empty:nF {#2}
{
\tl_if_empty:nF {#3}
- { \bool_set_true:N \l_siunitx_angle_minute_space_bool }
+ { \bool_set_true:N \l_@@_angle_minute_space_bool }
}
- \siunitx_angle_print_direct:nnn {#1} {#2} {#3}
+ \@@_angle_print_direct:nnn {#1} {#2} {#3}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_angle_parse:nnn ,
-% \siunitx_angle_check_sign: ,
-% \siunitx_angle_zero_fill: ,
-% \siunitx_angle_sign_shuffle:nn
+% \@@_angle_parse:nnn ,
+% \@@_angle_check_sign: ,
+% \@@_angle_zero_fill: ,
+% \@@_angle_sign_shuffle:nn
%}
%\begin{macro}[aux]{
-% \siunitx_angle_parse_aux:nnn ,
-% \siunitx_angle_check_sign:n ,
-% \siunitx_angle_sign_shuffle_aux:nnn
+% \@@_angle_parse_aux:nnn ,
+% \@@_angle_check_sign:n ,
+% \@@_angle_sign_shuffle_aux:nnn
%}
% Parsing an arc requires a number of stages. First, there is the
% basic conversion of the input numbers into three property lists,
@@ -10719,64 +10725,64 @@ This work consists of the file siunitx.dtx
% After that, a check to make sure there is only one sign for an arc
% before setting up the inter-part spacing and actually printing.
% \begin{macrocode}
-\cs_new_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 }
+\cs_new_protected:Npn \@@_angle_parse:nnn #1#2#3 {
+ \@@_angle_parse_aux:nn {#1} { degree }
+ \@@_angle_parse_aux:nn {#2} { minute }
+ \@@_angle_parse_aux:nn {#3} { second }
+ \@@_angle_check_sign:
+ \@@_angle_zero_fill:
+ \prop_if_empty:NF \l_@@_angle_degree_prop
+ {
+ \prop_if_empty:NF \l_@@_angle_minute_prop
+ { \bool_set_true:N \l_@@_angle_degree_space_bool }
+ \prop_if_empty:NF \l_@@_angle_second_prop
+ { \bool_set_true:N \l_@@_angle_degree_space_bool }
}
- \prop_if_empty:NF \l_siunitx_angle_minute_prop
+ \prop_if_empty:NF \l_@@_angle_minute_prop
{
- \prop_if_empty:NF \l_siunitx_angle_second_prop
- { \bool_set_true:N \l_siunitx_angle_minute_space_bool }
+ \prop_if_empty:NF \l_@@_angle_second_prop
+ { \bool_set_true:N \l_@@_angle_minute_space_bool }
}
- \siunitx_angle_print:
+ \@@_angle_print:
}
-\cs_new_protected:Npn \siunitx_angle_parse_aux:nn #1#2 {
- \prop_clear:N \l_siunitx_number_in_prop
+\cs_new_protected:Npn \@@_angle_parse_aux:nn #1#2 {
+ \prop_clear:N \l_@@_number_in_prop
\tl_if_empty:nF {#1}
{
- \siunitx_number_in_init:
- \siunitx_number_in_parse_aux:n {#1}
+ \@@_number_in_init:
+ \@@_number_in_parse_aux:n {#1}
}
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-sign-deleted }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-sign-deleted }
+ \l_@@_tmpa_tl
{
- \prop_put:NnV \l_siunitx_number_in_prop { mantissa-sign }
- \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_in_prop { mantissa-sign }
+ \l_@@_tmpa_tl
}
- \siunitx_number_process:
- \prop_set_eq:cN { l_siunitx_angle_ #2 _prop }
- \l_siunitx_number_in_prop
+ \@@_number_process:
+ \prop_set_eq:cN { l_@@_angle_ #2 _prop }
+ \l_@@_number_in_prop
}
% \end{macrocode}
% Only the highest-order part of an arc can have a sign. This is checked
% now so that the shuffling code is easier to write.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_angle_check_sign: {
- \prop_if_empty:NTF \l_siunitx_angle_degree_prop
+\cs_new_protected:Npn \@@_angle_check_sign: {
+ \prop_if_empty:NTF \l_@@_angle_degree_prop
{
- \prop_if_empty:NF \l_siunitx_angle_minute_prop
- { \siunitx_angle_check_sign_aux:n { second } }
+ \prop_if_empty:NF \l_@@_angle_minute_prop
+ { \@@_angle_check_sign_aux:n { second } }
}
{
- \siunitx_angle_check_sign_aux:n { minute }
- \siunitx_angle_check_sign_aux:n { second }
+ \@@_angle_check_sign_aux:n { minute }
+ \@@_angle_check_sign_aux:n { second }
}
}
-\cs_new_protected:Npn \siunitx_angle_check_sign_aux:n #1 {
- \prop_if_in:cnTF { l_siunitx_angle_ #1 _prop }
+\cs_new_protected:Npn \@@_angle_check_sign_aux:n #1 {
+ \prop_if_in:cnTF { l_@@_angle_ #1 _prop }
{ mantissa-sign }
{ \msg_error:nn { siunitx } { bad-arc-sign } }
{
- \prop_if_in:cnT { l_siunitx_angle_ #1 _prop }
+ \prop_if_in:cnT { l_@@_angle_ #1 _prop }
{ mantissa-sign-deleted }
{ \msg_error:nn { siunitx } { bad-arc-sign } }
}
@@ -10786,108 +10792,108 @@ This work consists of the file siunitx.dtx
% to worry about. There is therefore a shuffle to move them into the
% correct places.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_angle_zero_fill: {
+\cs_new_protected:Npn \@@_angle_zero_fill: {
\bool_if:nT
{
- \prop_if_empty_p:N \l_siunitx_angle_second_prop &&
- \l_siunitx_angle_second_zero_bool
+ \prop_if_empty_p:N \l_@@_angle_second_prop &&
+ \l_@@_angle_second_zero_bool
}
{
- \prop_put:Nnn \l_siunitx_angle_second_prop { mantissa }
+ \prop_put:Nnn \l_@@_angle_second_prop { mantissa }
{ true }
- \prop_put:Nnn \l_siunitx_angle_second_prop { mantissa-integer }
+ \prop_put:Nnn \l_@@_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_if_empty_p:N \l_@@_angle_minute_prop &&
+ \l_@@_angle_minute_zero_bool
}
{
- \prop_put:Nnn \l_siunitx_angle_minute_prop { mantissa }
+ \prop_put:Nnn \l_@@_angle_minute_prop { mantissa }
{ true }
- \prop_put:Nnn \l_siunitx_angle_minute_prop { mantissa-integer }
+ \prop_put:Nnn \l_@@_angle_minute_prop { mantissa-integer }
{ 0 }
- \siunitx_angle_sign_shuffle:nn { second } { minute }
+ \@@_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_if_empty_p:N \l_@@_angle_degree_prop &&
+ \l_@@_angle_degree_zero_bool
}
{
- \prop_put:Nnn \l_siunitx_angle_degree_prop { mantissa }
+ \prop_put:Nnn \l_@@_angle_degree_prop { mantissa }
{ true }
- \prop_put:Nnn \l_siunitx_angle_degree_prop { mantissa-integer }
+ \prop_put:Nnn \l_@@_angle_degree_prop { mantissa-integer }
{ 0 }
- \siunitx_angle_sign_shuffle:nn { second } { degree }
- \siunitx_angle_sign_shuffle:nn { minute } { degree }
+ \@@_angle_sign_shuffle:nn { second } { degree }
+ \@@_angle_sign_shuffle:nn { minute } { degree }
}
}
-\cs_new_protected: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_new_protected:Npn \@@_angle_sign_shuffle:nn #1#2 {
+ \@@_angle_sign_shuffle_aux:nnn {#1} {#2} { }
+ \@@_angle_sign_shuffle_aux:nnn {#1} {#2} { -deleted }
}
-\cs_new_protected:Npn \siunitx_angle_sign_shuffle_aux:nnn
+\cs_new_protected:Npn \@@_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_get:cnN { l_@@_angle_ #1 _prop } { mantissa-sign #3 }
+ \l_@@_tmpa_tl
+ \prop_del:cn { l_@@_angle_ #1 _prop } { mantissa-sign #3 }
+ \quark_if_no_value:NF \l_@@_tmpa_tl
{
- \prop_put:cnV { l_siunitx_angle_ #2 _prop } { mantissa-sign #3 }
- \l_siunitx_tmpa_tl
+ \prop_put:cnV { l_@@_angle_ #2 _prop } { mantissa-sign #3 }
+ \l_@@_tmpa_tl
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_angle_print:}
-%\begin{macro}[aux]{\siunitx_angle_print:nn}
+%\begin{macro}{\@@_angle_print:}
+%\begin{macro}[aux]{\@@_angle_print:nn}
% The standard printing routine examines each part of the arc in turn
% and either does a standard format or calls the special astronomy-style
% routine. There may also be some spaces to add.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_angle_print: {
- \siunitx_angle_print_aux:nn { degree } { \SIUnitSymbolDegree }
- \bool_if:NT \l_siunitx_angle_degree_space_bool
+\cs_new_protected:Npn \@@_angle_print: {
+ \@@_angle_print_aux:nn { degree } { \SIUnitSymbolDegree }
+ \bool_if:NT \l_@@_angle_degree_space_bool
{
\nobreak
- \l_siunitx_angle_arc_separator_tl
+ \l_@@_angle_arc_separator_tl
}
- \siunitx_angle_print_aux:nn { minute } { \SIUnitSymbolArcminute }
- \bool_if:NT \l_siunitx_angle_minute_space_bool
+ \@@_angle_print_aux:nn { minute } { \SIUnitSymbolArcminute }
+ \bool_if:NT \l_@@_angle_minute_space_bool
{
\nobreak
- \l_siunitx_angle_arc_separator_tl
+ \l_@@_angle_arc_separator_tl
}
- \siunitx_angle_print_aux:nn { second } { \SIUnitSymbolArcsecond }
-}
-\cs_new_protected: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: }
+ \@@_angle_print_aux:nn { second } { \SIUnitSymbolArcsecond }
+}
+\cs_new_protected:Npn \@@_angle_print_aux:nn #1#2 {
+ \prop_if_empty:cF { l_@@_angle_ #1 _prop }
+ {
+ \prop_set_eq:Nc \l_@@_number_in_prop
+ { l_@@_angle_ #1 _prop }
+ \tl_set:Nn \l_@@_unit_tl {#2}
+ \tl_clear:N \l_@@_number_out_tl
+ \@@_number_format:
+ \@@_number_output_color:
+ \bool_if:NTF \l_@@_angle_astronomy_bool
+ { \@@_angle_print_astronomy: }
+ { \@@_number_output_single: }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_angle_print_astronomy:}
+%\begin{macro}{\@@_angle_print_astronomy:}
%\begin{macro}[aux]{
-% \siunitx_angle_print_astronomy_aux: ,
-% \siunitx_angle_print_astronomy_aux:n ,
-% \siunitx_angle_print_astronomy_marker: ,
-% \siunitx_angle_print_astronomy_unit:
+% \@@_angle_print_astronomy_aux: ,
+% \@@_angle_print_astronomy_aux:n ,
+% \@@_angle_print_astronomy_marker: ,
+% \@@_angle_print_astronomy_unit:
%}
% The first check for astronomy-style angles is that there is a decimal
% marker in the current input: if not, the standard method can be used.
@@ -10903,101 +10909,101 @@ This work consists of the file siunitx.dtx
% added in after superscripts, which otherwise messes up the
% calculation.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_angle_print_astronomy: {
- \prop_if_in:NnTF \l_siunitx_number_in_prop
+\cs_new_protected:Npn \@@_angle_print_astronomy: {
+ \prop_if_in:NnTF \l_@@_number_in_prop
{ mantissa-decimal-marker }
- { \siunitx_angle_print_astronomy_aux: }
- { \siunitx_number_output_single: }
+ { \@@_angle_print_astronomy_aux: }
+ { \@@_number_output_single: }
}
-\cs_new_protected:Npn \siunitx_angle_print_astronomy_aux: {
- \prop_get:NnNT \l_siunitx_number_out_prop { mantissa-integer }
- \l_siunitx_tmpa_tl
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \hbox_set:Nn \l_siunitx_angle_marker_box
+\cs_new_protected:Npn \@@_angle_print_astronomy_aux: {
+ \prop_get:NnNT \l_@@_number_out_prop { mantissa-integer }
+ \l_@@_tmpa_tl
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \hbox_set:Nn \l_@@_angle_marker_box
{
- \siunitx_print:nn { number } { { \l_siunitx_output_decimal_tl } }
+ \@@_print:nn { number } { { \l_@@_output_decimal_tl } }
}
- \hbox_set:Nn \l_siunitx_angle_unit_box
+ \hbox_set:Nn \l_@@_angle_unit_box
{
- \siunitx_print:nV { unit } \l_siunitx_unit_tl
+ \@@_print:nV { unit } \l_@@_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
+ \@@_angle_print_astronomy_aux:n { marker }
+ \@@_angle_print_astronomy_aux:n { unit }
+ \hbox_set:Nn \l_@@_angle_marker_box
{
- \box_use:N \l_siunitx_angle_marker_box
- \box_use:N \l_siunitx_angle_unit_box
+ \box_use:N \l_@@_angle_marker_box
+ \box_use:N \l_@@_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:NnNT \l_siunitx_number_out_prop { mantissa-decimal }
- \l_siunitx_tmpa_tl
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
-}
-\cs_new_protected: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 }
+ { \l_@@_angle_marker_dim } > { \l_@@_angle_unit_dim }
+ { \@@_angle_print_astronomy_marker: }
+ { \@@_angle_print_astronomy_unit: }
+ \prop_get:NnNT \l_@@_number_out_prop { mantissa-decimal }
+ \l_@@_tmpa_tl
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+}
+\cs_new_protected:Npn \@@_angle_print_astronomy_aux:n #1 {
+ \dim_set:cn { l_@@_angle_ #1 _dim }
+ { \box_wd:c { l_@@_angle_ #1 _box } }
+ \hbox_set_to_wd:cnn { l_@@_angle_ #1 _box } { \c_zero_skip }
{
\tex_hss:D
- \hbox_unpack:c { l_siunitx_angle_ #1_box }
+ \hbox_unpack:c { l_@@_angle_ #1_box }
\tex_hss:D
}
}
-\cs_new_protected:Npn \siunitx_angle_print_astronomy_marker: {
- \hbox_set_to_wd:Nnn \l_siunitx_angle_marker_box
- { \l_siunitx_angle_marker_dim }
+\cs_new_protected:Npn \@@_angle_print_astronomy_marker: {
+ \hbox_set_to_wd:Nnn \l_@@_angle_marker_box
+ { \l_@@_angle_marker_dim }
{
\tex_hss:D
- \hbox_unpack:N \l_siunitx_angle_marker_box
+ \hbox_unpack:N \l_@@_angle_marker_box
\tex_hss:D
}
- \box_use:N \l_siunitx_angle_marker_box
+ \box_use:N \l_@@_angle_marker_box
}
-\cs_new_protected:Npn \siunitx_angle_print_astronomy_unit: {
- \hbox_set_to_wd:Nnn \l_siunitx_angle_marker_box
- { \l_siunitx_angle_unit_dim }
+\cs_new_protected:Npn \@@_angle_print_astronomy_unit: {
+ \hbox_set_to_wd:Nnn \l_@@_angle_marker_box
+ { \l_@@_angle_unit_dim }
{
\tex_hss:D
- \hbox_unpack:N \l_siunitx_angle_marker_box
+ \hbox_unpack:N \l_@@_angle_marker_box
\tex_hss:D
}
- \box_use:N \l_siunitx_angle_marker_box
+ \box_use:N \l_@@_angle_marker_box
\skip_horizontal:N \scriptspace
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_angle_print_direct:nnn}
-%\begin{macro}[aux]{\siunitx_angle_print_direct_aux:nn}
+%\begin{macro}{\@@_angle_print_direct:nnn}
+%\begin{macro}[aux]{\@@_angle_print_direct_aux:nn}
% The direct printing routine is rather similar to the standard
% one, with just a modified final step.
% \begin{macrocode}
-\cs_new_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
+\cs_new_protected:Npn \@@_angle_print_direct:nnn #1#2#3 {
+ \@@_angle_print_direct_aux:nn {#1} { \SIUnitSymbolDegree }
+ \bool_if:NT \l_@@_angle_degree_space_bool
{
\nobreak
- \l_siunitx_angle_arc_separator_tl
+ \l_@@_angle_arc_separator_tl
}
- \siunitx_angle_print_direct_aux:nn {#2} { \SIUnitSymbolArcminute }
- \bool_if:NT \l_siunitx_angle_minute_space_bool
+ \@@_angle_print_direct_aux:nn {#2} { \SIUnitSymbolArcminute }
+ \bool_if:NT \l_@@_angle_minute_space_bool
{
\nobreak
- \l_siunitx_angle_arc_separator_tl
+ \l_@@_angle_arc_separator_tl
}
- \siunitx_angle_print_direct_aux:nn {#3} { \SIUnitSymbolArcsecond }
+ \@@_angle_print_direct_aux:nn {#3} { \SIUnitSymbolArcsecond }
}
-\cs_new_protected:Npn \siunitx_angle_print_direct_aux:nn #1#2 {
+\cs_new_protected:Npn \@@_angle_print_direct_aux:nn #1#2 {
\tl_if_empty:nF {#1}
{
- \tl_set:Nn \l_siunitx_unit_tl {#2}
- \siunitx_print:nn { number } { \ensuremath {#1} }
- \siunitx_unit_output_print:
+ \tl_set:Nn \l_@@_unit_tl {#2}
+ \@@_print:nn { number } { \ensuremath {#1} }
+ \@@_unit_output_print:
}
}
% \end{macrocode}
@@ -11011,104 +11017,104 @@ This work consists of the file siunitx.dtx
% method only makes these available inside the unit-processing functions
% (\cs{SI}, \cs{si} and the \texttt{S} column).
%
-%\begin{macro}{\l_siunitx_declare_list_seq}
+%\begin{macro}{\l_@@_declare_list_seq}
% A list of all unit and related functions.
% \begin{macrocode}
-\seq_new:N \l_siunitx_declare_list_seq
-\seq_put_right:Nn \l_siunitx_declare_list_seq { \of }
-\seq_put_right:Nn \l_siunitx_declare_list_seq { \highlight }
-\seq_put_right:Nn \l_siunitx_declare_list_seq { \per }
-\seq_put_right:Nn \l_siunitx_declare_list_seq { \raiseto }
-\seq_put_right:Nn \l_siunitx_declare_list_seq { \tothe }
+\seq_new:N \l_@@_declare_list_seq
+\seq_put_right:Nn \l_@@_declare_list_seq { \of }
+\seq_put_right:Nn \l_@@_declare_list_seq { \highlight }
+\seq_put_right:Nn \l_@@_declare_list_seq { \per }
+\seq_put_right:Nn \l_@@_declare_list_seq { \raiseto }
+\seq_put_right:Nn \l_@@_declare_list_seq { \tothe }
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_declare_power_after:Nn ,
-% \siunitx_declare_power_before:Nn
+% \@@_declare_power_after:Nn ,
+% \@@_declare_power_before:Nn
%}
% Creating powers is all about storing values.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_declare_power_after:Nn #1#2 {
- \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w }
- { \siunitx_textsuperscript:n {#2} }
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _function:w }
- { \siunitx_unit_parse_power_after:n {#2} }
+\cs_new_protected:Npn \@@_declare_power_after:Nn #1#2 {
+ \seq_put_right:Nn \l_@@_declare_list_seq {#1}
+ \cs_set:cpn { @@_ \token_to_str:N #1 _literal:w }
+ { \@@_textsuperscript:n {#2} }
+ \cs_set:cpn { @@_ \token_to_str:N #1 _function:w }
+ { \@@_unit_parse_power_after:n {#2} }
}
-\cs_new_protected:Npn \siunitx_declare_power_before:Nn #1#2 {
- \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w } ##1
- { ##1 \siunitx_textsuperscript:n {#2} }
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _function:w }
- { \siunitx_unit_parse_power_before:n {#2} }
+\cs_new_protected:Npn \@@_declare_power_before:Nn #1#2 {
+ \seq_put_right:Nn \l_@@_declare_list_seq {#1}
+ \cs_set:cpn { @@_ \token_to_str:N #1 _literal:w } ##1
+ { ##1 \@@_textsuperscript:n {#2} }
+ \cs_set:cpn { @@_ \token_to_str:N #1 _function:w }
+ { \@@_unit_parse_power_before:n {#2} }
}
% \end{macrocode}
%\end{macro}
%
-% \begin{macro}{\siunitx_declare_prefix:Nnnn}
+% \begin{macro}{\@@_declare_prefix:Nnnn}
% \begin{variable}
-% {\l_siunitx_prefix_forward_prop, \l_siunitx_prefix_reverse_prop}
+% {\l_@@_prefix_forward_prop, \l_@@_prefix_reverse_prop}
% Prefixes need to store both the symbol and the power they represent.
% A reverse system is also set up, to allow powers to be converted to
% prefixes.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_declare_prefix:Nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_declare_prefix:Nnnn #1#2#3#4
{
- \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
- \prop_put:Nnn \l_siunitx_prefix_forward_prop {#1} {#4}
- \prop_put:Nnn \l_siunitx_prefix_reverse_prop {#4} {#1}
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w } {#2}
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _function:w }
+ \seq_put_right:Nn \l_@@_declare_list_seq {#1}
+ \prop_put:Nnn \l_@@_prefix_forward_prop {#1} {#4}
+ \prop_put:Nnn \l_@@_prefix_reverse_prop {#4} {#1}
+ \cs_set:cpn { @@_ \token_to_str:N #1 _literal:w } {#2}
+ \cs_set:cpn { @@_ \token_to_str:N #1 _function:w }
{
- \bool_if:NTF \l_siunitx_prefix_symbols_bool
- { \siunitx_unit_parse_prefix:Nn #1 {#2} }
- { \siunitx_unit_parse_prefix:nn {#3} {#4} }
+ \bool_if:NTF \l_@@_prefix_symbols_bool
+ { \@@_unit_parse_prefix:Nn #1 {#2} }
+ { \@@_unit_parse_prefix:nn {#3} {#4} }
}
}
-\prop_new:N \l_siunitx_prefix_forward_prop
-\prop_new:N \l_siunitx_prefix_reverse_prop
+\prop_new:N \l_@@_prefix_forward_prop
+\prop_new:N \l_@@_prefix_reverse_prop
% \end{macrocode}
% \end{variable}
% \end{macro}
%
-%\begin{macro}{\siunitx_declare_qualifier:Nn}
+%\begin{macro}{\@@_declare_qualifier:Nn}
% Qualifiers just need storing.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_declare_qualifier:Nn #1#2 {
- \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w }
+\cs_new_protected:Npn \@@_declare_qualifier:Nn #1#2 {
+ \seq_put_right:Nn \l_@@_declare_list_seq {#1}
+ \cs_set:cpn { @@_ \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:cpn { @@_ \token_to_str:N #1 _function:w }
+ { \@@_unit_parse_qualifier:n {#2} }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_declare_unit:Nnn}
-%\begin{macro}[aux]{\siunitx_unit_first_token:n}
+%\begin{macro}{\@@_declare_unit:Nnn}
+%\begin{macro}[aux]{\@@_unit_first_token:n}
% Creating units requires various things to be stored. This is done
% with several storage bins to keep the code clear. For the
% \texttt{macro} definition, the test occurs at use so that there is no
% problem with the creation order for units.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_declare_unit:Nnn #1#2#3 {
- \seq_put_right:Nn \l_siunitx_declare_list_seq {#1}
- \cs_set:cpn { siunitx_ \token_to_str:N #1 _literal:w } {#2}
- \cs_set_protected:cpn { siunitx_ \token_to_str:N #1 _function:w }
+\cs_new_protected:Npn \@@_declare_unit:Nnn #1#2#3 {
+ \seq_put_right:Nn \l_@@_declare_list_seq {#1}
+ \cs_set:cpn { @@_ \token_to_str:N #1 _literal:w } {#2}
+ \cs_set_protected:cpn { @@_ \token_to_str:N #1 _function:w }
{
- \siunitx_unit_if_literal:nTF {#2}
- { \siunitx_unit_parse_unit:Nn #1 {#2} }
+ \@@_unit_if_literal:nTF {#2}
+ { \@@_unit_parse_unit:Nn #1 {#2} }
{#2}
}
\tl_if_empty:nTF {#3}
- { \cs_undefine:c { l_siunitx_ \token_to_str:N #1 _options_tl } }
+ { \cs_undefine:c { l_@@_ \token_to_str:N #1 _options_tl } }
{
- \tl_clear_new:c { l_siunitx_ \token_to_str:N #1 _options_tl }
- \tl_set:cn { l_siunitx_ \token_to_str:N #1 _options_tl } {#3}
+ \tl_clear_new:c { l_@@_ \token_to_str:N #1 _options_tl }
+ \tl_set:cn { l_@@_ \token_to_str:N #1 _options_tl } {#3}
}
}
-\cs_new_protected:Npn \siunitx_unit_first_token:n #1 {
+\cs_new_protected:Npn \@@_unit_first_token:n #1 {
\exp_last_unbraced:No \token_to_str:N { \tl_head:w #1 \q_stop }
}
% \end{macrocode}
@@ -11118,10 +11124,10 @@ This work consists of the file siunitx.dtx
%\begin{macro}{\per}
% The \cs{per} function is pretty simple.
% \begin{macrocode}
-\cs_new:cpn { siunitx_ \token_to_str:N \per _literal:w } { / }
-\cs_new_protected:cpn { siunitx_ \token_to_str:N \per _function:w } {
- \bool_set_true:N \l_siunitx_per_bool
- \siunitx_unit_parse_per:
+\cs_new:cpn { @@_ \token_to_str:N \per _literal:w } { / }
+\cs_new_protected:cpn { @@_ \token_to_str:N \per _function:w } {
+ \bool_set_true:N \l_@@_per_bool
+ \@@_unit_parse_per:
}
% \end{macrocode}
%\end{macro}
@@ -11132,20 +11138,20 @@ This work consists of the file siunitx.dtx
%}
% Generic versions of the pre-set powers.
% \begin{macrocode}
-\cs_new:cpn { siunitx_ \token_to_str:N \raiseto _literal:w } #1#2 {
+\cs_new:cpn { @@_ \token_to_str:N \raiseto _literal:w } #1#2 {
#2
- \siunitx_textsuperscript:n {#1}
+ \@@_textsuperscript:n {#1}
}
-\cs_new_protected:cpn { siunitx_ \token_to_str:N \raiseto _function:w }
+\cs_new_protected:cpn { @@_ \token_to_str:N \raiseto _function:w }
#1 {
- \siunitx_unit_parse_power_before:n {#1}
+ \@@_unit_parse_power_before:n {#1}
}
-\cs_new:cpn { siunitx_ \token_to_str:N \tothe _literal:w } #1 {
- \siunitx_textsuperscript:n {#1}
+\cs_new:cpn { @@_ \token_to_str:N \tothe _literal:w } #1 {
+ \@@_textsuperscript:n {#1}
}
-\cs_new_protected:cpn { siunitx_ \token_to_str:N \tothe _function:w }
+\cs_new_protected:cpn { @@_ \token_to_str:N \tothe _function:w }
#1 {
- \siunitx_unit_parse_power_after:n {#1}
+ \@@_unit_parse_power_after:n {#1}
}
% \end{macrocode}
%\end{macro}
@@ -11153,28 +11159,28 @@ This work consists of the file siunitx.dtx
%\begin{macro}{\of}
% A flexible qualifier as well.
% \begin{macrocode}
-\cs_new:cpn { siunitx_ \token_to_str:N \of _literal:w } #1 {
+\cs_new:cpn { @@_ \token_to_str:N \of _literal:w } #1 {
\text { ~ } ( #1 )
}
-\cs_new_protected:cpn { siunitx_ \token_to_str:N \of _function:w } #1 {
- \siunitx_unit_parse_qualifier:n {#1}
+\cs_new_protected:cpn { @@_ \token_to_str:N \of _function:w } #1 {
+ \@@_unit_parse_qualifier:n {#1}
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{\cancel}
-%\begin{macro}[aux]{\siunitx_cancel:n}
+%\begin{macro}[aux]{\@@_cancel:n}
% The \cs{cancel} macro is odd as it is only defined if the appropriate
% package is loaded.
% \begin{macrocode}
\AtBeginDocument {
\cs_if_exist:NT \cancel
{
- \cs_set_eq:NN \siunitx_cancel:n \cancel
- \seq_put_right:Nn \l_siunitx_declare_list_seq { \cancel }
+ \cs_set_eq:NN \@@_cancel:n \cancel
+ \seq_put_right:Nn \l_@@_declare_list_seq { \cancel }
\cs_new_protected:cpn
- { siunitx_ \token_to_str:N \cancel _function:w }
- { \siunitx_unit_parse_special:n { \siunitx_cancel:n } }
+ { @@_ \token_to_str:N \cancel _function:w }
+ { \@@_unit_parse_special:n { \@@_cancel:n } }
}
}
% \end{macrocode}
@@ -11185,11 +11191,11 @@ This work consists of the file siunitx.dtx
% Another special function: selective colour.
% \begin{macrocode}
\cs_new:cpn
- { siunitx_ \token_to_str:N \highlight _literal:w } #1
- { \siunitx_textcolor:n {#1} }
+ { @@_ \token_to_str:N \highlight _literal:w } #1
+ { \@@_textcolor:n {#1} }
\cs_new_protected:cpn
- { siunitx_ \token_to_str:N \highlight _function:w } #1
- { \siunitx_unit_parse_special:n { \siunitx_textcolor:n {#1} } }
+ { @@_ \token_to_str:N \highlight _function:w } #1
+ { \@@_unit_parse_special:n { \@@_textcolor:n {#1} } }
% \end{macrocode}
%\end{macro}
%
@@ -11200,23 +11206,23 @@ This work consists of the file siunitx.dtx
% document body.
%
%\begin{macro}{
-% \l_siunitx_create_free_bool ,
-% \l_siunitx_create_overwrite_bool ,
-% \l_siunitx_create_prespace_bool ,
-% \l_siunitx_create_optional_bool ,
-% \l_siunitx_create_xspace_bool
+% \l_@@_create_free_bool ,
+% \l_@@_create_overwrite_bool ,
+% \l_@@_create_prespace_bool ,
+% \l_@@_create_optional_bool ,
+% \l_@@_create_xspace_bool
%}
% There are a few options which control this behaviour: these are all
% preamble-only.
% \begin{macrocode}
\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 ,
+ free-standing-units .bool_set:N = \l_@@_create_free_bool ,
+ overwrite-functions .bool_set:N = \l_@@_create_overwrite_bool,
+ space-before-unit .bool_set:N = \l_@@_create_prespace_bool ,
+ unit-optional-argument .bool_set:N = \l_@@_create_optional_bool ,
+ use-xspace .bool_set:N = \l_@@_create_xspace_bool ,
}
-\siunitx_option_deactivate:n {
+\@@_option_deactivate:n {
free-standing-units ,
overwrite-functions ,
space-before-unit ,
@@ -11226,19 +11232,19 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_create_empty_functions:}
-%\begin{macro}[aux]{\siunitx_unit_create_empty_functions_aux:N}
+%\begin{macro}{\@@_unit_create_empty_functions:}
+%\begin{macro}[aux]{\@@_unit_create_empty_functions_aux:N}
% Without this, horrible things happen with \pkg{memoir} and
% \pkg{hyperref}.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \siunitx_unit_create_empty_functions:
+\cs_new_protected_nopar:Npn \@@_unit_create_empty_functions:
{
- \siunitx_unit_create_functions_aux_i:
- \seq_map_function:NN \l_siunitx_declare_list_seq
- \siunitx_unit_create_empty_functions_aux:N
- \siunitx_unit_create_functions_aux_ii:
+ \@@_unit_create_functions_aux_i:
+ \seq_map_function:NN \l_@@_declare_list_seq
+ \@@_unit_create_empty_functions_aux:N
+ \@@_unit_create_functions_aux_ii:
}
-\cs_new_protected:Npn \siunitx_unit_create_empty_functions_aux:N #1
+\cs_new_protected:Npn \@@_unit_create_empty_functions_aux:N #1
{
\cs_if_free:NT #1
{ \cs_set_protected:Npn #1 { \ERROR } }
@@ -11247,40 +11253,40 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-% \begin{macro}{\siunitx_unit_create_functions:}
+% \begin{macro}{\@@_unit_create_functions:}
% \begin{macro}[aux]
% {
-% \siunitx_unit_create_functions_aux_i:,
-% \siunitx_unit_create_functions_aux_ii:
+% \@@_unit_create_functions_aux_i:,
+% \@@_unit_create_functions_aux_ii:
% }
% Creation of macros essentially involves picking up a couple of loops.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \siunitx_unit_create_functions:
+\cs_new_protected_nopar:Npn \@@_unit_create_functions:
{
- \siunitx_unit_create_functions_aux_i:
- \bool_if:NT \l_siunitx_create_overwrite_bool
- { \seq_map_function:NN \l_siunitx_declare_list_seq \cs_undefine:N }
- \bool_if:NTF \l_siunitx_create_optional_bool
+ \@@_unit_create_functions_aux_i:
+ \bool_if:NT \l_@@_create_overwrite_bool
+ { \seq_map_function:NN \l_@@_declare_list_seq \cs_undefine:N }
+ \bool_if:NTF \l_@@_create_optional_bool
{
- \seq_map_function:NN \l_siunitx_declare_list_seq
- \siunitx_unit_create_with_arg:N
+ \seq_map_function:NN \l_@@_declare_list_seq
+ \@@_unit_create_with_arg:N
}
{
- \seq_map_function:NN \l_siunitx_declare_list_seq
- \siunitx_unit_create:N
+ \seq_map_function:NN \l_@@_declare_list_seq
+ \@@_unit_create:N
}
- \siunitx_unit_create_functions_aux_ii:
- \bool_if:NT \l_siunitx_create_xspace_bool
+ \@@_unit_create_functions_aux_ii:
+ \bool_if:NT \l_@@_create_xspace_bool
{ \RequirePackage { xspace } }
}
-\cs_new_protected_nopar:Npn \siunitx_unit_create_functions_aux_i:
+\cs_new_protected_nopar:Npn \@@_unit_create_functions_aux_i:
{
\@ifpackageloaded { soulpos }
{
\@ifpackageloaded { soul }
{ }
{
- \cs_set_protected_nopar:Npn \siunitx_unit_create_functions_aux_ii:
+ \cs_set_protected_nopar:Npn \@@_unit_create_functions_aux_ii:
{
\cs_undefine:N \hl
\cs_undefine:N \ul
@@ -11289,82 +11295,82 @@ This work consists of the file siunitx.dtx
}
{ }
}
-\cs_new_protected_nopar:Npn \siunitx_unit_create_functions_aux_ii: { }
+\cs_new_protected_nopar:Npn \@@_unit_create_functions_aux_ii: { }
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%\begin{macro}{
-% \siunitx_unit_create:N ,
-% \siunitx_unit_create_with_arg:N
+% \@@_unit_create:N ,
+% \@@_unit_create_with_arg:N
%}
% The creation functions expand everything as far as possible so that
% there is less to do in the document.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_create:N #1 {
+\cs_new_protected:Npn \@@_unit_create:N #1 {
\cs_if_free:NT #1
{
- \cs_set:Npx \siunitx_tmp:w
+ \cs_set:Npx \@@_tmp:w
{
\ProvideDocumentCommand \exp_not:N #1 { }
{
\group_begin:
\exp_not:N \cs_if_free:NF
\exp_not:c
- { l_siunitx_ \token_to_str:N #1 _options_tl }
+ { l_@@_ \token_to_str:N #1 _options_tl }
{
\keys_set:nV { siunitx }
\exp_not:c
- { l_siunitx_ \token_to_str:N #1 _options_tl }
+ { l_@@_ \token_to_str:N #1 _options_tl }
}
- \bool_if:NT \l_siunitx_create_prespace_bool
- { \exp_not:N \l_siunitx_number_unit_product_tl }
- \exp_not:n { \siunitx_unit_output:nn {#1} { } }
+ \bool_if:NT \l_@@_create_prespace_bool
+ { \exp_not:N \l_@@_number_unit_product_tl }
+ \exp_not:n { \@@_unit_output:nn {#1} { } }
\group_end:
- \bool_if:NT \l_siunitx_create_xspace_bool
+ \bool_if:NT \l_@@_create_xspace_bool
{ \exp_not:N \xspace }
}
}
- \siunitx_tmp:w
+ \@@_tmp:w
}
}
-\cs_new_protected:Npn \siunitx_unit_create_with_arg:N #1 {
+\cs_new_protected:Npn \@@_unit_create_with_arg:N #1 {
\cs_if_free:NT #1
{
- \cs_set:Npx \siunitx_tmp:w
+ \cs_set:Npx \@@_tmp:w
{
\ProvideDocumentCommand \exp_not:N #1 { o }
{
\group_begin:
\exp_not:N \cs_if_free:NF
\exp_not:c
- { l_siunitx_ \token_to_str:N #1 _options_tl }
+ { l_@@_ \token_to_str:N #1 _options_tl }
{
\keys_set:nV { siunitx }
\exp_not:c
{
- l_siunitx_ \token_to_str:N #1 _options_tl
+ l_@@_ \token_to_str:N #1 _options_tl
}
}
\exp_not:N \IfNoValueTF {####1}
{
- \bool_if:NT \l_siunitx_create_prespace_bool
- { \exp_not:N \l_siunitx_number_unit_product_tl }
- \exp_not:n { \siunitx_unit_output:nn {#1} { } }
+ \bool_if:NT \l_@@_create_prespace_bool
+ { \exp_not:N \l_@@_number_unit_product_tl }
+ \exp_not:n { \@@_unit_output:nn {#1} { } }
}
{ \SI {####1} { \exp_not:N #1 } }
\group_end:
- \bool_if:NT \l_siunitx_create_xspace_bool
+ \bool_if:NT \l_@@_create_xspace_bool
{ \exp_not:N \xspace }
}
}
- \siunitx_tmp:w
+ \@@_tmp:w
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_protect_symbols:N}
+%\begin{macro}{\@@_protect_symbols:N}
% There are a few unit names which may be defined by other parts of
% \LaTeX. They need to be unexpandable, as in an \texttt{S} column
% \TeX{} will look for \cs{omit} \emph{before} starting the internal
@@ -11376,17 +11382,17 @@ This work consists of the file siunitx.dtx
\AtBeginDocument {
\cs_if_eq:NNT \color \use_none:n
{ \cs_set_protected:Npn \color #1 { } }
- \cs_set:Npn \siunitx_tmp:w #1 { }
- \cs_if_eq:NNT \color \siunitx_tmp:w
+ \cs_set:Npn \@@_tmp:w #1 { }
+ \cs_if_eq:NNT \color \@@_tmp:w
{ \cs_set_protected:Npn \color #1 { } }
\tl_map_function:nN { \bar \color \ng \pm \array@row@rst }
- \siunitx_protect_symbols:N
+ \@@_protect_symbols:N
}
-\tl_put_right:Nn \document { \siunitx_protect_symbols:N \fg }
-\cs_new_protected:Npn \siunitx_protect_symbols:N #1 {
+\tl_put_right:Nn \document { \@@_protect_symbols:N \fg }
+\cs_new_protected:Npn \@@_protect_symbols:N #1 {
\cs_if_exist:NT #1
{
- \siunitx_cs_if_macro:NT #1
+ \@@_cs_if_macro:NT #1
{ \cs_set_protected:Npx #1 { \exp_not:V #1 } }
}
}
@@ -11400,15 +11406,15 @@ This work consists of the file siunitx.dtx
% input part of the process is used to sort out parsed or literal units.
%
%\begin{macro}{
-% \l_siunitx_unit_forbid_literal_bool ,
-% \l_siunitx_unit_parse_bool
+% \l_@@_unit_forbid_literal_bool ,
+% \l_@@_unit_parse_bool
%}
% One option is related to how units are pre-processed.
% \begin{macrocode}
\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
+ \l_@@_unit_forbid_literal_bool,
+ parse-units .bool_set:N = \l_@@_unit_parse_bool
}
\keys_set:nn { siunitx } {
forbid-literal-units = false,
@@ -11418,71 +11424,71 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_unit_in:nn ,
-% \siunitx_unit_in:Vn ,
-% \siunitx_pm:
+% \@@_unit_in:nn ,
+% \@@_unit_in:Vn ,
+% \@@_pm:
%}
% The master function does a very simple checks then hands off.
% The definition of \cs{pm} needs to be saved here so that it can
% safely be used as an abbreviation for picometre and also in numbers
% for \( \pm \).
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_in:nn #1#2 {
- \bool_if:NTF \l_siunitx_unit_parse_bool
+\cs_new_protected:Npn \@@_unit_in:nn #1#2 {
+ \bool_if:NTF \l_@@_unit_parse_bool
{
\tl_if_empty:nF {#1}
{
- \siunitx_unit_if_literal:nTF {#1}
+ \@@_unit_if_literal:nTF {#1}
{
- \tl_clear:N \l_siunitx_per_mode_tl
- \bool_if:NTF \l_siunitx_unit_forbid_literal_bool
+ \tl_clear:N \l_@@_per_mode_tl
+ \bool_if:NTF \l_@@_unit_forbid_literal_bool
{
\msg_error:nnx { siunitx } { literal-unit }
{ \exp_not:n {#1} }
}
{
- \cs_set_eq:NN \siunitx_pm: \pm
- \siunitx_unit_format_literal:n {#1}
- \cs_set_eq:NN \pm \siunitx_pm:
+ \cs_set_eq:NN \@@_pm: \pm
+ \@@_unit_format_literal:n {#1}
+ \cs_set_eq:NN \pm \@@_pm:
}
}
{
- \cs_set_eq:NN \siunitx_pm: \pm
- \siunitx_unit_parse:nn {#1} {#2}
- \siunitx_unit_format:
- \prop_set_eq:NN \l_siunitx_unit_saved_prop \l_siunitx_unit_prop
- \cs_set_eq:NN \pm \siunitx_pm:
+ \cs_set_eq:NN \@@_pm: \pm
+ \@@_unit_parse:nn {#1} {#2}
+ \@@_unit_format:
+ \prop_set_eq:NN \l_@@_unit_saved_prop \l_@@_unit_prop
+ \cs_set_eq:NN \pm \@@_pm:
}
}
}
- { \siunitx_unit_format_literal:n {#1} }
+ { \@@_unit_format_literal:n {#1} }
}
-\cs_generate_variant:Nn \siunitx_unit_in:nn { V }
-\cs_new:Npn \siunitx_pm: { }
+\cs_generate_variant:Nn \@@_unit_in:nn { V }
+\cs_new:Npn \@@_pm: { }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_if_literal:nTF}
-%\begin{macro}[aux]{\siunitx_unit_if_literal_aux:N}
+%\begin{macro}{\@@_unit_if_literal:nTF}
+%\begin{macro}[aux]{\@@_unit_if_literal_aux:N}
% A test is needed to see if the input only contains unit macros. This
% is done by altering setting all of the unit macros to expand to
% nothing at all. Thus there will only be anything left if there is
% a literal in the unit.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_if_literal:nTF #1#2#3 {
+\cs_new_protected:Npn \@@_unit_if_literal:nTF #1#2#3 {
\group_begin:
- \seq_map_function:NN \l_siunitx_declare_list_seq
- \siunitx_unit_if_literal_aux:N
+ \seq_map_function:NN \l_@@_declare_list_seq
+ \@@_unit_if_literal_aux:N
\cs_set_eq:NN \of \use_none:n
\cs_set_eq:NN \highlight \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}
+ \protected@edef \l_@@_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}
+ \tl_set:Nn \l_@@_tmpa_tl \l_@@_tmpa_tl
+ \tl_if_empty:NTF \l_@@_tmpa_tl {#3} {#2}
}
-\cs_new_protected:Npn \siunitx_unit_if_literal_aux:N #1 {
+\cs_new_protected:Npn \@@_unit_if_literal_aux:N #1 {
\cs_set_eq:NN #1 \prg_do_nothing:
}
% \end{macrocode}
@@ -11498,87 +11504,87 @@ This work consists of the file siunitx.dtx
%
% \begin{variable}
% {
-% \l_siunitx_unit_int ,
-% \l_siunitx_unit_prop ,
-% \l_siunitx_unit_saved_prop
+% \l_@@_unit_int ,
+% \l_@@_unit_prop ,
+% \l_@@_unit_saved_prop
% }
% Parsed units are stored in a property list, to keep things compact.
% An integer is also needed to count up units.
% \begin{macrocode}
-\int_new:N \l_siunitx_unit_int
-\prop_new:N \l_siunitx_unit_prop
-\prop_new:N \l_siunitx_unit_saved_prop
+\int_new:N \l_@@_unit_int
+\prop_new:N \l_@@_unit_prop
+\prop_new:N \l_@@_unit_saved_prop
% \end{macrocode}
% \end{variable}
%
-%\begin{macro}{\l_siunitx_per_bool}
+%\begin{macro}{\l_@@_per_bool}
% To allow \cs{per} to be \enquote{sticky}.
% \begin{macrocode}
-\bool_new:N \l_siunitx_per_bool
+\bool_new:N \l_@@_per_bool
% \end{macrocode}
%\end{macro}
%
% \begin{variable}
% {
-% \l_siunitx_exp_to_prefix_bool ,
-% \l_siunitx_prefix_symbols_bool ,
-% \l_siunitx_sticky_per_bool
+% \l_@@_exp_to_prefix_bool ,
+% \l_@@_prefix_symbols_bool ,
+% \l_@@_sticky_per_bool
% }
% Some options are directly related to how units are handled at this
% stage, so need be created before the reconstruction part of the code.
% \begin{macrocode}
\keys_define:nn { siunitx }
{
- exponent-to-prefix .bool_set:N = \l_siunitx_exp_to_prefix_bool ,
- prefixes-as-symbols .bool_set:N = \l_siunitx_prefix_symbols_bool ,
- sticky-per .bool_set:N = \l_siunitx_sticky_per_bool
+ exponent-to-prefix .bool_set:N = \l_@@_exp_to_prefix_bool ,
+ prefixes-as-symbols .bool_set:N = \l_@@_prefix_symbols_bool ,
+ sticky-per .bool_set:N = \l_@@_sticky_per_bool
}
\keys_set:nn { siunitx } { prefixes-as-symbols = true }
% \end{macrocode}
% \end{variable}
%
-%\begin{macro}{\siunitx_unit_parse:nn}
+%\begin{macro}{\@@_unit_parse:nn}
% The unit to be parsed is received here along with any options given.
% The later are needed so that the user can override any saved options
% on a one-off basis.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse:nn #1#2 {
- \siunitx_unit_parse_init:
- \siunitx_unit_parse_options:nn {#1} {#2}
+\cs_new_protected:Npn \@@_unit_parse:nn #1#2 {
+ \@@_unit_parse_init:
+ \@@_unit_parse_options:nn {#1} {#2}
#1
}
% \end{macrocode}
%\end{macro}
%
-% \begin{macro}{\siunitx_unit_parse_init:}
+% \begin{macro}{\@@_unit_parse_init:}
% As always, the initialisation is a separate routine to make life a
% little clearer. The definition of \cs{pm} is saved here as it
% is used by units and numbers.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse_init:
+\cs_new_protected:Npn \@@_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
- \seq_map_inline:Nn \l_siunitx_declare_list_seq
- { \cs_set_eq:Nc ##1 { siunitx_ \token_to_str:N ##1 _function:w } }
+ \prop_clear:N \l_@@_unit_prop
+ \int_zero:N \l_@@_unit_int
+ \bool_set_false:N \l_@@_per_bool
+ \seq_map_inline:Nn \l_@@_declare_list_seq
+ { \cs_set_eq:Nc ##1 { @@_ \token_to_str:N ##1 _function:w } }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_parse_options:n}
+%\begin{macro}{\@@_unit_parse_options:n}
% Any unit-specific options are loaded, followed by re-applying any
% options given for this particular macro. The second call to
% \cs{keys_set:nn} is needed to allow the local overriding of settings.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse_options:nn #1#2 {
+\cs_new_protected:Npn \@@_unit_parse_options:nn #1#2 {
\tl_if_single:nT {#1}
{
\cs_if_free:cF
- { l_siunitx_ \siunitx_unit_first_token:n {#1} _options_tl }
+ { l_@@_ \@@_unit_first_token:n {#1} _options_tl }
{
\keys_set:nv { siunitx }
- { l_siunitx_ \siunitx_unit_first_token:n {#1} _options_tl }
+ { l_@@_ \@@_unit_first_token:n {#1} _options_tl }
\keys_set:nn { siunitx } {#2}
}
}
@@ -11587,131 +11593,131 @@ This work consists of the file siunitx.dtx
%\end{macro}
%
%\begin{macro}{
-% \siunitx_unit_parse_power_before:n ,
-% \siunitx_unit_parse_power_after:n
+% \@@_unit_parse_power_before:n ,
+% \@@_unit_parse_power_after:n
%}
% Storing powers depends on whether they are given before or after
% the unit.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse_power_before:n #1 {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { power- \int_eval:n { \l_siunitx_unit_int + 1 } }
- \prop_put:NVn \l_siunitx_unit_prop \l_siunitx_tmpa_tl {#1}
+\cs_new_protected:Npn \@@_unit_parse_power_before:n #1 {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { power- \int_eval:n { \l_@@_unit_int + 1 } }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#1}
}
-\cs_new_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_new_protected:Npn \@@_unit_parse_power_after:n #1 {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { power- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#1}
}
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \siunitx_unit_parse_prefix:Nn ,
-% \siunitx_unit_parse_prefix:nn
+% \@@_unit_parse_prefix:Nn ,
+% \@@_unit_parse_prefix:nn
%}
% Saving prefixes always increments the counter. For non-symbolic
% mode, the base needs to be saved along with the power.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse_prefix:Nn #1#2
+\cs_new_protected:Npn \@@_unit_parse_prefix:Nn #1#2
{
- \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}
- \tl_set:Nx \l_siunitx_tmpa_tl
- { prefix-symbol- \int_use:N \l_siunitx_unit_int }
- \prop_put:NVn \l_siunitx_unit_prop \l_siunitx_tmpa_tl {#2}
+ \int_incr:N \l_@@_unit_int
+ \tl_set:Nx \l_@@_tmpa_tl
+ { prefix- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#1}
+ \tl_set:Nx \l_@@_tmpa_tl
+ { prefix-symbol- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#2}
}
-\cs_new_protected:Npn \siunitx_unit_parse_prefix:nn #1#2
+\cs_new_protected:Npn \@@_unit_parse_prefix:nn #1#2
{
- \siunitx_unit_parse_prefix:Nn \ERROR {#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}
+ \@@_unit_parse_prefix:Nn \ERROR {#2}
+ \tl_set:Nx \l_@@_tmpa_tl
+ { prefix-base- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#1}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_parse_per:}
+%\begin{macro}{\@@_unit_parse_per:}
% The \cs{per} function always applies to the next unit seen, so
% the counter has to be advanced by one.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse_per: {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { per- \int_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_new_protected:Npn \@@_unit_parse_per: {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { per- \int_eval:n { \l_@@_unit_int + 1 } }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl { true }
+ \bool_if:NT \l_@@_sticky_per_bool
+ { \cs_set_eq:NN \per \@@_unit_parse_per_error: }
}
-\cs_new_protected:Npn \siunitx_unit_parse_per_error: {
+\cs_new_protected:Npn \@@_unit_parse_per_error: {
\msg_error:nn { siunitx } { duplicate-sticky-per }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_parse_qualifier:n}
+%\begin{macro}{\@@_unit_parse_qualifier:n}
% Qualifiers never alter the number of units.
% \begin{macrocode}
-\cs_new_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
+\cs_new_protected:Npn \@@_unit_parse_qualifier:n #1 {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { symbol- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVF \l_@@_unit_prop \l_@@_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}
+ \tl_set:Nx \l_@@_tmpa_tl
+ { qualifier- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#1}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_parse_special:n}
+%\begin{macro}{\@@_unit_parse_special:n}
% Special effects are possible by adding code to the unit property
% list here: this is pretty much arbitrary, so there is no real
% processing done.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse_special:n #1 {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { special- \int_eval:n { \l_siunitx_unit_int + 1 } }
- \prop_put:NVn \l_siunitx_unit_prop \l_siunitx_tmpa_tl {#1}
+\cs_new_protected:Npn \@@_unit_parse_special:n #1 {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { special- \int_eval:n { \l_@@_unit_int + 1 } }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#1}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_parse_unit:Nn}
-%\begin{macro}[aux]{\siunitx_unit_parse_unit_per:}
+%\begin{macro}{\@@_unit_parse_unit:Nn}
+%\begin{macro}[aux]{\@@_unit_parse_unit_per:}
% For units, there is a check in case a prefix is present (which will
% have incremented the counter). With the counter correct, simply add
% the literal to the property list. There is also a check to see if
% there is a \enquote{sticky} \cs{per} to think about.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_parse_unit:Nn #1#2 {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { prefix-symbol- \int_use:N \l_siunitx_unit_int }
- \prop_if_in:NVTF \l_siunitx_unit_prop \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_unit_parse_unit:Nn #1#2 {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { prefix-symbol- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVTF \l_@@_unit_prop \l_@@_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 }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { symbol- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVT \l_@@_unit_prop \l_@@_tmpa_tl
+ { \int_incr:N \l_@@_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_new_protected:Npn \siunitx_unit_parse_unit_per: {
- \bool_if:NT \l_siunitx_sticky_per_bool
- {
- \bool_if:NT \l_siunitx_per_bool
+ { \int_incr:N \l_@@_unit_int }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { unit- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#1}
+ \tl_set:Nx \l_@@_tmpa_tl
+ { symbol- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl {#2}
+ \@@_unit_parse_unit_per:
+}
+\cs_new_protected:Npn \@@_unit_parse_unit_per: {
+ \bool_if:NT \l_@@_sticky_per_bool
+ {
+ \bool_if:NT \l_@@_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
+ \tl_set:Nx \l_@@_tmpa_tl
+ { per- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl
{ true }
}
}
@@ -11723,163 +11729,163 @@ This work consists of the file siunitx.dtx
%\subsection{Unit formatting}
%
%\begin{macro}{
-% \l_siunitx_preunit_tl ,
-% \l_siunitx_unit_tl ,
-% \l_siunitx_unit_current_tl ,
-% \l_siunitx_unit_denominator_tl ,
-% \l_siunitx_unit_numerator_tl ,
-% \l_siunitx_unit_saved_tl
+% \l_@@_preunit_tl ,
+% \l_@@_unit_tl ,
+% \l_@@_unit_current_tl ,
+% \l_@@_unit_denominator_tl ,
+% \l_@@_unit_numerator_tl ,
+% \l_@@_unit_saved_tl
%}
% Storage space for creating unit output.
% \begin{macrocode}
-\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
+\tl_new:N \l_@@_preunit_tl
+\tl_new:N \l_@@_unit_tl
+\tl_new:N \l_@@_unit_current_tl
+\tl_new:N \l_@@_unit_denominator_tl
+\tl_new:N \l_@@_unit_numerator_tl
+\tl_new:N \l_@@_unit_saved_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_unit_denominator_int ,
-% \l_siunitx_unit_numerator_int
+% \l_@@_unit_denominator_int ,
+% \l_@@_unit_numerator_int
%}
% For tracking in case brackets are needed.
% \begin{macrocode}
-\int_new:N \l_siunitx_unit_denominator_int
-\int_new:N \l_siunitx_unit_numerator_int
+\int_new:N \l_@@_unit_denominator_int
+\int_new:N \l_@@_unit_numerator_int
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_unit_prefix_int ,
-% \l_siunitx_unit_prefix_base_int ,
-% \l_siunitx_unit_prefix_current_tl
+% \l_@@_unit_prefix_int ,
+% \l_@@_unit_prefix_base_int ,
+% \l_@@_unit_prefix_current_tl
%}
% Used to calculate the overall prefix value.
% \begin{macrocode}
-\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_@@_unit_prefix_int
+\int_new:N \l_@@_unit_prefix_base_int
+\tl_new:N \l_@@_unit_prefix_current_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_unit_prefix_gram_int}
+%\begin{macro}{\l_@@_unit_prefix_gram_int}
% Formatting units is complicated by the fact that the kilogram is a
% base unit, making conversions a little more awkward.
% \begin{macrocode}
-\int_new:N \l_siunitx_unit_prefix_gram_int
+\int_new:N \l_@@_unit_prefix_gram_int
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_omit_unit_space_bool}
+%\begin{macro}{\l_@@_omit_unit_space_bool}
% Needed to omit the space between a number an a unit when printing
% symbols and when there is no numerator unit.
% \begin{macrocode}
-\bool_new:N \l_siunitx_omit_unit_space_bool
+\bool_new:N \l_@@_omit_unit_space_bool
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_per_auto_bool ,
-% \l_siunitx_per_fraction_bool ,
-% \l_siunitx_per_mode_tl ,
-% \l_siunitx_power_number_bool ,
-% \l_siunitx_qualifier_mode_tl ,
-% \l_siunitx_per_two_parts_bool
+% \l_@@_per_auto_bool ,
+% \l_@@_per_fraction_bool ,
+% \l_@@_per_mode_tl ,
+% \l_@@_power_number_bool ,
+% \l_@@_qualifier_mode_tl ,
+% \l_@@_per_two_parts_bool
%}
% For saving settings.
% \begin{macrocode}
-\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_power_number_bool
-\bool_new:N \l_siunitx_two_parts_bool
-\tl_new:N \l_siunitx_qualifier_mode_tl
+\bool_new:N \l_@@_per_auto_bool
+\bool_new:N \l_@@_per_fraction_bool
+\tl_new:N \l_@@_per_mode_tl
+\bool_new:N \l_@@_power_number_bool
+\bool_new:N \l_@@_two_parts_bool
+\tl_new:N \l_@@_qualifier_mode_tl
% \end{macrocode}
%\end{macro}
%
%\begin{macro}{
-% \l_siunitx_unit_denominator_bracket_bool ,
-% \l_siunitx_unit_product_tl ,
-% \l_siunitx_literal_power_bool ,
-% \l_siunitx_per_symbol_tl ,
-% \l_siunitx_qualifier_phrase_tl
+% \l_@@_unit_denominator_bracket_bool ,
+% \l_@@_unit_product_tl ,
+% \l_@@_literal_power_bool ,
+% \l_@@_per_symbol_tl ,
+% \l_@@_qualifier_phrase_tl
%}
% At this stage, output formatting options are created.
% \begin{macrocode}
\keys_define:nn { siunitx } {
bracket-unit-denominator .bool_set:N
- = \l_siunitx_unit_denominator_bracket_bool,
- inter-unit-product .tl_set:N = \l_siunitx_unit_product_tl ,
- inter-unit-separator .tl_set:N = \l_siunitx_unit_product_tl ,
+ = \l_@@_unit_denominator_bracket_bool,
+ inter-unit-product .tl_set:N = \l_@@_unit_product_tl ,
+ inter-unit-separator .tl_set:N = \l_@@_unit_product_tl ,
literal-superscript-as-power
- .bool_set:N = \l_siunitx_literal_power_bool,
+ .bool_set:N = \l_@@_literal_power_bool,
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 }
+ \bool_set_false:N \l_@@_per_auto_bool
+ \bool_set_true:N \l_@@_per_fraction_bool
+ \bool_set_true:N \l_@@_per_two_parts_bool
+ \tl_set:Nn \l_@@_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
+ \bool_set_false:N \l_@@_per_auto_bool
+ \bool_set_false:N \l_@@_per_fraction_bool
+ \bool_set_false:N \l_@@_per_two_parts_bool
+ \tl_clear:N \l_@@_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
+ \bool_set_false:N \l_@@_per_auto_bool
+ \bool_set_false:N \l_@@_per_fraction_bool
+ \bool_set_true:N \l_@@_per_two_parts_bool
+ \tl_clear:N \l_@@_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 }
+ \bool_set_false:N \l_@@_per_auto_bool
+ \bool_set_false:N \l_@@_per_fraction_bool
+ \bool_set_false:N \l_@@_per_two_parts_bool
+ \tl_set:Nn \l_@@_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 }
+ \bool_set_false:N \l_@@_per_auto_bool
+ \bool_set_true:N \l_@@_per_fraction_bool
+ \bool_set_true:N \l_@@_per_two_parts_bool
+ \tl_set:Nn \l_@@_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
- \tl_set:Nn \l_siunitx_per_mode_tl { symbol }
+ \bool_set_true:N \l_@@_per_auto_bool
+ \bool_set_true:N \l_@@_per_fraction_bool
+ \bool_set_true:N \l_@@_per_two_parts_bool
+ \tl_set:Nn \l_@@_per_mode_tl { symbol }
},
- per-symbol .tl_set:N = \l_siunitx_per_symbol_tl,
+ per-symbol .tl_set:N = \l_@@_per_symbol_tl,
power-font .choice:,
power-font / number .code:n =
- { \bool_set_true:N \l_siunitx_power_number_bool },
+ { \bool_set_true:N \l_@@_power_number_bool },
power-font / unit .code:n =
- { \bool_set_false:N \l_siunitx_power_number_bool },
+ { \bool_set_false:N \l_@@_power_number_bool },
qualifier-mode .choice:,
qualifier-mode / brackets .code:n =
- { \tl_set:Nn \l_siunitx_qualifier_mode_tl { brackets } },
+ { \tl_set:Nn \l_@@_qualifier_mode_tl { brackets } },
qualifier-mode / phrase .code:n =
- { \tl_set:Nn \l_siunitx_qualifier_mode_tl { phrase } },
+ { \tl_set:Nn \l_@@_qualifier_mode_tl { phrase } },
qualifier-mode / space .code:n =
- { \tl_set:Nn \l_siunitx_qualifier_mode_tl { space } },
+ { \tl_set:Nn \l_@@_qualifier_mode_tl { space } },
qualifier-mode / subscript .code:n =
- { \tl_set:Nn \l_siunitx_qualifier_mode_tl { subscript } },
+ { \tl_set:Nn \l_@@_qualifier_mode_tl { subscript } },
qualifier-mode / text .code:n =
- { \tl_set:Nn \l_siunitx_qualifier_mode_tl { text } },
- qualifier-phrase .tl_set:N = \l_siunitx_qualifier_phrase_tl
+ { \tl_set:Nn \l_@@_qualifier_mode_tl { text } },
+ qualifier-phrase .tl_set:N = \l_@@_qualifier_phrase_tl
}
\keys_set:nn { siunitx } {
bracket-unit-denominator = true,
@@ -11894,145 +11900,145 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format:}
+%\begin{macro}{\@@_unit_format:}
% Most of the work is done by the loop, with a little tidying up for
% fraction-like output. Before starting the loop, there is a check for
% the case of a single reciprocal unit when per is set up to create a
% symbol. In that special case, the space between a number and a unit
% has to be removed.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format: {
- \siunitx_unit_format_init:
- \int_while_do:nNnn { \l_siunitx_unit_int } > { 0 }
+\cs_new_protected:Npn \@@_unit_format: {
+ \@@_unit_format_init:
+ \int_while_do:nNnn { \l_@@_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
+ \@@_unit_format_prefix:
+ \@@_unit_format_symbol:
+ \@@_unit_format_qualifier:
+ \@@_unit_format_power:
+ \@@_unit_format_add:
+ \int_decr:N \l_@@_unit_int
}
- \bool_if:NT \l_siunitx_per_two_parts_bool
+ \bool_if:NT \l_@@_per_two_parts_bool
{
- \bool_if:NTF \l_siunitx_per_fraction_bool
- { \siunitx_unit_format_fraction: }
- { \siunitx_unit_format_sorted: }
+ \bool_if:NTF \l_@@_per_fraction_bool
+ { \@@_unit_format_fraction: }
+ { \@@_unit_format_sorted: }
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format_add:}
-%\begin{macro}[aux]{\siunitx_unit_format_add_aux:n}
+%\begin{macro}{\@@_unit_format_add:}
+%\begin{macro}[aux]{\@@_unit_format_add_aux:n}
% Adding the current unit to the output means checking where it goes.
% The odd code when adding a space is to pick up repeated per symbols,
% which need to suppress the space.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_add: {
- \bool_if:NTF \l_siunitx_per_two_parts_bool
+\cs_new_protected:Npn \@@_unit_format_add: {
+ \bool_if:NTF \l_@@_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
+ \tl_set:Nx \l_@@_tmpb_tl
+ { per- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVTF \l_@@_unit_prop \l_@@_tmpb_tl
{
- \siunitx_unit_format_add_aux:n { _denominator }
- \int_incr:N \l_siunitx_unit_denominator_int
+ \@@_unit_format_add_aux:n { _denominator }
+ \int_incr:N \l_@@_unit_denominator_int
}
{
- \siunitx_unit_format_add_aux:n { _numerator }
- \int_incr:N \l_siunitx_unit_numerator_int
+ \@@_unit_format_add_aux:n { _numerator }
+ \int_incr:N \l_@@_unit_numerator_int
}
}
- { \siunitx_unit_format_add_aux:n { } }
- \tl_clear:N \l_siunitx_unit_current_tl
+ { \@@_unit_format_add_aux:n { } }
+ \tl_clear:N \l_@@_unit_current_tl
}
-\cs_new_protected:Npn \siunitx_unit_format_add_aux:n #1 {
- \tl_if_empty:cF { l_siunitx_unit #1 _tl }
+\cs_new_protected:Npn \@@_unit_format_add_aux:n #1 {
+ \tl_if_empty:cF { l_@@_unit #1 _tl }
{
- \str_if_eq:VnTF \l_siunitx_per_mode_tl { repeat }
+ \str_if_eq:VnTF \l_@@_per_mode_tl { repeat }
{
- \tl_set:Nx \l_siunitx_tmpa_tl
- { per- \int_eval:n { \l_siunitx_unit_int + 1 } }
- \prop_if_in:NVF \l_siunitx_unit_prop \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
+ { per- \int_eval:n { \l_@@_unit_int + 1 } }
+ \prop_if_in:NVF \l_@@_unit_prop \l_@@_tmpa_tl
{
- \tl_put_right:NV \l_siunitx_unit_current_tl
- \l_siunitx_unit_product_tl
+ \tl_put_right:NV \l_@@_unit_current_tl
+ \l_@@_unit_product_tl
}
}
{
- \tl_put_right:NV \l_siunitx_unit_current_tl
- \l_siunitx_unit_product_tl
+ \tl_put_right:NV \l_@@_unit_current_tl
+ \l_@@_unit_product_tl
}
}
- \tl_set:Nx \l_siunitx_tmpa_tl
- { special- \int_use:N \l_siunitx_unit_int }
- \prop_get:NVNTF \l_siunitx_unit_prop \l_siunitx_tmpa_tl
- \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
+ { special- \int_use:N \l_@@_unit_int }
+ \prop_get:NVNTF \l_@@_unit_prop \l_@@_tmpa_tl
+ \l_@@_tmpa_tl
{
- \tl_put_left:cx { l_siunitx_unit #1 _tl }
+ \tl_put_left:cx { l_@@_unit #1 _tl }
{
- \exp_not:V \l_siunitx_tmpa_tl
- { \exp_not:V \l_siunitx_unit_current_tl }
+ \exp_not:V \l_@@_tmpa_tl
+ { \exp_not:V \l_@@_unit_current_tl }
}
}
{
- \tl_put_left:cV { l_siunitx_unit #1 _tl }
- \l_siunitx_unit_current_tl
+ \tl_put_left:cV { l_@@_unit #1 _tl }
+ \l_@@_unit_current_tl
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format_fraction:}
+%\begin{macro}{\@@_unit_format_fraction:}
%\begin{macro}[aux]{
-% \siunitx_unit_format_fraction: ,
-% \siunitx_unit_format_auto: ,
-% \siunitx_unit_format_symbol: ,
-% \siunitx_unit_format_symbol_aux: ,
-% \siunitx_unit_format_symbol_aux_alt:
+% \@@_unit_format_fraction: ,
+% \@@_unit_format_auto: ,
+% \@@_unit_format_symbol: ,
+% \@@_unit_format_symbol_aux: ,
+% \@@_unit_format_symbol_aux_alt:
%}
% When making (\emph{psuedo}-)fractions there is a check to place a
% \( 1 \) in the numerator is it's blank. For symbol mode, this is
% only done if there is no number. Then some construction work.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_fraction: {
- \int_compare:nNnT { \l_siunitx_unit_numerator_int } = { 0 }
+\cs_new_protected:Npn \@@_unit_format_fraction: {
+ \int_compare:nNnT { \l_@@_unit_numerator_int } = { 0 }
{
- \str_if_eq:VnT \l_siunitx_per_mode_tl { symbol }
- { \bool_set_true:N \l_siunitx_omit_unit_space_bool }
+ \str_if_eq:VnT \l_@@_per_mode_tl { symbol }
+ { \bool_set_true:N \l_@@_omit_unit_space_bool }
}
- \int_compare:nNnTF { \l_siunitx_unit_denominator_int } > { 0 }
+ \int_compare:nNnTF { \l_@@_unit_denominator_int } > { 0 }
{
- \bool_if:NTF \l_siunitx_per_auto_bool
- { \siunitx_unit_format_fraction_auto: }
+ \bool_if:NTF \l_@@_per_auto_bool
+ { \@@_unit_format_fraction_auto: }
{
\use:c
- { siunitx_unit_format_fraction_ \l_siunitx_per_mode_tl : }
+ { @@_unit_format_fraction_ \l_@@_per_mode_tl : }
}
}
- { \tl_set_eq:NN \l_siunitx_unit_tl \l_siunitx_unit_numerator_tl }
-}
-\cs_new_protected: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 } }
+ { \tl_set_eq:NN \l_@@_unit_tl \l_@@_unit_numerator_tl }
+}
+\cs_new_protected:Npn \@@_unit_format_fraction_fraction: {
+ \tl_if_empty:NT \l_@@_unit_numerator_tl
+ { \tl_set:Nn \l_@@_unit_numerator_tl { 1 } }
+ \tl_set:Nx \l_@@_unit_numerator_tl
+ { { \exp_not:V \l_@@_unit_numerator_tl } }
+ \tl_put_left:Nn \l_@@_unit_numerator_tl
+ { \@@_print:nn { unit } }
+ \tl_set:Nx \l_@@_unit_numerator_tl
+ { { \exp_not:V \l_@@_unit_numerator_tl } }
+ \tl_set:Nx \l_@@_unit_denominator_tl
+ { { \exp_not:V \l_@@_unit_denominator_tl } }
+ \tl_put_left:Nn \l_@@_unit_denominator_tl
+ { \@@_print:nn { unit } }
+ \tl_set:Nx \l_@@_unit_denominator_tl
+ { { \exp_not:V \l_@@_unit_denominator_tl } }
+ \tl_set:Nn \l_@@_unit_tl { \@@_fraction:nn }
+ \tl_put_right:NV \l_@@_unit_tl \l_@@_unit_numerator_tl
+ \tl_put_right:NV \l_@@_unit_tl \l_@@_unit_denominator_tl
+ \tl_set:Nx \l_@@_unit_tl
+ { \exp_not:N \ensuremath { \exp_not:V \l_@@_unit_tl } }
}
% \end{macrocode}
% For the \opt{symbol} setting, there is a need to deal with the
@@ -12042,87 +12048,87 @@ This work consists of the file siunitx.dtx
% \cs{tex_mathchoice:D}, with appropriate protection, before sending
% everything through for printing.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_fraction_auto: {
+\cs_new_protected:Npn \@@_unit_format_fraction_auto: {
\mode_if_math:TF
{
\group_begin:
- \siunitx_unit_format_fraction_fraction:
+ \@@_unit_format_fraction_fraction:
\exp_args:NNNV \group_end:
- \tl_set:Nn \l_siunitx_tmpa_tl \l_siunitx_unit_tl
+ \tl_set:Nn \l_@@_tmpa_tl \l_@@_unit_tl
\group_begin:
- \siunitx_unit_format_fraction_symbol:
+ \@@_unit_format_fraction_symbol:
\exp_args:NNNV \group_end:
- \tl_set:Nn \l_siunitx_tmpb_tl \l_siunitx_unit_tl
- \tl_set:Nx \l_siunitx_tmpb_tl
+ \tl_set:Nn \l_@@_tmpb_tl \l_@@_unit_tl
+ \tl_set:Nx \l_@@_tmpb_tl
{
- \siunitx_print:nn { unit }
- { \exp_not:V \l_siunitx_tmpb_tl }
+ \@@_print:nn { unit }
+ { \exp_not:V \l_@@_tmpb_tl }
}
- \tl_set:Nx \l_siunitx_unit_tl
+ \tl_set:Nx \l_@@_unit_tl
{
\exp_not:N \ensuremath {
\tex_mathchoice:D
- { \exp_not:V \l_siunitx_tmpa_tl }
- { \exp_not:V \l_siunitx_tmpb_tl }
- { \exp_not:V \l_siunitx_tmpb_tl }
- { \exp_not:V \l_siunitx_tmpb_tl }
+ { \exp_not:V \l_@@_tmpa_tl }
+ { \exp_not:V \l_@@_tmpb_tl }
+ { \exp_not:V \l_@@_tmpb_tl }
+ { \exp_not:V \l_@@_tmpb_tl }
}
}
}
- { \siunitx_unit_format_fraction_symbol: }
+ { \@@_unit_format_fraction_symbol: }
}
% \end{macrocode}
% For a normal symbol, the two parts of the input are arranged either
% side of the symbol itself in math mode.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_fraction_symbol: {
- \siunitx_unit_format_fraction_symbol_aux:
- \int_compare:nNnT { \l_siunitx_unit_denominator_int } > { 1 }
+\cs_new_protected:Npn \@@_unit_format_fraction_symbol: {
+ \@@_unit_format_fraction_symbol_aux:
+ \int_compare:nNnT { \l_@@_unit_denominator_int } > { 1 }
{
- \bool_if:NT \l_siunitx_unit_denominator_bracket_bool
+ \bool_if:NT \l_@@_unit_denominator_bracket_bool
{
- \tl_put_left:NV \l_siunitx_unit_denominator_tl \l_siunitx_bracket_open_tl
- \tl_put_right:NV \l_siunitx_unit_denominator_tl \l_siunitx_bracket_close_tl
+ \tl_put_left:NV \l_@@_unit_denominator_tl \l_@@_bracket_open_tl
+ \tl_put_right:NV \l_@@_unit_denominator_tl \l_@@_bracket_close_tl
}
}
- \tl_set_eq:NN \l_siunitx_unit_tl \l_siunitx_unit_numerator_tl
- \tl_put_right:NV \l_siunitx_unit_tl \l_siunitx_per_symbol_tl
- \tl_put_right:NV \l_siunitx_unit_tl \l_siunitx_unit_denominator_tl
+ \tl_set_eq:NN \l_@@_unit_tl \l_@@_unit_numerator_tl
+ \tl_put_right:NV \l_@@_unit_tl \l_@@_per_symbol_tl
+ \tl_put_right:NV \l_@@_unit_tl \l_@@_unit_denominator_tl
}
\cs_new_protected:Npn
- \siunitx_unit_format_fraction_symbol_aux: { }
+ \@@_unit_format_fraction_symbol_aux: { }
\cs_new_protected: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 } }
+ \@@_unit_format_fraction_symbol_aux_alt: {
+ \tl_if_empty:NT \l_@@_unit_numerator_tl
+ { \tl_set:Nn \l_@@_unit_numerator_tl { 1 } }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format_init:}
+%\begin{macro}{\@@_unit_format_init:}
% The normal initialisation stuff.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_init: {
- \bool_set_false:N \l_siunitx_omit_unit_space_bool
- \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
- \seq_map_inline:Nn \l_siunitx_declare_list_seq
- { \siunitx_unit_print_literal_aux:N ##1 }
+\cs_new_protected:Npn \@@_unit_format_init: {
+ \bool_set_false:N \l_@@_omit_unit_space_bool
+ \tl_clear:N \l_@@_unit_tl
+ \tl_clear:N \l_@@_unit_current_tl
+ \tl_clear:N \l_@@_unit_denominator_tl
+ \int_zero:N \l_@@_unit_prefix_gram_int
+ \tl_clear:N \l_@@_unit_numerator_tl
+ \int_zero:N \l_@@_unit_prefix_base_int
+ \int_zero:N \l_@@_unit_prefix_int
+ \int_zero:N \l_@@_unit_denominator_int
+ \int_zero:N \l_@@_unit_numerator_int
+ \seq_map_inline:Nn \l_@@_declare_list_seq
+ { \@@_unit_print_literal_aux:N ##1 }
}
% \end{macrocode}
%\end{macro}
%
-% \begin{macro}{\siunitx_unit_format_literal:n}
-% \begin{macro}[aux]{\siunitx_unit_format_literal_aux:N}
-% \begin{macro}[aux]{\siunitx_unit_format_literal_power:n}
+% \begin{macro}{\@@_unit_format_literal:n}
+% \begin{macro}[aux]{\@@_unit_format_literal_aux:N}
+% \begin{macro}[aux]{\@@_unit_format_literal_power:n}
% If the unit given contains anything which is not a unit macro, then
% any unit macros that are there simply dump literal meanings. There is
% then a little work to do sorting out |~| and |.| characters at
@@ -12134,55 +12140,55 @@ This work consists of the file siunitx.dtx
\tl_to_lowercase:n
{
\group_end:
- \cs_new_protected:Npn \siunitx_unit_format_literal:n #1
+ \cs_new_protected:Npn \@@_unit_format_literal:n #1
{
- \int_zero:N \l_siunitx_unit_prefix_int
- \seq_map_inline:Nn \l_siunitx_declare_list_seq
- { \siunitx_unit_print_literal_aux:N ##1 }
- \tl_set:Nn \l_siunitx_unit_tl {#1}
- \tl_replace_all:NnV \l_siunitx_unit_tl { . } \l_siunitx_unit_product_tl
- \tl_replace_all:NnV \l_siunitx_unit_tl { ~ } \l_siunitx_unit_product_tl
- \bool_if:NT \l_siunitx_literal_power_bool
+ \int_zero:N \l_@@_unit_prefix_int
+ \seq_map_inline:Nn \l_@@_declare_list_seq
+ { \@@_unit_print_literal_aux:N ##1 }
+ \tl_set:Nn \l_@@_unit_tl {#1}
+ \tl_replace_all:NnV \l_@@_unit_tl { . } \l_@@_unit_product_tl
+ \tl_replace_all:NnV \l_@@_unit_tl { ~ } \l_@@_unit_product_tl
+ \bool_if:NT \l_@@_literal_power_bool
{
- \tl_replace_all:Nnn \l_siunitx_unit_tl { ^ }
- { \siunitx_unit_format_literal_power:n }
- \tl_replace_all:Nnn \l_siunitx_unit_tl { + }
- { \siunitx_unit_format_literal_power:n }
+ \tl_replace_all:Nnn \l_@@_unit_tl { ^ }
+ { \@@_unit_format_literal_power:n }
+ \tl_replace_all:Nnn \l_@@_unit_tl { + }
+ { \@@_unit_format_literal_power:n }
}
- \siunitx_unit_format_literal_extras:
+ \@@_unit_format_literal_extras:
}
}
-\cs_new_protected:Npn \siunitx_unit_print_literal_aux:N #1
- { \cs_set_eq:Nc #1 { siunitx_ \token_to_str:N #1 _literal:w } }
-\cs_new_protected:Npn \siunitx_unit_format_literal_power:n #1
- { \PrintSuperscript { \siunitx_unit_format_power_aux:n {#1} } }
+\cs_new_protected:Npn \@@_unit_print_literal_aux:N #1
+ { \cs_set_eq:Nc #1 { @@_ \token_to_str:N #1 _literal:w } }
+\cs_new_protected:Npn \@@_unit_format_literal_power:n #1
+ { \PrintSuperscript { \@@_unit_format_power_aux:n {#1} } }
% \end{macrocode}
% \end{macro}
% \end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format_literal_extras:}
-%\begin{macro}[aux]{\siunitx_unit_format_literal_extras_aux:nN}
+%\begin{macro}{\@@_unit_format_literal_extras:}
+%\begin{macro}[aux]{\@@_unit_format_literal_extras_aux:nN}
% The code here deals with characters outside the normal range that
% can appear in units in UTF-8 and related encodings. The idea is to
% do a search and replace, thus avoiding any active characters.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_literal_extras:
+\cs_new_protected:Npn \@@_unit_format_literal_extras:
{
- \siunitx_unit_format_literal_extras_aux:nN { 176 }
+ \@@_unit_format_literal_extras_aux:nN { 176 }
\SIUnitSymbolDegree
- \siunitx_unit_format_literal_extras_aux:nN { 181 }
+ \@@_unit_format_literal_extras_aux:nN { 181 }
\SIUnitSymbolMicro
- \siunitx_unit_format_literal_extras_aux:nN { 197 }
+ \@@_unit_format_literal_extras_aux:nN { 197 }
\SIUnitSymbolAngstrom
}
\cs_new_protected:Npn
- \siunitx_unit_format_literal_extras_aux:nN #1#2 {
+ \@@_unit_format_literal_extras_aux:nN #1#2 {
\char_set_lccode:nn { `\@ } {#1}
\tl_to_lowercase:n
{
- \tl_replace_all:NnV \l_siunitx_unit_tl { @ }
- \l_siunitx_unit_tl
+ \tl_replace_all:NnV \l_@@_unit_tl { @ }
+ \l_@@_unit_tl
}
}
\pdftex_if_engine:T
@@ -12191,15 +12197,15 @@ This work consists of the file siunitx.dtx
{
\cs_if_exist:NTF \inputencodingname
{
- \tl_set:Nn \l_siunitx_tmpa_tl { latin1 , latin5 , latin9 }
- \clist_if_in:NVF \l_siunitx_tmpa_tl \inputencodingname
+ \tl_set:Nn \l_@@_tmpa_tl { latin1 , latin5 , latin9 }
+ \clist_if_in:NVF \l_@@_tmpa_tl \inputencodingname
{
- \cs_set_eq:NN \siunitx_unit_format_literal_extras:
+ \cs_set_eq:NN \@@_unit_format_literal_extras:
\scan_stop:
}
}
{
- \cs_set_eq:NN \siunitx_unit_format_literal_extras:
+ \cs_set_eq:NN \@@_unit_format_literal_extras:
\scan_stop:
}
}
@@ -12208,33 +12214,33 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format_power:}
+%\begin{macro}{\@@_unit_format_power:}
%\begin{macro}[aux]{
-% \siunitx_unit_format_power_aux: ,
-% \siunitx_unit_format_power_aux:n ,
-% \siunitx_unit_format_power_aux:nn ,
-% \siunitx_unit_format_power_brackets: ,
-% \siunitx_unit_format_power_per: ,
-% \siunitx_unit_format_power_repeat:
+% \@@_unit_format_power_aux: ,
+% \@@_unit_format_power_aux:n ,
+% \@@_unit_format_power_aux:nn ,
+% \@@_unit_format_power_brackets: ,
+% \@@_unit_format_power_per: ,
+% \@@_unit_format_power_repeat:
%}
% To format powers, there are a few issues: are brackets needed, is
% the power reciprocal and is fraction-formatting in operation. Repeated
% per symbols make life a little more complex, as they have to be
% handled here as well.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_power: {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { power- \int_use:N \l_siunitx_unit_int }
- \prop_get:NVNTF \l_siunitx_unit_prop \l_siunitx_tmpa_tl
- \l_siunitx_tmpa_tl
- { \siunitx_unit_format_power_aux: }
+\cs_new_protected:Npn \@@_unit_format_power: {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { power- \int_use:N \l_@@_unit_int }
+ \prop_get:NVNTF \l_@@_unit_prop \l_@@_tmpa_tl
+ \l_@@_tmpa_tl
+ { \@@_unit_format_power_aux: }
{
- \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:Nx \l_@@_tmpa_tl
+ { per- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVT \l_@@_unit_prop \l_@@_tmpa_tl
{
- \tl_set:Nn \l_siunitx_tmpa_tl { 1 }
- \siunitx_unit_format_power_aux:
+ \tl_set:Nn \l_@@_tmpa_tl { 1 }
+ \@@_unit_format_power_aux:
}
}
}
@@ -12244,49 +12250,49 @@ This work consists of the file siunitx.dtx
% different. A search and replace function is needed for superscripts
% in text mode so that negative signs get printed correctly.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_power_aux: {
- \str_if_eq:VnTF \l_siunitx_per_mode_tl { repeat }
- { \siunitx_unit_format_power_repeat: }
- { \siunitx_unit_format_power_per: }
- \str_if_eq:VnF \l_siunitx_tmpa_tl { 1 }
+\cs_new_protected:Npn \@@_unit_format_power_aux: {
+ \str_if_eq:VnTF \l_@@_per_mode_tl { repeat }
+ { \@@_unit_format_power_repeat: }
+ { \@@_unit_format_power_per: }
+ \str_if_eq:VnF \l_@@_tmpa_tl { 1 }
{
- \siunitx_unit_format_power_brackets:
- \tl_put_right:Nx \l_siunitx_unit_current_tl
+ \@@_unit_format_power_brackets:
+ \tl_put_right:Nx \l_@@_unit_current_tl
{
\exp_not:N \PrintSuperscript
{
- \siunitx_unit_format_power_aux:n
- { \exp_not:V \l_siunitx_tmpa_tl }
+ \@@_unit_format_power_aux:n
+ { \exp_not:V \l_@@_tmpa_tl }
}
}
}
}
-\cs_new_protected:Npn \siunitx_unit_format_power_aux:n #1 {
- \bool_if:NTF \l_siunitx_power_number_bool
- { \siunitx_unit_format_power_aux:nn { number } {#1} }
- { \siunitx_unit_format_power_aux:nn { unit } {#1} }
+\cs_new_protected:Npn \@@_unit_format_power_aux:n #1 {
+ \bool_if:NTF \l_@@_power_number_bool
+ { \@@_unit_format_power_aux:nn { number } {#1} }
+ { \@@_unit_format_power_aux:nn { unit } {#1} }
}
-\cs_new_protected:Npn \siunitx_unit_format_power_aux:nn #1#2 {
- \bool_if:cTF { l_siunitx_ #1 _math_mode_bool }
- { \siunitx_print:nn {#1} {#2} }
+\cs_new_protected:Npn \@@_unit_format_power_aux:nn #1#2 {
+ \bool_if:cTF { l_@@_ #1 _math_mode_bool }
+ { \@@_print:nn {#1} {#2} }
{
- \tl_set:Nn \l_siunitx_tmpa_tl {#2}
- \tl_replace_all:Nnn \l_siunitx_tmpa_tl { - }
- { \text { \c_siunitx_minus_tl } }
- \siunitx_print:nV {#1} \l_siunitx_tmpa_tl
+ \tl_set:Nn \l_@@_tmpa_tl {#2}
+ \tl_replace_all:Nnn \l_@@_tmpa_tl { - }
+ { \text { \c_@@_minus_tl } }
+ \@@_print:nV {#1} \l_@@_tmpa_tl
}
}
% \end{macrocode}
% A check is made for a qualifier with a space, which needs brackets
% if there is also a power.
% \begin{macrocode}
-\cs_new_protected: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
+\cs_new_protected:Npn \@@_unit_format_power_brackets: {
+ \tl_set:Nx \l_@@_tmpb_tl
+ { bracket- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVT \l_@@_unit_prop \l_@@_tmpb_tl
{
- \tl_put_left:NV \l_siunitx_unit_current_tl \l_siunitx_bracket_open_tl
- \tl_put_right:NV \l_siunitx_unit_current_tl \l_siunitx_bracket_close_tl
+ \tl_put_left:NV \l_@@_unit_current_tl \l_@@_bracket_open_tl
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_bracket_close_tl
}
}
% \end{macrocode}
@@ -12294,69 +12300,69 @@ This work consists of the file siunitx.dtx
% change does not use any numbers, as this makes life easier with
% non-integer values.
% \begin{macrocode}
-\cs_new_protected: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
+\cs_new_protected:Npn \@@_unit_format_power_per: {
+ \tl_set:Nx \l_@@_tmpb_tl
+ { per- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVT \l_@@_unit_prop \l_@@_tmpb_tl
{
- \bool_if:NF \l_siunitx_per_fraction_bool
+ \bool_if:NF \l_@@_per_fraction_bool
{
- \tl_if_in:NnTF \l_siunitx_tmpa_tl { - }
+ \tl_if_in:NnTF \l_@@_tmpa_tl { - }
{
- \cs_set:Npn \siunitx_tmp:w ##1 - ##2 \q_stop
- { \tl_set:Nn \l_siunitx_tmpa_tl {##2} }
- \exp_after:wN \siunitx_tmp:w \l_siunitx_tmpa_tl \q_stop
+ \cs_set:Npn \@@_tmp:w ##1 - ##2 \q_stop
+ { \tl_set:Nn \l_@@_tmpa_tl {##2} }
+ \exp_after:wN \@@_tmp:w \l_@@_tmpa_tl \q_stop
}
- { \tl_put_left:Nn \l_siunitx_tmpa_tl { - } }
+ { \tl_put_left:Nn \l_@@_tmpa_tl { - } }
}
}
}
-\cs_new_protected: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
+\cs_new_protected:Npn \@@_unit_format_power_repeat: {
+ \tl_set:Nx \l_@@_tmpb_tl
+ { per- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVT \l_@@_unit_prop \l_@@_tmpb_tl
{
- \tl_put_left:NV \l_siunitx_unit_current_tl \l_siunitx_per_symbol_tl
+ \tl_put_left:NV \l_@@_unit_current_tl \l_@@_per_symbol_tl
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format_prefix:}
+%\begin{macro}{\@@_unit_format_prefix:}
%\begin{macro}[aux]{
-% \siunitx_unit_format_prefix_number: ,
-% \siunitx_unit_format_prefix_number_calc: ,
-% \siunitx_unit_format_prefix_symbol:
+% \@@_unit_format_prefix_number: ,
+% \@@_unit_format_prefix_number_calc: ,
+% \@@_unit_format_prefix_symbol:
%}
% If there is a prefix, it is added to the output. When using numerical
% output, some conversion is needed instead.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_prefix: {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { prefix-symbol- \int_use:N \l_siunitx_unit_int }
- \prop_if_in:NVT \l_siunitx_unit_prop \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_unit_format_prefix: {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { prefix-symbol- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVT \l_@@_unit_prop \l_@@_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: }
+ \prop_get:NVN \l_@@_unit_prop \l_@@_tmpa_tl
+ \l_@@_unit_prefix_current_tl
+ \bool_if:NTF \l_@@_prefix_symbols_bool
+ { \@@_unit_format_prefix_symbol: }
+ { \@@_unit_format_prefix_number: }
}
}
-\cs_new_protected: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
- \int_compare:nNnT { \l_siunitx_unit_prefix_base_int } = { 0 }
+\cs_new_protected:Npn \@@_unit_format_prefix_number: {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { prefix-base- \int_use:N \l_@@_unit_int }
+ \prop_get:NVN \l_@@_unit_prop \l_@@_tmpa_tl
+ \l_@@_tmpa_tl
+ \int_compare:nNnT { \l_@@_unit_prefix_base_int } = { 0 }
{
- \int_set:Nn \l_siunitx_unit_prefix_base_int
- { \l_siunitx_tmpa_tl }
+ \int_set:Nn \l_@@_unit_prefix_base_int
+ { \l_@@_tmpa_tl }
}
\int_compare:nNnTF
- { \l_siunitx_unit_prefix_base_int } = { \l_siunitx_tmpa_tl }
- { \siunitx_unit_format_prefix_number_calc: }
+ { \l_@@_unit_prefix_base_int } = { \l_@@_tmpa_tl }
+ { \@@_unit_format_prefix_number_calc: }
{ \msg_error:nn { siunitx } { prefix-base-mismatch } }
}
% \end{macrocode}
@@ -12365,163 +12371,163 @@ This work consists of the file siunitx.dtx
% is the kilogram and so there is some code to convert the number
% back correctly.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_prefix_number_calc: {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { power- \int_use:N \l_siunitx_unit_int }
- \prop_get:NVNF \l_siunitx_unit_prop \l_siunitx_tmpa_tl
- \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
- \str_if_eq:VnT \l_siunitx_tmpb_tl { \gram }
- {
- \tl_set:Nx \l_siunitx_unit_prefix_current_tl
- { \int_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 }
+\cs_new_protected:Npn \@@_unit_format_prefix_number_calc: {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { power- \int_use:N \l_@@_unit_int }
+ \prop_get:NVNF \l_@@_unit_prop \l_@@_tmpa_tl
+ \l_@@_tmpa_tl
+ { \tl_set:Nn \l_@@_tmpa_tl { 1 } }
+ \tl_set:Nx \l_@@_tmpb_tl
+ { unit- \int_use:N \l_@@_unit_int }
+ \prop_get:NVN \l_@@_unit_prop \l_@@_tmpb_tl
+ \l_@@_tmpb_tl
+ \str_if_eq:VnT \l_@@_tmpb_tl { \gram }
+ {
+ \tl_set:Nx \l_@@_unit_prefix_current_tl
+ { \int_eval:n { \l_@@_unit_prefix_current_tl - 3 } }
+ \tl_set:Nx \l_@@_tmpb_tl
+ { symbol- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpb_tl { kg }
}
- \tl_set:Nx \l_siunitx_unit_prefix_current_tl
+ \tl_set:Nx \l_@@_unit_prefix_current_tl
{
\int_eval:n
- { \l_siunitx_unit_prefix_current_tl * \l_siunitx_tmpa_tl }
+ { \l_@@_unit_prefix_current_tl * \l_@@_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
+ \tl_set:Nx \l_@@_tmpa_tl
+ { per- \int_use:N \l_@@_unit_int }
+ \prop_if_in:NVTF \l_@@_unit_prop \l_@@_tmpa_tl
{
- \int_set:Nn \l_siunitx_unit_prefix_int
+ \int_set:Nn \l_@@_unit_prefix_int
{
- \l_siunitx_unit_prefix_int
- - \l_siunitx_unit_prefix_current_tl
+ \l_@@_unit_prefix_int
+ - \l_@@_unit_prefix_current_tl
}
}
{
- \int_set:Nn \l_siunitx_unit_prefix_int
+ \int_set:Nn \l_@@_unit_prefix_int
{
- \l_siunitx_unit_prefix_int
- + \l_siunitx_unit_prefix_current_tl
+ \l_@@_unit_prefix_int
+ + \l_@@_unit_prefix_current_tl
}
}
}
-\cs_new_protected:Npn \siunitx_unit_format_prefix_symbol: {
- \tl_set_eq:NN \l_siunitx_unit_current_tl
- \l_siunitx_unit_prefix_current_tl
+\cs_new_protected:Npn \@@_unit_format_prefix_symbol: {
+ \tl_set_eq:NN \l_@@_unit_current_tl
+ \l_@@_unit_prefix_current_tl
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_format_qualifier:}
+%\begin{macro}{\@@_unit_format_qualifier:}
%\begin{macro}[aux]{
-% \siunitx_unit_format_qualifier_brackets: ,
-% \siunitx_unit_format_qualifier_phrase: ,
-% \siunitx_unit_format_qualifier_space: ,
-% \siunitx_unit_format_qualifier_subscript: ,
-% \siunitx_unit_format_qualifier_text:
+% \@@_unit_format_qualifier_brackets: ,
+% \@@_unit_format_qualifier_phrase: ,
+% \@@_unit_format_qualifier_space: ,
+% \@@_unit_format_qualifier_subscript: ,
+% \@@_unit_format_qualifier_text:
%}
% Four methods for showing qualifiers, each with its own sub-function.
% For the \texttt{space} methods, a warning is set in the property list
% as if there is a power then some brackets will be needed.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_qualifier: {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { qualifier- \int_use:N \l_siunitx_unit_int }
- \prop_get:NVNT \l_siunitx_unit_prop \l_siunitx_tmpa_tl
- \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_unit_format_qualifier: {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { qualifier- \int_use:N \l_@@_unit_int }
+ \prop_get:NVNT \l_@@_unit_prop \l_@@_tmpa_tl
+ \l_@@_tmpa_tl
{
\use:c
{
- siunitx_unit_format_qualifier_
- \l_siunitx_qualifier_mode_tl :
+ @@_unit_format_qualifier_
+ \l_@@_qualifier_mode_tl :
}
}
}
-\cs_new_protected:Npn \siunitx_unit_format_qualifier_brackets: {
- \tl_put_right:NV \l_siunitx_unit_current_tl \l_siunitx_bracket_open_tl
- \tl_put_right:NV \l_siunitx_unit_current_tl \l_siunitx_tmpa_tl
- \tl_put_right:NV \l_siunitx_unit_current_tl \l_siunitx_bracket_close_tl
+\cs_new_protected:Npn \@@_unit_format_qualifier_brackets: {
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_bracket_open_tl
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_tmpa_tl
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_bracket_close_tl
}
-\cs_new_protected_nopar:Npn \siunitx_unit_format_qualifier_phrase:
+\cs_new_protected_nopar:Npn \@@_unit_format_qualifier_phrase:
{
- \tl_put_right:NV \l_siunitx_unit_current_tl \l_siunitx_qualifier_phrase_tl
- \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 }
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_qualifier_phrase_tl
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
+ { bracket- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl { true }
}
\char_set_catcode_active:N \~
-\cs_new_protected: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 }
+\cs_new_protected:Npn \@@_unit_format_qualifier_space: {
+ \tl_put_right:Nn \l_@@_unit_current_tl { \text { ~ } }
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
+ { bracket- \int_use:N \l_@@_unit_int }
+ \prop_put:NVn \l_@@_unit_prop \l_@@_tmpa_tl { true }
}
\char_set_catcode_space:N \~
-\cs_new_protected:Npn \siunitx_unit_format_qualifier_subscript: {
- \tl_put_right:Nx \l_siunitx_unit_current_tl
- { \exp_not:N \PrintSubscript { \exp_not:V \l_siunitx_tmpa_tl } }
+\cs_new_protected:Npn \@@_unit_format_qualifier_subscript: {
+ \tl_put_right:Nx \l_@@_unit_current_tl
+ { \exp_not:N \PrintSubscript { \exp_not:V \l_@@_tmpa_tl } }
}
-\cs_new_protected:Npn \siunitx_unit_format_qualifier_text: {
- \tl_put_right:NV \l_siunitx_unit_current_tl \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_unit_format_qualifier_text: {
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_tmpa_tl
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-% \begin{macro}{\siunitx_unit_format_sorted:}
+% \begin{macro}{\@@_unit_format_sorted:}
% For when the powers are sorted with the positive ones first. The only
% slight issue is making sure that the additional space is included
% between the two units, if needed.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_sorted:
+\cs_new_protected:Npn \@@_unit_format_sorted:
{
- \tl_set_eq:NN \l_siunitx_unit_tl \l_siunitx_unit_numerator_tl
- \tl_if_empty:NT \l_siunitx_unit_tl
+ \tl_set_eq:NN \l_@@_unit_tl \l_@@_unit_numerator_tl
+ \tl_if_empty:NT \l_@@_unit_tl
{
- \tl_if_empty:NF \l_siunitx_unit_denominator_tl
+ \tl_if_empty:NF \l_@@_unit_denominator_tl
{
- \tl_put_right:NV \l_siunitx_unit_tl
- \l_siunitx_unit_product_tl
+ \tl_put_right:NV \l_@@_unit_tl
+ \l_@@_unit_product_tl
}
}
- \tl_put_right:NV \l_siunitx_unit_tl \l_siunitx_unit_denominator_tl
+ \tl_put_right:NV \l_@@_unit_tl \l_@@_unit_denominator_tl
}
% \end{macrocode}
% \end{macro}
%
-%\begin{macro}{\siunitx_unit_format_symbol:}
+%\begin{macro}{\@@_unit_format_symbol:}
%\begin{macro}[aux]{
-% \siunitx_unit_format_symbol_aux: ,
-% \siunitx_unit_format_symbol_aux_alt:
+% \@@_unit_format_symbol_aux: ,
+% \@@_unit_format_symbol_aux_alt:
%}
% If there is no symbol, something is wrong! The only exception is
% when the code is inside the \cs{si} function (or similar) and there
% is only a prefix with nothing else present at all.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_format_symbol: {
- \tl_set:Nx \l_siunitx_tmpa_tl
- { symbol- \int_use:N \l_siunitx_unit_int }
- \prop_get:NVNTF \l_siunitx_unit_prop \l_siunitx_tmpa_tl
- \l_siunitx_tmpa_tl
+\cs_new_protected:Npn \@@_unit_format_symbol: {
+ \tl_set:Nx \l_@@_tmpa_tl
+ { symbol- \int_use:N \l_@@_unit_int }
+ \prop_get:NVNTF \l_@@_unit_prop \l_@@_tmpa_tl
+ \l_@@_tmpa_tl
{
- \tl_put_right:NV \l_siunitx_unit_current_tl \l_siunitx_tmpa_tl
+ \tl_put_right:NV \l_@@_unit_current_tl \l_@@_tmpa_tl
}
- { \siunitx_unit_format_symbol_aux: }
+ { \@@_unit_format_symbol_aux: }
}
-\cs_new_protected:Npn \siunitx_unit_format_symbol_aux: {
+\cs_new_protected:Npn \@@_unit_format_symbol_aux: {
\msg_error:nn { siunitx } { prefix-only }
}
-\cs_new_protected:Npn \siunitx_unit_format_symbol_aux_alt: {
- \int_compare:nNnTF { \l_siunitx_unit_int } = { 1 }
+\cs_new_protected:Npn \@@_unit_format_symbol_aux_alt: {
+ \int_compare:nNnTF { \l_@@_unit_int } = { 1 }
{
- \prop_del:Nn \l_siunitx_unit_prop { prefix-1 }
- \prop_del:Nn \l_siunitx_unit_prop { prefix-symbol-1 }
- \prop_del:Nn \l_siunitx_unit_prop { prefix-base-1 }
- \prop_if_empty:NF \l_siunitx_unit_prop
+ \prop_del:Nn \l_@@_unit_prop { prefix-1 }
+ \prop_del:Nn \l_@@_unit_prop { prefix-symbol-1 }
+ \prop_del:Nn \l_@@_unit_prop { prefix-base-1 }
+ \prop_if_empty:NF \l_@@_unit_prop
{ \msg_error:nn { siunitx } { prefix-only } }
}
{ \msg_error:nn { siunitx } { prefix-only } }
@@ -12534,94 +12540,94 @@ This work consists of the file siunitx.dtx
%
% A collection of the internal parts of various user functions.
%
-%\begin{macro}{\l_siunitx_multi_brackets_bool}
-%\begin{macro}{\l_siunitx_multi_repeat_bool}
+%\begin{macro}{\l_@@_multi_brackets_bool}
+%\begin{macro}{\l_@@_multi_repeat_bool}
% Flags for multi-part numbers.
% \begin{macrocode}
-\bool_new:N \l_siunitx_multi_brackets_bool
-\bool_new:N \l_siunitx_multi_repeat_bool
+\bool_new:N \l_@@_multi_brackets_bool
+\bool_new:N \l_@@_multi_repeat_bool
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_product_brackets_bool}
-%\begin{macro}{\l_siunitx_product_power_bool}
-%\begin{macro}{\l_siunitx_number_unit_repeat_bool}
+%\begin{macro}{\l_@@_product_brackets_bool}
+%\begin{macro}{\l_@@_product_power_bool}
+%\begin{macro}{\l_@@_number_unit_repeat_bool}
% Flags for product units.
% \begin{macrocode}
-\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
+\bool_new:N \l_@@_product_brackets_bool
+\bool_new:N \l_@@_product_power_bool
+\bool_new:N \l_@@_number_unit_repeat_bool
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_unit_breaks_bool}
-%\begin{macro}{\l_siunitx_number_unit_product_tl}
+%\begin{macro}{\l_@@_number_unit_breaks_bool}
+%\begin{macro}{\l_@@_number_unit_product_tl}
% Options for printing units or units with numbers.
% \begin{macrocode}
\keys_define:nn { siunitx } {
allow-number-unit-breaks .bool_set:N =
- \l_siunitx_number_unit_breaks_bool,
+ \l_@@_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
+ \bool_set_true:N \l_@@_multi_brackets_bool
+ \bool_set_false:N \l_@@_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
+ \bool_set_false:N \l_@@_multi_brackets_bool
+ \bool_set_true:N \l_@@_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
+ \bool_set_false:N \l_@@_multi_brackets_bool
+ \bool_set_false:N \l_@@_multi_repeat_bool
},
number-unit-product .tl_set:N =
- \l_siunitx_number_unit_product_tl,
+ \l_@@_number_unit_product_tl,
number-unit-separator .tl_set:N =
- \l_siunitx_number_unit_product_tl,
+ \l_@@_number_unit_product_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
+ \bool_set_true:N \l_@@_product_brackets_bool
+ \bool_set_false:N \l_@@_product_power_bool
+ \bool_set_false:N \l_@@_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
+ \bool_set_true:N \l_@@_product_brackets_bool
+ \bool_set_true:N \l_@@_product_power_bool
+ \bool_set_false:N \l_@@_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
+ \bool_set_false:N \l_@@_product_brackets_bool
+ \bool_set_true:N \l_@@_product_power_bool
+ \bool_set_false:N \l_@@_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
+ \bool_set_false:N \l_@@_product_brackets_bool
+ \bool_set_false:N \l_@@_product_power_bool
+ \bool_set_true:N \l_@@_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
+ \bool_set_false:N \l_@@_product_brackets_bool
+ \bool_set_false:N \l_@@_product_power_bool
+ \bool_set_false:N \l_@@_product_repeat_bool
},
}
\keys_set:nn { siunitx } {
@@ -12633,109 +12639,109 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_output:nn}
-%\begin{macro}{\siunitx_unit_output:Vn}
+%\begin{macro}{\@@_unit_output:nn}
+%\begin{macro}{\@@_unit_output:Vn}
% For typesetting a unit directly: used by \cs{si} and the \texttt{s}
% column. The second argument is any options to set locally.
% \begin{macrocode}
-\cs_new_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_ii:
- \siunitx_unit_format_fraction_symbol_aux_alt:
- \siunitx_unit_in:nn {#1} {#2}
- \int_compare:nNnTF { \l_siunitx_unit_prefix_int } = { 0 }
+\cs_new_protected:Npn \@@_unit_output:nn #1#2 {
+ \cs_set_eq:NN \@@_unit_format_symbol_aux:
+ \@@_unit_format_symbol_aux_alt:
+ \cs_set_eq:NN \@@_unit_format_fraction_symbol_aux_ii:
+ \@@_unit_format_fraction_symbol_aux_alt:
+ \@@_unit_in:nn {#1} {#2}
+ \int_compare:nNnTF { \l_@@_unit_prefix_int } = { 0 }
{
- \str_if_eq:VnT \l_siunitx_per_mode_tl { symbol }
+ \str_if_eq:VnT \l_@@_per_mode_tl { symbol }
{
- \int_compare:nNnT { \l_siunitx_unit_numerator_int } = { 0 }
- { \siunitx_print:nn { unit } { 1 } }
+ \int_compare:nNnT { \l_@@_unit_numerator_int } = { 0 }
+ { \@@_print:nn { unit } { 1 } }
}
}
{
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
{
- \int_use:N \l_siunitx_unit_prefix_base_int
+ \int_use:N \l_@@_unit_prefix_base_int
\exp_not:N \PrintSuperscript
- { \int_use:N \l_siunitx_unit_prefix_int }
+ { \int_use:N \l_@@_unit_prefix_int }
}
- \siunitx_print:nV { number } \l_siunitx_tmpa_tl
- \siunitx_unit_output_number_sep:
+ \@@_print:nV { number } \l_@@_tmpa_tl
+ \@@_unit_output_number_sep:
}
- \siunitx_print:nV { unit } \l_siunitx_unit_tl
+ \@@_print:nV { unit } \l_@@_unit_tl
}
-\cs_generate_variant:Nn \siunitx_unit_output:nn { V }
+\cs_generate_variant:Nn \@@_unit_output:nn { V }
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_output_number_sep:}
-%\begin{macro}{\siunitx_unit_output_number_sep_aux:}
+%\begin{macro}{\@@_unit_output_number_sep:}
+%\begin{macro}{\@@_unit_output_number_sep_aux:}
% For printing the number separator. The \cs{tex_mathchoice:D} code
% deals with the \opt{symbol-or-fraction} setting for \opt{per-mode},
% as in that case omission of the space between a number and unit
% depends on the current math style.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_output_number_sep: {
- \bool_if:NTF \l_siunitx_number_unit_breaks_bool
+\cs_new_protected:Npn \@@_unit_output_number_sep: {
+ \bool_if:NTF \l_@@_number_unit_breaks_bool
{ \penalty \binoppenalty } { \nobreak }
- \bool_if:NTF \l_siunitx_per_auto_bool
+ \bool_if:NTF \l_@@_per_auto_bool
{
\mode_if_math:TF
{
\tex_mathchoice:D
- { \l_siunitx_number_unit_product_tl }
- { \siunitx_unit_output_number_sep_aux: }
- { \siunitx_unit_output_number_sep_aux: }
- { \siunitx_unit_output_number_sep_aux: }
+ { \l_@@_number_unit_product_tl }
+ { \@@_unit_output_number_sep_aux: }
+ { \@@_unit_output_number_sep_aux: }
+ { \@@_unit_output_number_sep_aux: }
}
- { \siunitx_unit_output_number_sep_aux: }
+ { \@@_unit_output_number_sep_aux: }
}
- { \siunitx_unit_output_number_sep_aux: }
+ { \@@_unit_output_number_sep_aux: }
}
-\cs_new_protected:Npn \siunitx_unit_output_number_sep_aux: {
- \bool_if:NF \l_siunitx_omit_unit_space_bool
- { \l_siunitx_number_unit_product_tl }
+\cs_new_protected:Npn \@@_unit_output_number_sep_aux: {
+ \bool_if:NF \l_@@_omit_unit_space_bool
+ { \l_@@_number_unit_product_tl }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_unit_output_pre_print:}
-%\begin{macro}{\siunitx_unit_output_print:}
+%\begin{macro}{\@@_unit_output_pre_print:}
+%\begin{macro}{\@@_unit_output_print:}
% The printing functions for units do some simple tests then
% actually print there output.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_unit_output_pre_print: {
- \tl_if_empty:NF \l_siunitx_pre_unit_tl
+\cs_new_protected:Npn \@@_unit_output_pre_print: {
+ \tl_if_empty:NF \l_@@_pre_unit_tl
{
\nobreak
- \siunitx_print:nV { unit } \l_siunitx_pre_unit_tl
+ \@@_print:nV { unit } \l_@@_pre_unit_tl
}
}
-\cs_new_protected:Npn \siunitx_unit_output_print: {
- \int_compare:nNnF { \l_siunitx_unit_prefix_int } = { 0 }
+\cs_new_protected:Npn \@@_unit_output_print: {
+ \int_compare:nNnF { \l_@@_unit_prefix_int } = { 0 }
{
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set:Nx \l_@@_tmpa_tl
{
- \bool_if:NTF \l_siunitx_tight_bool
+ \bool_if:NTF \l_@@_tight_bool
{
\exp_not:N \ensuremath
- { { \exp_not:V \l_siunitx_exponent_product_tl } }
+ { { \exp_not:V \l_@@_exponent_product_tl } }
}
{
\exp_not:N \ensuremath
- { { } \exp_not:V \l_siunitx_exponent_product_tl { } }
+ { { } \exp_not:V \l_@@_exponent_product_tl { } }
}
- \int_use:N \l_siunitx_unit_prefix_base_int
- ^ { \int_use:N \l_siunitx_unit_prefix_int }
+ \int_use:N \l_@@_unit_prefix_base_int
+ ^ { \int_use:N \l_@@_unit_prefix_int }
}
- \siunitx_print:nV { number } \l_siunitx_tmpa_tl
+ \@@_print:nV { number } \l_@@_tmpa_tl
}
- \tl_if_empty:NF \l_siunitx_unit_tl
+ \tl_if_empty:NF \l_@@_unit_tl
{
- \siunitx_unit_output_number_sep:
- \siunitx_print:nV { unit } \l_siunitx_unit_tl
+ \@@_unit_output_number_sep:
+ \@@_print:nV { unit } \l_@@_unit_tl
}
}
% \end{macrocode}
@@ -12747,116 +12753,116 @@ This work consists of the file siunitx.dtx
% Numbers with units have to be formatted in a more complex way than
% simply sticking the two together.
%
-%\begin{macro}{\l_siunitx_preunit_tl}
+%\begin{macro}{\l_@@_preunit_tl}
% A pre-unit is optional, so can be handled using the setting system.
% \begin{macrocode}
\keys_define:nn { siunitx } {
- preunit .tl_set:N = \l_siunitx_preunit_tl ,
+ preunit .tl_set:N = \l_@@_preunit_tl ,
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_pre_unit_tl}
+%\begin{macro}{\l_@@_pre_unit_tl}
% When there is a pre-unit, it gets stored here.
% \begin{macrocode}
-\tl_new:N \l_siunitx_pre_unit_tl
+\tl_new:N \l_@@_pre_unit_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_product_int}
+%\begin{macro}{\l_@@_number_product_int}
% Used to count up the number of product tokens in a number.
% \begin{macrocode}
-\int_new:N \l_siunitx_number_product_int
+\int_new:N \l_@@_number_product_int
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_combined:nnnn}
+%\begin{macro}{\@@_combined:nnnn}
% Printing numbers and units means first processing the units, then
% handing off this information to the combined number and unit
% processor.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_combined:nnnn #1#2#3#4 {
+\cs_new_protected:Npn \@@_combined:nnnn #1#2#3#4 {
\IfNoValueTF {#3}
- { \tl_clear:N \l_siunitx_pre_unit_tl }
+ { \tl_clear:N \l_@@_pre_unit_tl }
{
\group_begin:
- \siunitx_unit_in:nn {#3} {#1}
- \cs_set_eq:NN \l_siunitx_pre_unit_tl \l_siunitx_unit_tl
+ \@@_unit_in:nn {#3} {#1}
+ \cs_set_eq:NN \l_@@_pre_unit_tl \l_@@_unit_tl
\exp_args:NNNo \group_end:
- \tl_set:Nn \l_siunitx_pre_unit_tl { \l_siunitx_unit_tl }
+ \tl_set:Nn \l_@@_pre_unit_tl { \l_@@_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_eq:NN \l_@@_brackets_bool
+ \l_@@_multi_brackets_bool
+ \@@_combined_unit:nnn {#2} {#4} {#1}
+ \@@_combined_output:n {#2}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_combined_output:n}
+%\begin{macro}{\@@_combined_output:n}
% Printing the combination of a number and a unit means checking for
% parsing then parsing the number part.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_combined_output:n #1 {
- \bool_if:NTF \l_siunitx_number_parse_bool
+\cs_new_protected:Npn \@@_combined_output:n #1 {
+ \bool_if:NTF \l_@@_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}
+ \tl_clear:N \l_@@_number_out_tl
+ \bool_set_false:N \l_@@_number_compound_bool
+ \@@_number_output_parse:n {#1}
}
{
- \siunitx_unit_output_pre_print:
- \siunitx_print:nn { number } { \ensuremath {#1} }
- \siunitx_unit_output_print:
+ \@@_unit_output_pre_print:
+ \@@_print:nn { number } { \ensuremath {#1} }
+ \@@_unit_output_print:
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_combined_unit:nnn}
+%\begin{macro}{\@@_combined_unit:nnn}
% In most cases, sorting out the main unit is easy: simply set up for
-% printing using \cs{siunitx_unit_in:nn}. However, if there are multiple
+% printing using \cs{@@_unit_in:nn}. However, if there are multiple
% parts to the number, and they are to be combined into the unit, then
% there is more work to do. In either case, the result is the
-% correctly-prepared unit stored in \cs{l_siunitx_unit_tl}.
+% correctly-prepared unit stored in \cs{l_@@_unit_tl}.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_combined_unit:nnn #1#2#3 {
- \bool_if:NTF \l_siunitx_product_power_bool
+\cs_new_protected:Npn \@@_combined_unit:nnn #1#2#3 {
+ \bool_if:NTF \l_@@_product_power_bool
{
- \siunitx_combined_product_count:n {#1}
- \int_compare:nNnTF { \l_siunitx_number_product_int } > { 0 }
+ \@@_combined_product_count:n {#1}
+ \int_compare:nNnTF { \l_@@_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}
+ \int_incr:N \l_@@_number_product_int
+ \tl_set:Nn \l_@@_tmpa_tl {#2}
+ \tl_set:Nx \l_@@_tmpb_tl
+ { \tothe { \exp_not:V \l_@@_number_product_int } }
+ \tl_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \@@_unit_in:Vn \l_@@_tmpa_tl {#3}
}
- { \siunitx_unit_in:nn {#2} {#3} }
+ { \@@_unit_in:nn {#2} {#3} }
}
- { \siunitx_unit_in:nn {#2} {#3} }
+ { \@@_unit_in:nn {#2} {#3} }
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_combined_product_count:n}
-%\begin{macro}[aux]{\siunitx_combined_product_count_aux:n}
+%\begin{macro}{\@@_combined_product_count:n}
+%\begin{macro}[aux]{\@@_combined_product_count_aux:n}
% For counting how many products are in a number, so that the unit
% can be adjusted if needed.
% \begin{macrocode}
-\cs_new_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_new_protected:Npn \@@_combined_product_count:n #1 {
+ \int_zero:N \l_@@_number_product_int
+ \tl_set:Nn \l_@@_tmpa_tl {#1}
+ \tl_map_function:NN \l_@@_input_product_tl
+ \@@_combined_product_count_aux:N
}
-\cs_new_protected:Npn \siunitx_combined_product_count_aux:N #1 {
- \tl_if_in:NnT \l_siunitx_tmpa_tl {#1}
+\cs_new_protected:Npn \@@_combined_product_count_aux:N #1 {
+ \tl_if_in:NnT \l_@@_tmpa_tl {#1}
{
- \int_incr:N \l_siunitx_number_product_int
- \tl_remove_once:Nn \l_siunitx_tmpa_tl {#1}
- \siunitx_combined_product_count_aux:N #1
+ \int_incr:N \l_@@_number_product_int
+ \tl_remove_once:Nn \l_@@_tmpa_tl {#1}
+ \@@_combined_product_count_aux:N #1
}
}
% \end{macrocode}
@@ -12865,57 +12871,57 @@ This work consists of the file siunitx.dtx
%
%\subsection{Lists of numbers}
%
-%\begin{macro}{\l_siunitx_list_brackets_bool}
-%\begin{macro}{\l_siunitx_list_repeat_bool}
+%\begin{macro}{\l_@@_list_brackets_bool}
+%\begin{macro}{\l_@@_list_repeat_bool}
% For storing the behaviour of list items with respect to units.
% \begin{macrocode}
-\bool_new:N \l_siunitx_list_brackets_bool
-\bool_new:N \l_siunitx_list_repeat_bool
+\bool_new:N \l_@@_list_brackets_bool
+\bool_new:N \l_@@_list_repeat_bool
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_list_current_tl}
-%\begin{macro}{\l_siunitx_list_tl}
+%\begin{macro}{\l_@@_list_current_tl}
+%\begin{macro}{\l_@@_list_tl}
% Two token list variables used to store the list for output.
% \begin{macrocode}
-\tl_new:N \l_siunitx_list_current_tl
-\tl_new:N \l_siunitx_list_tl
+\tl_new:N \l_@@_list_current_tl
+\tl_new:N \l_@@_list_tl
% \end{macrocode}
%\end{macro}
%\end{macro}
%
% \begin{variable}
% {
-% \l_siunitx_list_separator_pair_tl ,
-% \l_siunitx_list_separator_final_tl ,
-% \l_siunitx_list_separator_tl,
+% \l_@@_list_separator_pair_tl ,
+% \l_@@_list_separator_final_tl ,
+% \l_@@_list_separator_tl,
% }
% Settings for lists.
% \begin{macrocode}
\keys_define:nn { siunitx }
{
- list-final-separator .tl_set:N = \l_siunitx_list_separator_final_tl ,
- list-pair-separator .tl_set:N = \l_siunitx_list_separator_pair_tl ,
- list-separator .tl_set:N = \l_siunitx_list_separator_tl ,
+ list-final-separator .tl_set:N = \l_@@_list_separator_final_tl ,
+ list-pair-separator .tl_set:N = \l_@@_list_separator_pair_tl ,
+ list-separator .tl_set:N = \l_@@_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
+ \bool_set_true:N \l_@@_list_brackets_bool
+ \bool_set_false:N \l_@@_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
+ \bool_set_false:N \l_@@_list_brackets_bool
+ \bool_set_true:N \l_@@_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
+ \bool_set_false:N \l_@@_list_brackets_bool
+ \bool_set_false:N \l_@@_list_repeat_bool
}
}
\keys_set:nn { siunitx }
@@ -12928,84 +12934,84 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\siunitx_list_numbers:n}
+% \begin{macro}{\@@_list_numbers:n}
% \begin{macro}[aux]
-% {\siunitx_list_numbers_aux_i:n, \siunitx_list_numbers_aux_ii:n}
-% \begin{macro}{\siunitx_list_numbers_aux:nn}
+% {\@@_list_numbers_aux_i:n, \@@_list_numbers_aux_ii:n}
+% \begin{macro}{\@@_list_numbers_aux:nn}
% Setting up lists is made slightly complicated by the need to handle the
% case of exactly two items and the case of the very last separator
% differently from everything else. Beyond that, there is not too much
% to any of this code.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_list_numbers:n #1
+\cs_new_protected:Npn \@@_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}
+ \tl_clear:N \l_@@_unit_tl
+ \tl_clear:N \l_@@_preunit_tl
+ \@@_list_numbers_aux_i:n {#1}
}
-\cs_new_protected:Npn \siunitx_list_numbers_aux_i:n #1
+\cs_new_protected:Npn \@@_list_numbers_aux_i:n #1
{
- \bool_set_true:N \l_siunitx_list_first_bool
- \tl_clear:N \l_siunitx_list_current_tl
+ \bool_set_true:N \l_@@_list_first_bool
+ \tl_clear:N \l_@@_list_current_tl
\int_compare:nNnTF { \tl_length:n {#1} } > \c_two
{
- \tl_map_function:nN {#1} \siunitx_list_numbers_aux_ii:n
- \l_siunitx_list_tl
- \l_siunitx_list_separator_final_tl
- \l_siunitx_list_current_tl
+ \tl_map_function:nN {#1} \@@_list_numbers_aux_ii:n
+ \l_@@_list_tl
+ \l_@@_list_separator_final_tl
+ \l_@@_list_current_tl
}
{
\int_compare:nNnTF { \tl_length:n {#1} } = \c_two
- { \siunitx_list_numbers_aux:nn #1 }
- { \siunitx_combined_output:n #1 }
+ { \@@_list_numbers_aux:nn #1 }
+ { \@@_combined_output:n #1 }
}
}
-\cs_new_protected:Npn \siunitx_list_numbers_aux_ii:n #1
+\cs_new_protected:Npn \@@_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_if_empty:NTF \l_@@_list_tl
+ { \tl_set_eq:NN \l_@@_list_tl \l_@@_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_put_right:NV \l_@@_list_tl \l_@@_list_separator_tl
+ \tl_put_right:NV \l_@@_list_tl \l_@@_list_current_tl
}
- \tl_set:Nn \l_siunitx_list_current_tl { \siunitx_combined_output:n {#1} }
+ \tl_set:Nn \l_@@_list_current_tl { \@@_combined_output:n {#1} }
}
-\cs_new_protected:Npn \siunitx_list_numbers_aux:nn #1#2
+\cs_new_protected:Npn \@@_list_numbers_aux:nn #1#2
{
- \siunitx_combined_output:n {#1}
- \l_siunitx_list_separator_pair_tl
- \siunitx_combined_output:n {#2}
+ \@@_combined_output:n {#1}
+ \l_@@_list_separator_pair_tl
+ \@@_combined_output:n {#2}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\siunitx_list_units:nnn}
+% \begin{macro}{\@@_list_units:nnn}
% For a list of items with units, the method is to first parse the
% unit when repeating (to save time), then to use the number loop above
% for the actual work. On the other hand, when the unit is only printed
% once life is easier as the normal unit printer can operate.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_list_units:nnn #1#2#3
+\cs_new_protected:Npn \@@_list_units:nnn #1#2#3
{
- \siunitx_unit_parse_options:nn {#2} {#3}
- \bool_if:NTF \l_siunitx_list_repeat_bool
+ \@@_unit_parse_options:nn {#2} {#3}
+ \bool_if:NTF \l_@@_list_repeat_bool
{
- \siunitx_unit_in:nn {#2} {#3}
- \siunitx_list_numbers_aux_i:n {#1}
+ \@@_unit_in:nn {#2} {#3}
+ \@@_list_numbers_aux_i:n {#1}
}
{
- \bool_if:NT \l_siunitx_process_fixed_bool
- { \bool_set_true:N \l_siunitx_process_drop_exponent_bool }
- \bool_if:NT \l_siunitx_list_brackets_bool
- { \siunitx_print:nV { number } \l_siunitx_bracket_open_tl }
- \siunitx_list_numbers:n {#1}
- \bool_if:NT \l_siunitx_list_brackets_bool
- { \siunitx_print:nV { number } \l_siunitx_bracket_close_tl }
- \siunitx_range_exponent:
- \siunitx_unit_output_number_sep:
- \siunitx_unit_output:nn {#2} {#3}
+ \bool_if:NT \l_@@_process_fixed_bool
+ { \bool_set_true:N \l_@@_process_drop_exponent_bool }
+ \bool_if:NT \l_@@_list_brackets_bool
+ { \@@_print:nV { number } \l_@@_bracket_open_tl }
+ \@@_list_numbers:n {#1}
+ \bool_if:NT \l_@@_list_brackets_bool
+ { \@@_print:nV { number } \l_@@_bracket_close_tl }
+ \@@_range_exponent:
+ \@@_unit_output_number_sep:
+ \@@_unit_output:nn {#2} {#3}
}
}
% \end{macrocode}
@@ -13013,39 +13019,39 @@ This work consists of the file siunitx.dtx
%
%\subsection{Ranges}
%
-%\begin{macro}{\l_siunitx_range_brackets_bool}
-%\begin{macro}{\l_siunitx_range_repeat_bool}
+%\begin{macro}{\l_@@_range_brackets_bool}
+%\begin{macro}{\l_@@_range_repeat_bool}
% Settings for ranges with units.
% \begin{macrocode}
-\bool_new:N \l_siunitx_range_brackets_bool
-\bool_new:N \l_siunitx_range_repeat_bool
+\bool_new:N \l_@@_range_brackets_bool
+\bool_new:N \l_@@_range_repeat_bool
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_range_phrase_tl}
+%\begin{macro}{\l_@@_range_phrase_tl}
% Simple settings for ranges.
% \begin{macrocode}
\keys_define:nn { siunitx } {
- range-phrase .tl_set:N = \l_siunitx_range_phrase_tl,
+ range-phrase .tl_set:N = \l_@@_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
+ \bool_set_true:N \l_@@_range_brackets_bool
+ \bool_set_false:N \l_@@_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
+ \bool_set_false:N \l_@@_range_brackets_bool
+ \bool_set_true:N \l_@@_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
+ \bool_set_false:N \l_@@_range_brackets_bool
+ \bool_set_false:N \l_@@_range_repeat_bool
},
}
\keys_set:nn { siunitx } {
@@ -13055,33 +13061,33 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%\end{macro}
%
-% \begin{macro}{\siunitx_range_numbers:nn}
-% \begin{macro}[aux]{\siunitx_range_numbers_core:nn}
-% \begin{macro}[aux]{\siunitx_range_numbers_aux:n}
+% \begin{macro}{\@@_range_numbers:nn}
+% \begin{macro}[aux]{\@@_range_numbers_core:nn}
+% \begin{macro}[aux]{\@@_range_numbers_aux:n}
% A range of numbers. This is more restrictive than the \cs{num}
% function: nothing compound.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_range_numbers:nn #1#2
+\cs_new_protected:Npn \@@_range_numbers:nn #1#2
{
- \siunitx_range_numbers_aux:n {#1}
- \l_siunitx_range_phrase_tl
- \siunitx_range_numbers_aux:n {#2}
+ \@@_range_numbers_aux:n {#1}
+ \l_@@_range_phrase_tl
+ \@@_range_numbers_aux:n {#2}
}
-\cs_new_protected:Npn \siunitx_range_numbers_aux:n #1
+\cs_new_protected:Npn \@@_range_numbers_aux:n #1
{
- \bool_if:NTF \l_siunitx_number_parse_bool
+ \bool_if:NTF \l_@@_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
+ \tl_clear:N \l_@@_number_out_tl
+ \tl_clear:N \l_@@_number_out_saved_tl
+ \bool_set_false:N \l_@@_number_compound_bool
+ \@@_number_output_parse:n {#1}
+ \bool_if:NT \l_@@_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:
+ \@@_unit_output_pre_print:
+ \@@_print:nn { number } {#1}
+ \@@_unit_output_print:
}
}
% \end{macrocode}
@@ -13089,53 +13095,53 @@ This work consists of the file siunitx.dtx
% \end{macro}
% \end{macro}
%
-%\begin{macro}{\siunitx_range_unit:nnnn}
+%\begin{macro}{\@@_range_unit:nnnn}
% Unit printing is also simple: basically a past-up job. The only compl
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_range_unit:nnnn #1#2#3#4 {
- \siunitx_unit_parse_options:nn {#1} {#2}
- \bool_if:NTF \l_siunitx_range_repeat_bool
+\cs_new_protected:Npn \@@_range_unit:nnnn #1#2#3#4 {
+ \@@_unit_parse_options:nn {#1} {#2}
+ \bool_if:NTF \l_@@_range_repeat_bool
{
- \siunitx_unit_in:nn {#1} {#2}
- \siunitx_range_numbers_aux:n {#3}
- \l_siunitx_range_phrase_tl
- \siunitx_range_numbers_aux:n {#4}
+ \@@_unit_in:nn {#1} {#2}
+ \@@_range_numbers_aux:n {#3}
+ \l_@@_range_phrase_tl
+ \@@_range_numbers_aux:n {#4}
}
{
- \bool_if:NT \l_siunitx_process_fixed_bool
- { \bool_set_true:N \l_siunitx_process_drop_exponent_bool }
- \bool_if:NT \l_siunitx_range_brackets_bool
- { \siunitx_print:nV { number } \l_siunitx_bracket_open_tl }
- \siunitx_range_numbers:nn {#3} {#4}
- \bool_if:NT \l_siunitx_range_brackets_bool
- { \siunitx_print:nV { number } \l_siunitx_bracket_close_tl }
- \siunitx_range_exponent:
- \siunitx_unit_output_number_sep:
- \siunitx_unit_output:nn {#1} {#2}
+ \bool_if:NT \l_@@_process_fixed_bool
+ { \bool_set_true:N \l_@@_process_drop_exponent_bool }
+ \bool_if:NT \l_@@_range_brackets_bool
+ { \@@_print:nV { number } \l_@@_bracket_open_tl }
+ \@@_range_numbers:nn {#3} {#4}
+ \bool_if:NT \l_@@_range_brackets_bool
+ { \@@_print:nV { number } \l_@@_bracket_close_tl }
+ \@@_range_exponent:
+ \@@_unit_output_number_sep:
+ \@@_unit_output:nn {#1} {#2}
}
}
% \end{macrocode}
%\end{macro}
%
-% \begin{macro}{\siunitx_range_exponent:}
+% \begin{macro}{\@@_range_exponent:}
% The idea here is to construct and print an exponent if this is fixed,
% and thus removed from the range. This function is also used by the
% related list concept.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_range_exponent:
+\cs_new_protected:Npn \@@_range_exponent:
{
- \bool_if:NT \l_siunitx_process_fixed_bool
+ \bool_if:NT \l_@@_process_fixed_bool
{
- \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:o \l_siunitx_tmpa_tl } } }
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set_eq:NN \l_@@_tmpa_tl \l_@@_exponent_product_tl
+ \bool_if:NT \l_@@_tight_bool
+ { \tl_set:Nx \l_@@_tmpa_tl { { \exp_not:o \l_@@_tmpa_tl } } }
+ \tl_set:Nx \l_@@_tmpa_tl
{
- \exp_not:N \ensuremath { { } \exp_not:o \l_siunitx_tmpa_tl { } }
+ \exp_not:N \ensuremath { { } \exp_not:o \l_@@_tmpa_tl { } }
10 \exp_not:N \PrintSuperscript
- { \int_use:N \l_siunitx_process_fixed_int }
+ { \int_use:N \l_@@_process_fixed_int }
}
- \siunitx_print:nV { number } \l_siunitx_tmpa_tl
+ \@@_print:nV { number } \l_@@_tmpa_tl
}
}
% \end{macrocode}
@@ -13155,17 +13161,17 @@ This work consists of the file siunitx.dtx
{
\newcolumntype { C } [1]
{ > { \bcolumn #1 \@nil } #1 < { \ecolumn } }
- \cs_set:Npn \siunitx_tmp:w #1 \NC@do S #2 \q_stop
+ \cs_set:Npn \@@_tmp:w #1 \NC@do S #2 \q_stop
{ \NC@list { #1 #2 } }
- \exp_after:wN \siunitx_tmp:w \tex_the:D \NC@list \q_stop
+ \exp_after:wN \@@_tmp:w \tex_the:D \NC@list \q_stop
\cs_undefine:N \NC@find@S
}
{ }
}
% \end{macrocode}
%
-%\begin{macro}{\siunitx_table_rewrite_create:N}
-%\begin{macro}[aux]{\siunitx_table_rewrite_create_aux:w}
+%\begin{macro}{\@@_table_rewrite_create:N}
+%\begin{macro}[aux]{\@@_table_rewrite_create_aux:w}
% The \texttt{s} and \texttt{S} column types are both created using
% the \pkg{array} package, but with the internal macros redefined
% to work with optional argument. First, there is a need to do a
@@ -13174,27 +13180,27 @@ This work consists of the file siunitx.dtx
% arguments do not work correctly. So they are added \enquote{by hand}
% to the appropriate macro.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_rewrite_create:N #1 {
+\cs_new_protected:Npn \@@_table_rewrite_create:N #1 {
\newcolumntype {#1} { }
\cs_set_protected:Npn
- \siunitx_table_rewrite_create_aux:w \NC@do ##1##2 \NC@do #1
+ \@@_table_rewrite_create_aux:w \NC@do ##1##2 \NC@do #1
{ \NC@list { \NC@do ##1 \NC@do #1 ##2 } }
- \exp_after:wN \siunitx_table_rewrite_create_aux:w \tex_the:D \NC@list
+ \exp_after:wN \@@_table_rewrite_create_aux:w \tex_the:D \NC@list
\exp_args:NNc \renewcommand * { NC@rewrite@ #1 } [1] [ ]
{
\@temptokena \exp_after:wN
{
\tex_the:D \@temptokena
- > { \siunitx_table_collect_begin:Nn #1 {##1} }
+ > { \@@_table_collect_begin:Nn #1 {##1} }
c
- < { \siunitx_table_print: }
+ < { \@@_table_print: }
}
\NC@find
}
}
-\cs_new_protected:Npn \siunitx_table_rewrite_create_aux:w { }
-\AtBeginDocument { \siunitx_table_rewrite_create:N s }
-\AtBeginDocument { \siunitx_table_rewrite_create:N S }
+\cs_new_protected:Npn \@@_table_rewrite_create_aux:w { }
+\AtBeginDocument { \@@_table_rewrite_create:N s }
+\AtBeginDocument { \@@_table_rewrite_create:N S }
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -13205,128 +13211,128 @@ This work consists of the file siunitx.dtx
% the result. The collection routine tries to ensure that the
% typesetting part only receives real cell contents.
%
-%\begin{macro}{\l_siunitx_table_collect_tl}
-%\begin{macro}{\l_siunitx_table_collect_pre_tl}
-%\begin{macro}{\l_siunitx_table_collect_post_tl}
+%\begin{macro}{\l_@@_table_collect_tl}
+%\begin{macro}{\l_@@_table_collect_pre_tl}
+%\begin{macro}{\l_@@_table_collect_post_tl}
% Three storage areas.
% \begin{macrocode}
-\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_@@_table_collect_tl
+\tl_new:N \l_@@_table_collect_pre_tl
+\tl_new:N \l_@@_table_collect_post_tl
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_number_valid_tl}
+%\begin{macro}{\l_@@_number_valid_tl}
% As the \texttt{S} column has to make a judgement about tokens which
% can be part of a number, there is a need to have a list of valid
% tokens.
% \begin{macrocode}
-\tl_new:N \l_siunitx_number_valid_tl
+\tl_new:N \l_@@_number_valid_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_table_math_bool}
+%\begin{macro}{\l_@@_table_math_bool}
% A flag used inside the table cell to track math mode: there is
% a need to do things by hand as otherwise the grouping goes
% wrong.
% \begin{macrocode}
-\bool_new:N \l_siunitx_table_math_bool
+\bool_new:N \l_@@_table_math_bool
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_siunitx_table_collect_pre_bool}
-%\begin{macro}{\l_siunitx_table_collect_post_bool}
+%\begin{macro}{\l_@@_table_collect_pre_bool}
+%\begin{macro}{\l_@@_table_collect_post_bool}
% Flags for having found a number in an \texttt{S} column.
% \begin{macrocode}
-\bool_new:N \l_siunitx_table_collect_pre_bool
-\bool_new:N \l_siunitx_table_collect_post_bool
+\bool_new:N \l_@@_table_collect_pre_bool
+\bool_new:N \l_@@_table_collect_post_bool
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_begin:Nn}
-%\begin{macro}[aux]{\siunitx_table_collect_begin_s:}
-%\begin{macro}[aux]{\siunitx_table_collect_begin_S:}
+%\begin{macro}{\@@_table_collect_begin:Nn}
+%\begin{macro}[aux]{\@@_table_collect_begin_s:}
+%\begin{macro}[aux]{\@@_table_collect_begin_S:}
% The collector starts by setting up local options, then clears and
% initialises the storage and testing system. Font detection for the
% \texttt{S} column happens here as this ensures that it is not inside
% a box, which will give the wrong result for \opt{detect-mode}.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_begin:Nn #1#2 {
+\cs_new_protected:Npn \@@_table_collect_begin:Nn #1#2 {
\keys_set:nn { siunitx } {#2}
- \use:c { siunitx_table_collect_begin_ #1 : }
+ \use:c { @@_table_collect_begin_ #1 : }
}
-\cs_new_protected: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_new_protected:Npn \@@_table_collect_begin_s: {
+ \cs_set_eq:NN \@@_table_collect_token:N
+ \@@_table_collect_token_s:N
+ \cs_set_eq:NN \@@_table_print: \@@_table_print_s:
+ \@@_table_collect_init_s:
+ \@@_table_collect_get:
}
-\cs_new_protected: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_detect_font:
- \bool_if:NTF \l_siunitx_number_parse_bool
- { \siunitx_table_collect_get: }
- { \siunitx_table_print_S_direct:N }
+\cs_new_protected:Npn \@@_table_collect_begin_S: {
+ \cs_set_eq:NN \@@_table_collect_token:N
+ \@@_table_collect_token_S:N
+ \cs_set_eq:NN \@@_table_print: \@@_table_print_S:
+ \@@_table_collect_init_S:
+ \@@_detect_font:
+ \bool_if:NTF \l_@@_number_parse_bool
+ { \@@_table_collect_get: }
+ { \@@_table_print_S_direct:N }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_braced:n}
+%\begin{macro}{\@@_table_collect_braced:n}
% The collection of braced items depends on the column type. So we
% start of with an empty definition.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_braced:n #1 { }
+\cs_new_protected:Npn \@@_table_collect_braced:n #1 { }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_expand:N}
-%\begin{macro}[aux]{\siunitx_table_collect_expand_math:N}
+%\begin{macro}{\@@_table_collect_expand:N}
+%\begin{macro}[aux]{\@@_table_collect_expand_math:N}
% The idea here is to expand content if possible. There are a few
% things to note. Only macros which are not long or protected are
% expanded. There is the possibility that the macro may need the
% contents of the pre-numeral part to be executed, for example see
% \cref{tab:xmpl:calc} in the user part of the documentation.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_expand:N #1 {
+\cs_new_protected:Npn \@@_table_collect_expand:N #1 {
\cs_if_eq:NNTF #1 \color
{
- \bool_if:NTF \l_siunitx_table_collect_pre_bool
+ \bool_if:NTF \l_@@_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}
+ \tl_clear:N \l_@@_number_color_tl
+ \tl_clear:N \l_@@_unit_color_tl
+ \tl_put_right:Nn \l_@@_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}
+ \bool_set_true:N \l_@@_table_collect_post_bool
+ \tl_put_right:Nn \l_@@_table_collect_post_tl {#1}
}
}
{
- \siunitx_cs_if_tl:NTF #1
+ \@@_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:Npn \siunitx_table_collect_next:
- { \exp_after:wN \siunitx_table_collect_get: #1 }
+ \tl_use:N \l_@@_table_collect_pre_tl
+ \tl_clear:N \l_@@_table_collect_pre_tl
+ \cs_set:Npn \@@_table_collect_next:
+ { \exp_after:wN \@@_table_collect_get: #1 }
}
{
- \bool_if:NTF \l_siunitx_table_collect_pre_bool
+ \bool_if:NTF \l_@@_table_collect_pre_bool
{
- \tl_put_right:Nn \l_siunitx_table_collect_pre_tl {#1}
- \siunitx_table_collect_expand_math:N #1
+ \tl_put_right:Nn \l_@@_table_collect_pre_tl {#1}
+ \@@_table_collect_expand_math:N #1
}
{
- \bool_set_true:N \l_siunitx_table_collect_post_bool
- \tl_put_right:Nn \l_siunitx_table_collect_post_tl {#1}
+ \bool_set_true:N \l_@@_table_collect_post_bool
+ \tl_put_right:Nn \l_@@_table_collect_post_tl {#1}
}
}
}
@@ -13337,19 +13343,19 @@ This work consists of the file siunitx.dtx
% the math state of the collected tokens so that appropriate
% steps can be taken to insert math shift tokens later.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_expand_math:N #1 {
+\cs_new_protected:Npn \@@_table_collect_expand_math:N #1 {
\token_if_math_toggle:NTF #1
{
- \bool_if:NTF \l_siunitx_table_math_bool
- { \bool_set_false:N \l_siunitx_table_math_bool }
- { \bool_set_true:N \l_siunitx_table_math_bool }
+ \bool_if:NTF \l_@@_table_math_bool
+ { \bool_set_false:N \l_@@_table_math_bool }
+ { \bool_set_true:N \l_@@_table_math_bool }
}
{
\cs_if_eq:NNTF #1 \( % \)
- { \bool_set_true:N \l_siunitx_table_math_bool }
+ { \bool_set_true:N \l_@@_table_math_bool }
{ % \(
\cs_if_eq:NNT #1 \)
- { \bool_set_false:N \l_siunitx_table_math_bool }
+ { \bool_set_false:N \l_@@_table_math_bool }
}
}
}
@@ -13357,8 +13363,8 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_get:}
-%\begin{macro}{\siunitx_table_collect_get_aux:}
+%\begin{macro}{\@@_table_collect_get:}
+%\begin{macro}{\@@_table_collect_get_aux:}
% The token collection system first has to check that the next argument
% does not start with an opening-brace character. If it does, the
% testing is skipped and the braced token is stored. Otherwise, a check
@@ -13366,190 +13372,190 @@ This work consists of the file siunitx.dtx
% broken with \pkg{expl3}'s \cs{peek_catcode_ignore_spaces:NTF}, so
% everything is done by hand.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_get: {
- \cs_set_eq:NN \siunitx_table_collect_next:
- \siunitx_table_collect_get:
- \cs_set:Npn \peek_execute_branches:
+\cs_new_protected:Npn \@@_table_collect_get: {
+ \cs_set_eq:NN \@@_table_collect_next:
+ \@@_table_collect_get:
+ \cs_set: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
+ \exp_after:wN \@@_table_collect_braced:n
\else:
- \exp_after:wN \siunitx_table_collect_not_braced:N
+ \exp_after:wN \@@_table_collect_not_braced:N
\fi:
}
- \peek_after:Nw \peek_ignore_spaces_execute_branches:
+ \peek_after:Nw \__peek_ignore_spaces_execute_branches:
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_init:}
+%\begin{macro}{\@@_table_collect_init:}
% The usual spin-out of basics.
% \begin{macrocode}
-\cs_new_protected: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
- \bool_set_false:N \l_siunitx_table_math_bool
+\cs_new_protected:Npn \@@_table_collect_init: {
+ \tl_clear:N \l_@@_table_collect_tl
+ \tl_clear:N \l_@@_table_collect_pre_tl
+ \tl_clear:N \l_@@_table_collect_post_tl
+ \bool_set_false:N \l_@@_table_collect_post_bool
+ \bool_set_false:N \l_@@_table_math_bool
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\siunitx_table_collect_init_s:}
-%\begin{macro}{\siunitx_table_collect_init_S:}
+%\begin{macro}{\@@_table_collect_init_s:}
+%\begin{macro}{\@@_table_collect_init_S:}
% Some type-specific definitions. In the \texttt{S} case, the
% initialisation function for numbers is used to set
-% \cs{l_siunitx_number_valid_tl} correctly.
+% \cs{l_@@_number_valid_tl} correctly.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_init_s: {
- \siunitx_table_collect_init:
- \bool_set_false:N \l_siunitx_table_collect_pre_bool
- \cs_set_protected:Npn \siunitx_table_collect_braced:n ##1
+\cs_new_protected:Npn \@@_table_collect_init_s: {
+ \@@_table_collect_init:
+ \bool_set_false:N \l_@@_table_collect_pre_bool
+ \cs_set_protected:Npn \@@_table_collect_braced:n ##1
{
- \tl_put_right:Nn \l_siunitx_table_collect_tl { {##1} }
- \siunitx_table_collect_next:
+ \tl_put_right:Nn \l_@@_table_collect_tl { {##1} }
+ \@@_table_collect_next:
}
}
-\cs_new_protected: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_comparator_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
+\cs_new_protected:Npn \@@_table_collect_init_S: {
+ \@@_number_in_init:
+ \tl_set:Nx \l_@@_number_valid_tl
+ {
+ \exp_not:V \l_@@_input_complex_tl
+ \exp_not:V \l_@@_input_decimal_tl
+ \exp_not:V \l_@@_input_digit_tl
+ \exp_not:V \l_@@_input_exponent_tl
+ \exp_not:V \l_@@_input_ignore_tl
+ \exp_not:V \l_@@_input_comparator_tl
+ \exp_not:V \l_@@_input_uncert_close_tl
+ \exp_not:V \l_@@_input_uncert_open_tl
+ \exp_not:V \l_@@_input_sign_tl
+ \exp_not:V \l_@@_input_symbol_tl
}
- \bool_set_true:N \l_siunitx_table_collect_pre_bool
- \cs_set_protected:Npn \siunitx_table_collect_braced:n ##1
+ \bool_set_true:N \l_@@_table_collect_pre_bool
+ \cs_set_protected:Npn \@@_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_if:NTF \l_@@_table_collect_pre_bool
+ { \tl_put_right:Nn \l_@@_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} }
+ \bool_set_true:N \l_@@_table_collect_post_bool
+ \tl_put_right:Nn \l_@@_table_collect_post_tl { {##1} }
}
- \siunitx_table_collect_next:
+ \@@_table_collect_next:
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_next:}
+%\begin{macro}{\@@_table_collect_next:}
% A holder for the next thing to do.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_next: { }
+\cs_new_protected:Npn \@@_table_collect_next: { }
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_newline:}
+%\begin{macro}{\@@_table_collect_newline:}
% The end macro needs to come before the new line is called. The
% print function is redefined so that it only actually does stuff once.
% As each cell is a group anyway, there is no need to save the
-% definition of \cs{siunitx_table_print:}, as it will re-appear on its
+% definition of \cs{@@_table_print:}, as it will re-appear on its
% own.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_newline: {
- \siunitx_table_print:
- \cs_set_eq:NN \siunitx_table_print: \prg_do_nothing:
+\cs_new_protected:Npn \@@_table_collect_newline: {
+ \@@_table_print:
+ \cs_set_eq:NN \@@_table_print: \prg_do_nothing:
\tabularnewline
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_end:}
+%\begin{macro}{\@@_table_collect_end:}
% The same concept applies to the \cs{end} macro.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_end: {
- \siunitx_table_print:
- \cs_set_eq:NN \siunitx_table_print: \prg_do_nothing:
+\cs_new_protected:Npn \@@_table_collect_end: {
+ \@@_table_print:
+ \cs_set_eq:NN \@@_table_print: \prg_do_nothing:
\end
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_not_braced:N}
-%\begin{macro}[aux]{\siunitx_table_collect_not_braced_aux_i:N}
-%\begin{macro}[aux]{\siunitx_table_collect_not_braced_aux_ii:N}
+%\begin{macro}{\@@_table_collect_not_braced:N}
+%\begin{macro}[aux]{\@@_table_collect_not_braced_aux_i:N}
+%\begin{macro}[aux]{\@@_table_collect_not_braced_aux_ii:N}
% A few macros are simply passed through to be executed; this is mainly
% so that the table actually works. The newline function needs its own
% function, which is picked up by hand.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_not_braced:N #1 {
+\cs_new_protected:Npn \@@_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 }
+ { \@@_table_collect_not_braced_aux_i:N #1 }
}
- \siunitx_table_collect_next:
+ \@@_table_collect_next:
}
-\cs_new_protected:Npn \siunitx_table_collect_not_braced_aux_i:N #1 {
- \cs_set:Npn \siunitx_table_collect_not_braced_aux_ii:N ##1
+\cs_new_protected:Npn \@@_table_collect_not_braced_aux_i:N #1 {
+ \cs_set:Npn \@@_table_collect_not_braced_aux_ii:N ##1
{
\token_if_eq_meaning:NNT #1 ##1
- { \cs_set_eq:NN \siunitx_table_collect_next: ##1 }
+ { \cs_set_eq:NN \@@_table_collect_next: ##1 }
}
\tl_map_function:nN
- { \cs:w \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:
+ { \cs:w \scan_stop: \@@_table_print: }
+ \@@_table_collect_not_braced_aux_ii:N
+ \token_if_eq_meaning:NNT \@@_table_collect_next:
+ \@@_table_collect_get:
{
\token_if_eq_meaning:NNTF #1 \tabularnewline
{
- \cs_set_eq:NN \siunitx_table_collect_next:
- \siunitx_table_collect_newline:
+ \cs_set_eq:NN \@@_table_collect_next:
+ \@@_table_collect_newline:
}
{
\token_if_eq_meaning:NNTF #1 \end
{
- \cs_set_eq:NN \siunitx_table_collect_next:
- \siunitx_table_collect_end:
+ \cs_set_eq:NN \@@_table_collect_next:
+ \@@_table_collect_end:
}
- { \siunitx_table_collect_token:N #1 }
+ { \@@_table_collect_token:N #1 }
}
}
}
-\cs_new_protected:Npn \siunitx_table_collect_not_braced_aux_ii:N #1 { }
+\cs_new_protected:Npn \@@_table_collect_not_braced_aux_ii:N #1 { }
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_table_collect_token:N}
-%\begin{macro}{\siunitx_table_collect_token_s:N}
+%\begin{macro}{\@@_table_collect_token:N}
+%\begin{macro}{\@@_table_collect_token_s:N}
% For the \texttt{s} column, every token is added to the same storage
% area, so life is simple.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_collect_token:N #1 { }
-\cs_new_protected:Npn \siunitx_table_collect_token_s:N #1 {
- \tl_put_right:Nn \l_siunitx_table_collect_tl {#1}
+\cs_new_protected:Npn \@@_table_collect_token:N #1 { }
+\cs_new_protected:Npn \@@_table_collect_token_s:N #1 {
+ \tl_put_right:Nn \l_@@_table_collect_tl {#1}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\begin{macro}{\siunitx_table_collect_token_S:N}
+%\begin{macro}{\@@_table_collect_token_S:N}
% Not so easy for the \texttt{S} column type. If the content is after
% a number, things are easy. On the other hand, if the token might be
% a number, then a check is made. It the token is still unmatched, then
% it is passed on to the expansion handler.
% \begin{macrocode}
-\cs_new_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} }
+\cs_new_protected:Npn \@@_table_collect_token_S:N #1 {
+ \bool_if:NTF \l_@@_table_collect_post_bool
+ { \tl_put_right:Nn \l_@@_table_collect_post_tl {#1} }
{
- \tl_if_in:NnTF \l_siunitx_number_valid_tl {#1}
+ \tl_if_in:NnTF \l_@@_number_valid_tl {#1}
{
- \bool_set_false:N \l_siunitx_table_collect_pre_bool
- \tl_put_right:Nn \l_siunitx_table_collect_tl {#1}
+ \bool_set_false:N \l_@@_table_collect_pre_bool
+ \tl_put_right:Nn \l_@@_table_collect_tl {#1}
}
- { \siunitx_table_collect_expand:N #1 }
+ { \@@_table_collect_expand:N #1 }
}
}
% \end{macrocode}
@@ -13577,15 +13583,15 @@ This work consists of the file siunitx.dtx
% which means there is \texttt{fill} stretch to worry about and
% the kern as well.
%
-% \begin{variable}{\c_siunitx_one_fill_skip}
+% \begin{variable}{\c_@@_one_fill_skip}
% A fixed skip of one \texttt{fill}.
% \begin{macrocode}
-\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_@@_one_fill_skip
+\skip_set:Nn \c_@@_one_fill_skip { \c_zero_skip plus 1 fill }
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\siunitx_table_colortbl_correction:}
+% \begin{macro}{\@@_table_colortbl_correction:}
% If the package \pkg{colortbl} is loaded, there is a need to allow
% that it changes how centring is carried out.
% \begin{macrocode}
@@ -13593,45 +13599,45 @@ This work consists of the file siunitx.dtx
{
\@ifpackageloaded { colortbl }
{
- \cs_new_protected:Npn \siunitx_table_colortbl_correction:
+ \cs_new_protected:Npn \@@_table_colortbl_correction:
{
\skip_horizontal:n { \c_zero_skip plus -0.5 fill }
\tex_kern:D \c_zero_skip
}
}
- { \cs_new_protected:Npn \siunitx_table_colortbl_correction: { } }
+ { \cs_new_protected:Npn \@@_table_colortbl_correction: { } }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_align_left:n}
-% \begin{macro}{\siunitx_table_align_right:n}
+% \begin{macro}{\@@_table_align_left:n}
+% \begin{macro}{\@@_table_align_right:n}
% These are simple shortcuts to keep life clearer in the rest of the
% code. The idea is that the kern acts as a \enquote{stop} for the
% horizontal skip. The correction for \pkg{colortbl} is separate as the
% spacing needs to be explicitly deleted.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_align_left:n #1
+\cs_new_protected:Npn \@@_table_align_left:n #1
{
- \siunitx_table_colortbl_correction:
+ \@@_table_colortbl_correction:
\skip_horizontal:n {#1}
\tex_kern:D \c_zero_skip
}
-\cs_new_protected:Npn \siunitx_table_align_right:n #1
+\cs_new_protected:Npn \@@_table_align_right:n #1
{
- \skip_horizontal:n { \c_siunitx_one_fill_skip - #1 }
+ \skip_horizontal:n { \c_@@_one_fill_skip - #1 }
\tex_kern:D \c_zero_skip
- \siunitx_table_colortbl_correction:
+ \@@_table_colortbl_correction:
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_column_begin:}
-% \begin{macro}{\siunitx_table_column_end:}
+% \begin{macro}{\@@_table_column_begin:}
+% \begin{macro}{\@@_table_column_end:}
% \begin{macrocode}
-\cs_new_eq:NN \siunitx_table_column_begin:n \siunitx_table_align_left:n
-\cs_new_eq:NN \siunitx_table_column_end:n \siunitx_table_align_right:n
+\cs_new_eq:NN \@@_table_column_begin:n \@@_table_align_left:n
+\cs_new_eq:NN \@@_table_column_end:n \@@_table_align_right:n
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -13647,26 +13653,26 @@ This work consists of the file siunitx.dtx
{
\dim_compare:nNnTF {#1} = { \c_zero_dim }
{
- \cs_set_eq:NN \siunitx_table_column_begin:n
- \siunitx_table_align_left:n
- \cs_set_eq:NN \siunitx_table_column_end:n
- \siunitx_table_align_right:n
+ \cs_set_eq:NN \@@_table_column_begin:n
+ \@@_table_align_left:n
+ \cs_set_eq:NN \@@_table_column_end:n
+ \@@_table_align_right:n
}
{
- \cs_set_protected:Npn \siunitx_table_column_begin:n ##1
+ \cs_set_protected:Npn \@@_table_column_begin:n ##1
{
- \siunitx_table_colortbl_correction:
+ \@@_table_colortbl_correction:
\tex_hbox:D to \dim_eval:n {#1}
\c_group_begin_token
\skip_horizontal:n {##1}
\tex_kern:D \c_zero_skip
}
- \cs_set_protected:Npn \siunitx_table_column_end:n ##1
+ \cs_set_protected:Npn \@@_table_column_end:n ##1
{
- \skip_horizontal:n { \c_siunitx_one_fill_skip - ##1 }
+ \skip_horizontal:n { \c_@@_one_fill_skip - ##1 }
\tex_kern:D \c_zero_skip
\hbox_set_inline_end:
- \siunitx_table_colortbl_correction:
+ \@@_table_colortbl_correction:
}
}
}
@@ -13680,10 +13686,10 @@ This work consists of the file siunitx.dtx
% collected input as the argument to the internal part of an \cs{si}
% function.
%
-% \begin{variable}{\l_siunitx_table_unit_align_skip}
+% \begin{variable}{\l_@@_table_unit_align_skip}
% The spacing used is stored as a skip, which needs to be set up first.
% \begin{macrocode}
-\skip_new:N \l_siunitx_table_unit_align_skip
+\skip_new:N \l_@@_table_unit_align_skip
% \end{macrocode}
% \end{variable}
%
@@ -13694,33 +13700,33 @@ This work consists of the file siunitx.dtx
table-unit-alignment /
center .code:n =
{
- \skip_set:Nn \l_siunitx_table_unit_align_skip
+ \skip_set:Nn \l_@@_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 } },
+ { \skip_set:Nn \l_@@_table_unit_align_skip { \c_zero_skip } },
table-unit-alignment /
right .code:n =
{
- \skip_set:Nn \l_siunitx_table_unit_align_skip
+ \skip_set:Nn \l_@@_table_unit_align_skip
{ \c_zero_skip plus 1 fill }
}
}
\keys_set:nn { siunitx } { table-unit-alignment = center }
% \end{macrocode}
%
-% \begin{macro}{\siunitx_table_print_s:}
+% \begin{macro}{\@@_table_print_s:}
% Actually printing an \texttt{s} column is not very complex. There is
% some spacing to do at each side, with the main part of the job being
% to print the material using the internal version of \cs{si}.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_s:
+\cs_new_protected:Npn \@@_table_print_s:
{
- \siunitx_table_column_begin:n { \l_siunitx_table_unit_align_skip }
- \tl_if_empty:NF \l_siunitx_table_collect_tl
- { \siunitx_unit_output:Vn \l_siunitx_table_collect_tl { } }
- \siunitx_table_column_end:n { \l_siunitx_table_unit_align_skip }
+ \@@_table_column_begin:n { \l_@@_table_unit_align_skip }
+ \tl_if_empty:NF \l_@@_table_collect_tl
+ { \@@_unit_output:Vn \l_@@_table_collect_tl { } }
+ \@@_table_column_end:n { \l_@@_table_unit_align_skip }
}
% \end{macrocode}
% \end{macro}
@@ -13731,111 +13737,111 @@ This work consists of the file siunitx.dtx
% output then print it. Most of the formatting is done elsewhere, so
% most of the work here is in printing.
%
-% \begin{variable}{\l_siunitx_table_model_prop}
+% \begin{variable}{\l_@@_table_model_prop}
% A place to store the model for reserved-space table columns.
% \begin{macrocode}
-\prop_new:N \l_siunitx_table_model_prop
+\prop_new:N \l_@@_table_model_prop
% \end{macrocode}
% \end{variable}
%
% \begin{variable}
% {
-% \l_siunitx_table_exponent_dim ,
-% \l_siunitx_table_integer_dim ,
-% \l_siunitx_table_mantissa_dim ,
-% \l_siunitx_table_marker_dim ,
-% \l_siunitx_table_result_dim ,
-% \l_siunitx_table_uncert_dim
+% \l_@@_table_exponent_dim ,
+% \l_@@_table_integer_dim ,
+% \l_@@_table_mantissa_dim ,
+% \l_@@_table_marker_dim ,
+% \l_@@_table_result_dim ,
+% \l_@@_table_uncert_dim
% }
% Dimensions to track the various spaces needed.
% \begin{macrocode}
-\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_@@_table_exponent_dim
+\dim_new:N \l_@@_table_integer_dim
+\dim_new:N \l_@@_table_mantissa_dim
+\dim_new:N \l_@@_table_marker_dim
+\dim_new:N \l_@@_table_result_dim
+\dim_new:N \l_@@_table_uncert_dim
% \end{macrocode}
%\end{variable}
%
% \begin{variable}
-% {\l_siunitx_table_fill_pre_dim, \l_siunitx_table_fill_post_dim}
+% {\l_@@_table_fill_pre_dim, \l_@@_table_fill_post_dim}
% Calculating the fill needed can be a bit complicated, so is best
% done using a dedicated dimension. There is a second one for cases dealing
% with fill at the end of a number, where there may be some rearrangement.
% \begin{macrocode}
-\dim_new:N \l_siunitx_table_fill_pre_dim
-\dim_new:N \l_siunitx_table_fill_post_dim
+\dim_new:N \l_@@_table_fill_pre_dim
+\dim_new:N \l_@@_table_fill_post_dim
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_siunitx_table_fill_mid_dim}
+% \begin{variable}{\l_@@_table_fill_mid_dim}
% For the reserved space approach there is also the need for a third
% piece of fill, which may or may not be used.
% \begin{macrocode}
-\dim_new:N \l_siunitx_table_fill_mid_dim
+\dim_new:N \l_@@_table_fill_mid_dim
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_siunitx_table_pre_box, \l_siunitx_table_post_box}
+% \begin{variable}{\l_@@_table_pre_box, \l_@@_table_post_box}
% Boxes for the content before and after the numerical part.
% \begin{macrocode}
-\box_new:N \l_siunitx_table_pre_box
-\box_new:N \l_siunitx_table_post_box
+\box_new:N \l_@@_table_pre_box
+\box_new:N \l_@@_table_post_box
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_siunitx_table_mantissa_box}
+% \begin{variable}{\l_@@_table_mantissa_box}
% When printing with space reserved, the mantissa needs to hang around
% for a while. This is best done by storing the typeset result in a box.
% \begin{macrocode}
-\box_new:N \l_siunitx_table_mantissa_box
+\box_new:N \l_@@_table_mantissa_box
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_siunitx_table_result_box}
+% \begin{variable}{\l_@@_table_result_box}
% The box which is actually needed for printing.
% \begin{macrocode}
-\box_new:N \l_siunitx_table_result_box
+\box_new:N \l_@@_table_result_box
% \end{macrocode}
% \end{variable}
%
% \begin{variable}
-% {\l_siunitx_table_number_align_skip, \l_siunitx_table_text_align_skip}
+% {\l_@@_table_number_align_skip, \l_@@_table_text_align_skip}
% Skips for aligning text and numbers.
% \begin{macrocode}
-\skip_new:N \l_siunitx_table_number_align_skip
-\skip_new:N \l_siunitx_table_text_align_skip
+\skip_new:N \l_@@_table_number_align_skip
+\skip_new:N \l_@@_table_text_align_skip
% \end{macrocode}
% \end{variable}
%
% \begin{macro}
% {
-% \siunitx_table_print_S_direct_main: ,
-% \siunitx_table_print_S_parsed:
+% \@@_table_print_S_direct_main: ,
+% \@@_table_print_S_parsed:
% }
-% \begin{macro}{\siunitx_table_print_S_reserved_store_fill:n}
+% \begin{macro}{\@@_table_print_S_reserved_store_fill:n}
% Various functions which are set up by the option system, and so are
% reserved here first for completeness.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_direct_main: { }
-\cs_new_protected:Npn \siunitx_table_print_S_parsed: { }
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_store_fill:n #1 { }
+\cs_new_protected:Npn \@@_table_print_S_direct_main: { }
+\cs_new_protected:Npn \@@_table_print_S_parsed: { }
+\cs_new_protected:Npn \@@_table_print_S_reserved_store_fill:n #1 { }
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{variable}
% {
-% \l_siunitx_table_align_exponent_bool,
-% \l_siunitx_table_align_text_pre_bool,
-% \l_siunitx_table_align_text_post_bool,
-% \l_siunitx_table_align_uncert_bool,
-% \l_siunitx_table_auto_round_bool,
-% \l_siunitx_table_omit_exponent_bool,
-% \l_siunitx_table_parse_only_bool,
-% \l_siunitx_table_pre_tl,
-% \l_siunitx_table_post_tl
+% \l_@@_table_align_exponent_bool,
+% \l_@@_table_align_text_pre_bool,
+% \l_@@_table_align_text_post_bool,
+% \l_@@_table_align_uncert_bool,
+% \l_@@_table_auto_round_bool,
+% \l_@@_table_omit_exponent_bool,
+% \l_@@_table_parse_only_bool,
+% \l_@@_table_pre_tl,
+% \l_@@_table_post_tl
% }
% \begin{macrocode}
\keys_define:nn { siunitx }
@@ -13844,159 +13850,159 @@ This work consists of the file siunitx.dtx
table-align-comparator /
false .code:n =
{
- \cs_set_eq:NN \siunitx_table_print_S_reserved_store_fill:n
- \siunitx_table_print_S_reserved_store_fill_pre:n
+ \cs_set_eq:NN \@@_table_print_S_reserved_store_fill:n
+ \@@_table_print_S_reserved_store_fill_pre:n
},
table-align-comparator /
true .code:n =
{
- \cs_set_eq:NN \siunitx_table_print_S_reserved_store_fill:n
- \siunitx_table_print_S_reserved_store_fill_mid:n
+ \cs_set_eq:NN \@@_table_print_S_reserved_store_fill:n
+ \@@_table_print_S_reserved_store_fill_mid:n
},
table-align-comparator .default:n = true,
table-align-exponent .bool_set:N =
- \l_siunitx_table_align_exponent_bool,
+ \l_@@_table_align_exponent_bool,
table-align-text-pre .bool_set:N =
- \l_siunitx_table_align_text_pre_bool,
+ \l_@@_table_align_text_pre_bool,
table-align-text-post .bool_set:N =
- \l_siunitx_table_align_text_post_bool,
- table-align-uncertainty .bool_set:N = \l_siunitx_table_align_uncert_bool,
- table-auto-round .bool_set:N = \l_siunitx_table_auto_round_bool,
+ \l_@@_table_align_text_post_bool,
+ table-align-uncertainty .bool_set:N = \l_@@_table_align_uncert_bool,
+ table-auto-round .bool_set:N = \l_@@_table_auto_round_bool,
table-number-alignment .choice:,
table-number-alignment /
center .code:n =
{
- \skip_set:Nn \l_siunitx_table_number_align_skip
+ \skip_set:Nn \l_@@_table_number_align_skip
{ \c_zero_skip plus 0.5 fill }
- \cs_set_eq:NN \siunitx_table_print_S_direct_main:
- \siunitx_table_print_S_direct_reserved:
- \cs_set_eq:NN \siunitx_table_print_S_parsed:
- \siunitx_table_print_S_reserved:
+ \cs_set_eq:NN \@@_table_print_S_direct_main:
+ \@@_table_print_S_direct_reserved:
+ \cs_set_eq:NN \@@_table_print_S_parsed:
+ \@@_table_print_S_reserved:
},
table-number-alignment /
center-decimal-marker .code:n =
{
- \skip_set:Nn \l_siunitx_table_number_align_skip
+ \skip_set:Nn \l_@@_table_number_align_skip
{ \c_zero_skip plus 0.5 fill }
- \cs_set_eq:NN \siunitx_table_print_S_direct_main:
- \siunitx_table_print_S_direct_centered:
- \cs_set_eq:NN \siunitx_table_print_S_parsed:
- \siunitx_table_print_S_centered:
+ \cs_set_eq:NN \@@_table_print_S_direct_main:
+ \@@_table_print_S_direct_centered:
+ \cs_set_eq:NN \@@_table_print_S_parsed:
+ \@@_table_print_S_centered:
},
table-number-alignment /
left .code:n =
{
- \skip_zero:N \l_siunitx_table_number_align_skip
- \cs_set_eq:NN \siunitx_table_print_S_direct_main:
- \siunitx_table_print_S_direct_reserved:
- \cs_set_eq:NN \siunitx_table_print_S_parsed:
- \siunitx_table_print_S_reserved:
+ \skip_zero:N \l_@@_table_number_align_skip
+ \cs_set_eq:NN \@@_table_print_S_direct_main:
+ \@@_table_print_S_direct_reserved:
+ \cs_set_eq:NN \@@_table_print_S_parsed:
+ \@@_table_print_S_reserved:
},
table-number-alignment /
right .code:n =
{
- \skip_set:Nn \l_siunitx_table_number_align_skip
+ \skip_set:Nn \l_@@_table_number_align_skip
{ \c_zero_skip plus 1 fill }
- \cs_set_eq:NN \siunitx_table_print_S_direct_main:
- \siunitx_table_print_S_direct_reserved:
- \cs_set_eq:NN \siunitx_table_print_S_parsed:
- \siunitx_table_print_S_reserved:
+ \cs_set_eq:NN \@@_table_print_S_direct_main:
+ \@@_table_print_S_direct_reserved:
+ \cs_set_eq:NN \@@_table_print_S_parsed:
+ \@@_table_print_S_reserved:
},
table-omit-exponent .bool_set:N =
- \l_siunitx_table_omit_exponent_bool,
+ \l_@@_table_omit_exponent_bool,
table-text-alignment .choice:,
table-text-alignment /
center .code:n =
{
- \skip_set:Nn \l_siunitx_table_text_align_skip
+ \skip_set:Nn \l_@@_table_text_align_skip
{ \c_zero_skip plus 0.5 fill }
},
table-text-alignment /
left .code:n =
- { \skip_zero:N \l_siunitx_table_text_align_skip },
+ { \skip_zero:N \l_@@_table_text_align_skip },
table-text-alignment /
right .code:n =
{
- \skip_set:Nn \l_siunitx_table_text_align_skip
+ \skip_set:Nn \l_@@_table_text_align_skip
{ \c_zero_skip plus 1 fill }
},
table-comparator .choice:,
table-comparator /
false .code:n =
- { \prop_del:Nn \l_siunitx_table_model_prop { comparator } },
+ { \prop_del:Nn \l_@@_table_model_prop { comparator } },
table-comparator /
true .code:n =
- { \prop_put:Nnn \l_siunitx_table_model_prop { comparator } { > } },
+ { \prop_put:Nnn \l_@@_table_model_prop { comparator } { > } },
table-comparator .default:n = true,
table-figures-decimal .code:n =
{
\int_compare:nNnTF {#1} = \c_zero
{
- \prop_del:Nn \l_siunitx_table_model_prop { mantissa-decimal }
- \prop_del:Nn \l_siunitx_table_model_prop { mantissa-decimal-raw }
- \prop_del:Nn \l_siunitx_table_model_prop
+ \prop_del:Nn \l_@@_table_model_prop { mantissa-decimal }
+ \prop_del:Nn \l_@@_table_model_prop { mantissa-decimal-raw }
+ \prop_del:Nn \l_@@_table_model_prop
{ mantissa-decimal-marker }
- \prop_if_in:NnTF \l_siunitx_table_model_prop { mantissa-integer }
+ \prop_if_in:NnTF \l_@@_table_model_prop { mantissa-integer }
{
- \prop_put:Nnn \l_siunitx_table_model_prop { mantissa }
+ \prop_put:Nnn \l_@@_table_model_prop { mantissa }
{ true }
}
- { \prop_del:Nn \l_siunitx_table_model_prop { mantissa } }
+ { \prop_del:Nn \l_@@_table_model_prop { mantissa } }
}
{
- \prop_put:Nnx \l_siunitx_table_model_prop { mantissa-decimal }
+ \prop_put:Nnx \l_@@_table_model_prop { mantissa-decimal }
{ \prg_replicate:nn {#1} { 8 } }
- \prop_put:Nnn \l_siunitx_table_model_prop { mantissa-decimal-raw }
+ \prop_put:Nnn \l_@@_table_model_prop { mantissa-decimal-raw }
{#1}
- \prop_put:Nnn \l_siunitx_table_model_prop { mantissa } { true }
- \prop_put:NnV \l_siunitx_table_model_prop
- { mantissa-decimal-marker } \l_siunitx_output_decimal_tl
+ \prop_put:Nnn \l_@@_table_model_prop { mantissa } { true }
+ \prop_put:NnV \l_@@_table_model_prop
+ { mantissa-decimal-marker } \l_@@_output_decimal_tl
}
},
table-figures-exponent .code:n =
{
\int_compare:nNnTF {#1} = \c_zero
- { \prop_del:Nn \l_siunitx_table_model_prop { exponent-integer } }
+ { \prop_del:Nn \l_@@_table_model_prop { exponent-integer } }
{
- \prop_put:Nnx \l_siunitx_table_model_prop { exponent-integer }
+ \prop_put:Nnx \l_@@_table_model_prop { exponent-integer }
{ \prg_replicate:nn {#1} { 8 } }
- \prop_put:Nnn \l_siunitx_table_model_prop { exponent } { true }
+ \prop_put:Nnn \l_@@_table_model_prop { exponent } { true }
}
},
table-figures-integer .code:n =
{
\int_compare:nNnTF {#1} = \c_zero
{
- \prop_del:Nn \l_siunitx_table_model_prop { mantissa-integer }
- \prop_if_in:NnTF \l_siunitx_table_model_prop { mantissa-decimal }
+ \prop_del:Nn \l_@@_table_model_prop { mantissa-integer }
+ \prop_if_in:NnTF \l_@@_table_model_prop { mantissa-decimal }
{
- \prop_put:Nnn \l_siunitx_table_model_prop { mantissa }
+ \prop_put:Nnn \l_@@_table_model_prop { mantissa }
{ true }
}
- { \prop_del:Nn \l_siunitx_table_model_prop { mantissa } }
+ { \prop_del:Nn \l_@@_table_model_prop { mantissa } }
}
{
- \prop_put:Nnx \l_siunitx_table_model_prop { mantissa-integer }
+ \prop_put:Nnx \l_@@_table_model_prop { mantissa-integer }
{ \prg_replicate:nn {#1} { 8 } }
- \prop_put:Nnn \l_siunitx_table_model_prop { mantissa } { true }
+ \prop_put:Nnn \l_@@_table_model_prop { mantissa } { true }
}
},
table-figures-uncertainty .code:n =
{
\int_compare:nNnTF {#1} = \c_zero
- { \prop_del:Nn \l_siunitx_table_model_prop { mantissa-uncertainty } }
+ { \prop_del:Nn \l_@@_table_model_prop { mantissa-uncertainty } }
{
- \prop_put:Nnx \l_siunitx_table_model_prop { mantissa-uncertainty }
+ \prop_put:Nnx \l_@@_table_model_prop { mantissa-uncertainty }
{ \prg_replicate:nn {#1} { 8 } }
}
},
- 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-parse-only .bool_set:N = \l_@@_table_parse_only_bool,
+ table-space-text-pre .tl_set:N = \l_@@_table_pre_tl,
+ table-space-text-post .tl_set:N = \l_@@_table_post_tl,
table-sign-exponent .code:n =
- { \prop_put:Nnn \l_siunitx_table_model_prop { exponent-sign } { - } },
+ { \prop_put:Nnn \l_@@_table_model_prop { exponent-sign } { - } },
table-sign-mantissa .code:n =
- { \prop_put:Nnn \l_siunitx_table_model_prop { mantissa-sign } { - } },
+ { \prop_put:Nnn \l_@@_table_model_prop { mantissa-sign } { - } },
}
% \end{macrocode}
% \end{variable}
@@ -14021,133 +14027,133 @@ This work consists of the file siunitx.dtx
{
table-format .code:n =
{
- \siunitx_number_in_parse:n {#1}
- \prop_set_eq:NN \l_siunitx_table_model_prop \l_siunitx_number_in_prop
- \tl_clear:N \l_siunitx_tmpa_tl
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-integer }
- \l_siunitx_tmpb_tl
+ \@@_number_in_parse:n {#1}
+ \prop_set_eq:NN \l_@@_table_model_prop \l_@@_number_in_prop
+ \tl_clear:N \l_@@_tmpa_tl
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-integer }
+ \l_@@_tmpb_tl
{
- \tl_set:Nx \l_siunitx_tmpa_tl
- { table-figures-integer = \l_siunitx_tmpb_tl }
+ \tl_set:Nx \l_@@_tmpa_tl
+ { table-figures-integer = \l_@@_tmpb_tl }
}
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-decimal }
- \l_siunitx_tmpb_tl
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-decimal }
+ \l_@@_tmpb_tl
{
- \clist_put_right:Nx \l_siunitx_tmpa_tl
- { table-figures-decimal = \l_siunitx_tmpb_tl }
+ \clist_put_right:Nx \l_@@_tmpa_tl
+ { table-figures-decimal = \l_@@_tmpb_tl }
}
- \prop_get:NnNT \l_siunitx_number_in_prop { mantissa-uncertainty }
- \l_siunitx_tmpb_tl
+ \prop_get:NnNT \l_@@_number_in_prop { mantissa-uncertainty }
+ \l_@@_tmpb_tl
{
- \clist_put_right:Nx \l_siunitx_tmpa_tl
- { table-figures-uncertainty = \l_siunitx_tmpb_tl }
+ \clist_put_right:Nx \l_@@_tmpa_tl
+ { table-figures-uncertainty = \l_@@_tmpb_tl }
}
- \prop_get:NnNT \l_siunitx_number_in_prop { exponent-integer }
- \l_siunitx_tmpb_tl
+ \prop_get:NnNT \l_@@_number_in_prop { exponent-integer }
+ \l_@@_tmpb_tl
{
- \clist_put_right:Nx \l_siunitx_tmpa_tl
- { table-figures-exponent = \l_siunitx_tmpb_tl }
+ \clist_put_right:Nx \l_@@_tmpa_tl
+ { table-figures-exponent = \l_@@_tmpb_tl }
}
- \clist_put_right:Nn \l_siunitx_tmpa_tl
+ \clist_put_right:Nn \l_@@_tmpa_tl
{ table-number-alignment = center }
- \keys_set:nV { siunitx } \l_siunitx_tmpa_tl
+ \keys_set:nV { siunitx } \l_@@_tmpa_tl
}
}
% \end{macrocode}
%
-% \begin{macro}{\siunitx_table_print_S:}
+% \begin{macro}{\@@_table_print_S:}
% The main printing function makes a choice depending on whether there is
% any numerical part to print at all. This affects which set of skips to
% insert. Font detection for the \texttt{S} column is included here as
% this is needed to do this work outside of an \cs{hbox}.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S:
+\cs_new_protected:Npn \@@_table_print_S:
{
- \bool_if:NTF \l_siunitx_table_collect_pre_bool
+ \bool_if:NTF \l_@@_table_collect_pre_bool
{
- \siunitx_table_column_begin:n { \l_siunitx_table_text_align_skip }
- \l_siunitx_table_collect_pre_tl
- \siunitx_table_column_end:n { \l_siunitx_table_text_align_skip }
+ \@@_table_column_begin:n { \l_@@_table_text_align_skip }
+ \l_@@_table_collect_pre_tl
+ \@@_table_column_end:n { \l_@@_table_text_align_skip }
}
{
- \siunitx_table_column_begin:n { \l_siunitx_table_number_align_skip }
- \bool_if:NTF \l_siunitx_table_parse_only_bool
- { \siunitx_table_print_S_no_alignment: }
- { \siunitx_table_print_S_alignment: }
- \bool_if:NTF \l_siunitx_table_align_text_pre_bool
- { \siunitx_table_print_S_pre_aligned: }
- { \siunitx_table_print_S_pre_not_aligned: }
- \box_use:N \l_siunitx_table_result_box
- \bool_if:NTF \l_siunitx_table_align_text_post_bool
- { \siunitx_table_print_S_post_aligned: }
- { \siunitx_table_print_S_post_not_aligned: }
- \siunitx_table_column_end:n { \l_siunitx_table_number_align_skip }
+ \@@_table_column_begin:n { \l_@@_table_number_align_skip }
+ \bool_if:NTF \l_@@_table_parse_only_bool
+ { \@@_table_print_S_no_alignment: }
+ { \@@_table_print_S_alignment: }
+ \bool_if:NTF \l_@@_table_align_text_pre_bool
+ { \@@_table_print_S_pre_aligned: }
+ { \@@_table_print_S_pre_not_aligned: }
+ \box_use:N \l_@@_table_result_box
+ \bool_if:NTF \l_@@_table_align_text_post_bool
+ { \@@_table_print_S_post_aligned: }
+ { \@@_table_print_S_post_not_aligned: }
+ \@@_table_column_end:n { \l_@@_table_number_align_skip }
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_no_alignment:}
+% \begin{macro}{\@@_table_print_S_no_alignment:}
% With no alignment to do, the code can be pretty simple. The collected
% number is simply printed between the two non-numerical parts.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_no_alignment:
+\cs_new_protected:Npn \@@_table_print_S_no_alignment:
{
- \l_siunitx_table_collect_pre_tl
- \siunitx_number_output:V \l_siunitx_table_collect_tl
- \l_siunitx_table_collect_post_tl
+ \l_@@_table_collect_pre_tl
+ \@@_number_output:V \l_@@_table_collect_tl
+ \l_@@_table_collect_post_tl
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_alignment:}
+% \begin{macro}{\@@_table_print_S_alignment:}
% This is a pass-through, so that the appropriate alignment mode is
% retained without needing to retest on each use.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_alignment:
- { \siunitx_table_print_S_parsed: }
+\cs_new_protected:Npn \@@_table_print_S_alignment:
+ { \@@_table_print_S_parsed: }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_parse:}
+% \begin{macro}{\@@_table_print_S_parse:}
% A modified version of the number parser for tables.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_parse:
+\cs_new_protected:Npn \@@_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
+ \bool_set_false:N \l_@@_error_bool
+ \@@_number_in_parse:V \l_@@_table_collect_tl
+ \bool_if:NF \l_@@_error_bool
{
- \bool_if:NTF \l_siunitx_table_omit_exponent_bool
+ \bool_if:NTF \l_@@_table_omit_exponent_bool
{
- \bool_set_true:N \l_siunitx_process_fixed_bool
- \siunitx_number_process:
- \prop_del:Nn \l_siunitx_number_in_prop { exponent }
- \prop_del:Nn \l_siunitx_number_in_prop { exponent-integer }
+ \bool_set_true:N \l_@@_process_fixed_bool
+ \@@_number_process:
+ \prop_del:Nn \l_@@_number_in_prop { exponent }
+ \prop_del:Nn \l_@@_number_in_prop { exponent-integer }
}
- { \siunitx_number_process: }
- \siunitx_number_format:
- \siunitx_number_output_color:
+ { \@@_number_process: }
+ \@@_number_format:
+ \@@_number_output_color:
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_measure:NN}
+% \begin{macro}{\@@_table_print_S_measure:NN}
% A short routine to measure up whatever has been extracted from the
% storage system. Boxing up is avoided for the empty cases, as this saves
% a little time(the print routine is relatively slow).
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_measure:NN #1#2
+\cs_new_protected:Npn \@@_table_print_S_measure:NN #1#2
{
\tl_if_empty:NTF #1
{ \dim_zero:N #2 }
{
\group_begin:
- \hbox_set:Nn \l_siunitx_tmp_box
- { \siunitx_print:nV { number } #1 }
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_print:nV { number } #1 }
\exp_args:NNNo \group_end:
- \dim_set:Nn #2 { \dim_use:N \box_wd:N \l_siunitx_tmp_box }
+ \dim_set:Nn #2 { \dim_use:N \box_wd:N \l_@@_tmp_box }
}
}
% \end{macrocode}
@@ -14155,86 +14161,86 @@ This work consists of the file siunitx.dtx
%
% \begin{macro}
% {
-% \siunitx_table_print_S_pre_aligned: ,
-% \siunitx_table_print_S_pre_not_aligned: ,
-% \siunitx_table_print_S_post_aligned: ,
-% \siunitx_table_print_S_post_not_aligned:
+% \@@_table_print_S_pre_aligned: ,
+% \@@_table_print_S_pre_not_aligned: ,
+% \@@_table_print_S_post_aligned: ,
+% \@@_table_print_S_post_not_aligned:
% }
% The non-numerical material is inserted along with the filler needed
% to maintain alignment. The order in which the two are inserted depends
% on whether those parts are also aligned.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_pre_aligned:
+\cs_new_protected:Npn \@@_table_print_S_pre_aligned:
{
- \box_use:N \l_siunitx_table_pre_box
- \hbox_to_wd:nn { \l_siunitx_table_fill_pre_dim } { \tex_hfil:D }
+ \box_use:N \l_@@_table_pre_box
+ \hbox_to_wd:nn { \l_@@_table_fill_pre_dim } { \tex_hfil:D }
}
-\cs_new_protected:Npn \siunitx_table_print_S_pre_not_aligned:
+\cs_new_protected:Npn \@@_table_print_S_pre_not_aligned:
{
- \hbox_to_wd:nn { \l_siunitx_table_fill_pre_dim } { \tex_hfil:D }
- \box_use:N \l_siunitx_table_pre_box
+ \hbox_to_wd:nn { \l_@@_table_fill_pre_dim } { \tex_hfil:D }
+ \box_use:N \l_@@_table_pre_box
}
-\cs_new_protected:Npn \siunitx_table_print_S_post_aligned:
+\cs_new_protected:Npn \@@_table_print_S_post_aligned:
{
- \hbox_to_wd:nn { \l_siunitx_table_fill_post_dim } { \tex_hfil:D }
- \box_use:N \l_siunitx_table_post_box
+ \hbox_to_wd:nn { \l_@@_table_fill_post_dim } { \tex_hfil:D }
+ \box_use:N \l_@@_table_post_box
}
-\cs_new_protected:Npn \siunitx_table_print_S_post_not_aligned:
+\cs_new_protected:Npn \@@_table_print_S_post_not_aligned:
{
- \box_use:N \l_siunitx_table_post_box
- \hbox_to_wd:nn { \l_siunitx_table_fill_post_dim } { \tex_hfil:D }
+ \box_use:N \l_@@_table_post_box
+ \hbox_to_wd:nn { \l_@@_table_fill_post_dim } { \tex_hfil:D }
}
% \end{macrocode}
% \end{macro}
%
% \subsection{Printing the \texttt{S} column with the decimal marker centred}
%
-% \begin{macro}{\siunitx_table_print_S_centered:}
+% \begin{macro}{\@@_table_print_S_centered:}
% The main routine for decimal-centred alignment works by boxing up the
% entire output, the integer part and the decimal marker. It then works
% out which part is bigger and calculates the fill correction accordingly.
% Once all of that is done, the various boxes and fill can be inserted.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_centered:
+\cs_new_protected:Npn \@@_table_print_S_centered:
{
- \siunitx_table_print_S_centered_ends:
- \bool_if:NT \l_siunitx_table_math_bool { \c_math_toggle_token }
- \siunitx_table_print_S_parse:
- \bool_if:NF \l_siunitx_error_bool
+ \@@_table_print_S_centered_ends:
+ \bool_if:NT \l_@@_table_math_bool { \c_math_toggle_token }
+ \@@_table_print_S_parse:
+ \bool_if:NF \l_@@_error_bool
{
- \siunitx_table_print_S_centered_measure:
- \bool_if:NT \l_siunitx_table_math_bool { \c_math_toggle_token }
- \dim_set:Nn \l_siunitx_table_fill_pre_dim
+ \@@_table_print_S_centered_measure:
+ \bool_if:NT \l_@@_table_math_bool { \c_math_toggle_token }
+ \dim_set:Nn \l_@@_table_fill_pre_dim
{
- \l_siunitx_table_result_dim
- - \l_siunitx_table_integer_dim
- \prop_if_in:NnT \l_siunitx_number_out_prop
+ \l_@@_table_result_dim
+ - \l_@@_table_integer_dim
+ \prop_if_in:NnT \l_@@_number_out_prop
{ mantissa-decimal-marker }
- { - \l_siunitx_table_marker_dim }
+ { - \l_@@_table_marker_dim }
}
- \dim_compare:nNnTF \l_siunitx_table_integer_dim >
- \l_siunitx_table_fill_pre_dim
- { \siunitx_table_print_S_centered_integer: }
- { \siunitx_table_print_S_centered_decimal: }
+ \dim_compare:nNnTF \l_@@_table_integer_dim >
+ \l_@@_table_fill_pre_dim
+ { \@@_table_print_S_centered_integer: }
+ { \@@_table_print_S_centered_decimal: }
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_centered_ends:}
+% \begin{macro}{\@@_table_print_S_centered_ends:}
% To deal with the material outside of the number, the first step is to
% box up both parts. If the pre-numeral part has no width, the tokens are
% inserted into the input stream to cover cases where they make a change
% to the colour, font or so forth. After that, the narrower of the two
% boxes is made the same size as the wider: this maintains the alignment.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_centered_ends:
+\cs_new_protected:Npn \@@_table_print_S_centered_ends:
{
- \hbox_set:Nn \l_siunitx_table_pre_box
+ \hbox_set:Nn \l_@@_table_pre_box
{
{
- \l_siunitx_table_collect_pre_tl
- \bool_if:NT \l_siunitx_table_math_bool
+ \l_@@_table_collect_pre_tl
+ \bool_if:NT \l_@@_table_math_bool
{
\scan_stop:
\c_math_toggle_token
@@ -14242,89 +14248,89 @@ This work consists of the file siunitx.dtx
}
}
\dim_compare:nNnT
- { \box_wd:N \l_siunitx_table_pre_box } = \c_zero_skip
+ { \box_wd:N \l_@@_table_pre_box } = \c_zero_skip
{
- \l_siunitx_table_collect_pre_tl
- \bool_set_false:N \l_siunitx_font_set_bool
+ \l_@@_table_collect_pre_tl
+ \bool_set_false:N \l_@@_font_set_bool
}
- \hbox_set:Nn \l_siunitx_table_post_box
+ \hbox_set:Nn \l_@@_table_post_box
{
- \bool_if:NT \l_siunitx_table_math_bool
+ \bool_if:NT \l_@@_table_math_bool
{
\c_math_toggle_token
\scan_stop:
}
- \l_siunitx_table_collect_post_tl
+ \l_@@_table_collect_post_tl
}
\dim_compare:nNnTF
- { \box_wd:N \l_siunitx_table_pre_box } >
- { \box_wd:N \l_siunitx_table_post_box }
+ { \box_wd:N \l_@@_table_pre_box } >
+ { \box_wd:N \l_@@_table_post_box }
{
- \hbox_set_to_wd:Nnn \l_siunitx_table_post_box
- { \box_wd:N \l_siunitx_table_pre_box }
+ \hbox_set_to_wd:Nnn \l_@@_table_post_box
+ { \box_wd:N \l_@@_table_pre_box }
{
- \hbox_unpack:N \l_siunitx_table_post_box
+ \hbox_unpack:N \l_@@_table_post_box
\tex_hfil:D
}
}
{
- \hbox_set_to_wd:Nnn \l_siunitx_table_pre_box
- { \box_wd:N \l_siunitx_table_post_box }
+ \hbox_set_to_wd:Nnn \l_@@_table_pre_box
+ { \box_wd:N \l_@@_table_post_box }
{
\tex_hfil:D
- \hbox_unpack:N \l_siunitx_table_pre_box
+ \hbox_unpack:N \l_@@_table_pre_box
}
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_centered_measure:}
+% \begin{macro}{\@@_table_print_S_centered_measure:}
% \begin{macro}[aux]
% {
-% \siunitx_table_print_S_centered_measure_int_part: ,
-% \siunitx_table_print_S_centered_measure_marker: ,
-% \siunitx_table_print_S_centered_measure_result:
+% \@@_table_print_S_centered_measure_int_part: ,
+% \@@_table_print_S_centered_measure_marker: ,
+% \@@_table_print_S_centered_measure_result:
% }
% Here, there are three parts of the number to measure: the integer part,
% the decimal marker and the entire number. Most of the work consists
% of collecting up parts of the number.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_centered_measure:
+\cs_new_protected:Npn \@@_table_print_S_centered_measure:
{
- \siunitx_table_print_S_centered_measure_int_part:
- \siunitx_table_print_S_centered_measure_marker:
- \siunitx_table_print_S_centered_measure_result:
+ \@@_table_print_S_centered_measure_int_part:
+ \@@_table_print_S_centered_measure_marker:
+ \@@_table_print_S_centered_measure_result:
}
-\cs_new_protected:Npn \siunitx_table_print_S_centered_measure_int_part:
+\cs_new_protected:Npn \@@_table_print_S_centered_measure_int_part:
{
- \prop_get:NnNF \l_siunitx_number_out_prop { comparator } \l_siunitx_tmpa_tl
- { \tl_clear:N \l_siunitx_tmpa_tl }
- \prop_get:NnNT \l_siunitx_number_out_prop { mantissa-sign }
- \l_siunitx_tmpb_tl
- { \tl_put_right:No \l_siunitx_tmpa_tl \l_siunitx_tmpb_tl }
- \prop_get:NnNT \l_siunitx_number_out_prop { mantissa-integer }
- \l_siunitx_tmpb_tl
- { \tl_put_right:No \l_siunitx_tmpa_tl \l_siunitx_tmpb_tl }
- \siunitx_table_print_S_measure:NN \l_siunitx_tmpa_tl
- \l_siunitx_table_integer_dim
+ \prop_get:NnNF \l_@@_number_out_prop { comparator } \l_@@_tmpa_tl
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \prop_get:NnNT \l_@@_number_out_prop { mantissa-sign }
+ \l_@@_tmpb_tl
+ { \tl_put_right:No \l_@@_tmpa_tl \l_@@_tmpb_tl }
+ \prop_get:NnNT \l_@@_number_out_prop { mantissa-integer }
+ \l_@@_tmpb_tl
+ { \tl_put_right:No \l_@@_tmpa_tl \l_@@_tmpb_tl }
+ \@@_table_print_S_measure:NN \l_@@_tmpa_tl
+ \l_@@_table_integer_dim
}
-\cs_new_protected:Npn \siunitx_table_print_S_centered_measure_marker:
+\cs_new_protected:Npn \@@_table_print_S_centered_measure_marker:
{
- \siunitx_table_print_S_measure:NN \l_siunitx_output_decimal_tl
- \l_siunitx_table_marker_dim
+ \@@_table_print_S_measure:NN \l_@@_output_decimal_tl
+ \l_@@_table_marker_dim
}
% \end{macrocode}
% As the overall result will be needed later, the boxing up here is done
% using a named box that will be retained.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_centered_measure_result:
+\cs_new_protected:Npn \@@_table_print_S_centered_measure_result:
{
- \prop_get:NnN \l_siunitx_number_out_prop { result } \l_siunitx_tmpa_tl
- \hbox_set:Nn \l_siunitx_table_result_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \dim_set:Nn \l_siunitx_table_result_dim
- { \box_wd:N \l_siunitx_table_result_box }
+ \prop_get:NnN \l_@@_number_out_prop { result } \l_@@_tmpa_tl
+ \hbox_set:Nn \l_@@_table_result_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \dim_set:Nn \l_@@_table_result_dim
+ { \box_wd:N \l_@@_table_result_box }
}
% \end{macrocode}
% \end{macro}
@@ -14332,82 +14338,82 @@ This work consists of the file siunitx.dtx
%
% \begin{macro}
% {
-% \siunitx_table_print_S_centered_integer: ,
-% \siunitx_table_print_S_centered_decimal:
+% \@@_table_print_S_centered_integer: ,
+% \@@_table_print_S_centered_decimal:
% }
% The appropriate place to insert the fill is determined by whether the
% integer or decimal part of the number is bigger. Two dimensions are
% therefore set, for fill before the number and after it. One of these
% will always be zero.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_centered_integer:
+\cs_new_protected:Npn \@@_table_print_S_centered_integer:
{
- \dim_set:Nn \l_siunitx_table_fill_post_dim
- { \l_siunitx_table_integer_dim - \l_siunitx_table_fill_pre_dim }
- \dim_zero:N \l_siunitx_table_fill_pre_dim
+ \dim_set:Nn \l_@@_table_fill_post_dim
+ { \l_@@_table_integer_dim - \l_@@_table_fill_pre_dim }
+ \dim_zero:N \l_@@_table_fill_pre_dim
}
-\cs_new_protected:Npn \siunitx_table_print_S_centered_decimal:
+\cs_new_protected:Npn \@@_table_print_S_centered_decimal:
{
- \dim_sub:Nn \l_siunitx_table_fill_pre_dim
- { \l_siunitx_table_integer_dim }
- \dim_zero:N \l_siunitx_table_fill_post_dim
+ \dim_sub:Nn \l_@@_table_fill_pre_dim
+ { \l_@@_table_integer_dim }
+ \dim_zero:N \l_@@_table_fill_post_dim
}
% \end{macrocode}
% \end{macro}
%
% \subsection{Printing the \texttt{S} column with space reserved}
%
-% \begin{macro}{\siunitx_table_print_S_reserved:}
+% \begin{macro}{\@@_table_print_S_reserved:}
% The procedure for inserting a number with space reserved requires a model
% for each part of the number.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved:
+\cs_new_protected:Npn \@@_table_print_S_reserved:
{
- \siunitx_table_print_S_reserved_init:
- \siunitx_table_print_S_reserved_ends:
- \bool_if:NT \l_siunitx_table_auto_round_bool
- { \siunitx_table_print_S_reserved_round_auto: }
- \siunitx_table_print_S_parse:
- \bool_if:NF \l_siunitx_error_bool
+ \@@_table_print_S_reserved_init:
+ \@@_table_print_S_reserved_ends:
+ \bool_if:NT \l_@@_table_auto_round_bool
+ { \@@_table_print_S_reserved_round_auto: }
+ \@@_table_print_S_parse:
+ \bool_if:NF \l_@@_error_bool
{
- \bool_if:NT \l_siunitx_table_math_bool { \c_math_toggle_token }
- \siunitx_table_print_S_reserved_comparator:
- \siunitx_table_print_S_reserved_mantissa:
- \siunitx_table_print_S_reserved_exponent:
- \bool_if:NT \l_siunitx_table_math_bool { \c_math_toggle_token }
+ \bool_if:NT \l_@@_table_math_bool { \c_math_toggle_token }
+ \@@_table_print_S_reserved_comparator:
+ \@@_table_print_S_reserved_mantissa:
+ \@@_table_print_S_reserved_exponent:
+ \bool_if:NT \l_@@_table_math_bool { \c_math_toggle_token }
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_reserved_init:}
+% \begin{macro}{\@@_table_print_S_reserved_init:}
% The creation of a model for the cell to follow. Creation of the finalised
% model is done here so that all of the other options will apply without
% needing complex internal tracking.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_init:
+\cs_new_protected:Npn \@@_table_print_S_reserved_init:
{
- \dim_zero:N \l_siunitx_table_fill_mid_dim
- \dim_zero:N \l_siunitx_table_fill_post_dim
- \prop_set_eq:NN \l_siunitx_number_in_prop \l_siunitx_table_model_prop
- \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_uncertainty: }
- \siunitx_number_format:
- \prop_get:NnNT \l_siunitx_table_model_prop { mantissa-decimal-raw }
- \l_siunitx_tmpa_tl
+ \dim_zero:N \l_@@_table_fill_mid_dim
+ \dim_zero:N \l_@@_table_fill_post_dim
+ \prop_set_eq:NN \l_@@_number_in_prop \l_@@_table_model_prop
+ \@@_number_process_sign:
+ \@@_number_process_zero_fill:
+ \@@_number_process_mantissa:
+ \prop_if_in:NnF \l_@@_number_in_prop { symbolic }
+ { \@@_number_process_uncertainty: }
+ \@@_number_format:
+ \prop_get:NnNT \l_@@_table_model_prop { mantissa-decimal-raw }
+ \l_@@_tmpa_tl
{
- \prop_put:NnV \l_siunitx_number_out_prop { mantissa-decimal-raw }
- \l_siunitx_tmpa_tl
+ \prop_put:NnV \l_@@_number_out_prop { mantissa-decimal-raw }
+ \l_@@_tmpa_tl
}
- \prop_set_eq:NN \l_siunitx_table_model_prop \l_siunitx_number_out_prop
+ \prop_set_eq:NN \l_@@_table_model_prop \l_@@_number_out_prop
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_reserved_ends:}
+% \begin{macro}{\@@_table_print_S_reserved_ends:}
% The end material here is boxed up into the space already reserved.
% That means doing two boxing ups: one for the model, and one for the
% real thing. As in the centred case, if the pre-numeral part has no
@@ -14415,13 +14421,13 @@ This work consists of the file siunitx.dtx
% with people forgetting to reserve space for the pre-numeral part, it is
% boxed up first at natural width so that the measurement is accurate.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_ends:
+\cs_new_protected:Npn \@@_table_print_S_reserved_ends:
{
- \hbox_set:Nn \l_siunitx_table_pre_box
+ \hbox_set:Nn \l_@@_table_pre_box
{
{
- \l_siunitx_table_collect_pre_tl
- \bool_if:NT \l_siunitx_table_math_bool
+ \l_@@_table_collect_pre_tl
+ \bool_if:NT \l_@@_table_math_bool
{
\scan_stop:
\c_math_toggle_token
@@ -14429,29 +14435,29 @@ This work consists of the file siunitx.dtx
}
}
\dim_compare:nNnT
- { \box_wd:N \l_siunitx_table_pre_box } = \c_zero_skip
+ { \box_wd:N \l_@@_table_pre_box } = \c_zero_skip
{
- \l_siunitx_table_collect_pre_tl
- \bool_set_false:N \l_siunitx_font_set_bool
+ \l_@@_table_collect_pre_tl
+ \bool_set_false:N \l_@@_font_set_bool
}
- \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 }
+ \hbox_set:Nn \l_@@_tmp_box { { \l_@@_table_pre_tl } }
+ \hbox_set_to_wd:Nnn \l_@@_table_pre_box
+ { \box_wd:N \l_@@_tmp_box }
{
\tex_hfil:D
- \hbox_unpack:N \l_siunitx_table_pre_box
+ \hbox_unpack:N \l_@@_table_pre_box
}
- \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 }
+ \hbox_set:Nn \l_@@_tmp_box { \l_@@_table_post_tl }
+ \hbox_set_to_wd:Nnn \l_@@_table_post_box
+ { \box_wd:N \l_@@_tmp_box }
{
{
- \bool_if:NT \l_siunitx_table_math_bool
+ \bool_if:NT \l_@@_table_math_bool
{
\c_math_toggle_token
\scan_stop:
}
- \l_siunitx_table_collect_post_tl
+ \l_@@_table_collect_post_tl
}
\tex_hfil:D
}
@@ -14459,23 +14465,23 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_reserved_round_auto:}
+% \begin{macro}{\@@_table_print_S_reserved_round_auto:}
% For auto-rounding, the approach is to find how many decimal digits are
% allowed for, and if there are none to simply set the rounding value to
% zero.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_round_auto:
+\cs_new_protected:Npn \@@_table_print_S_reserved_round_auto:
{
- \prop_get:NnNTF \l_siunitx_table_model_prop { mantissa-decimal-raw }
- \l_siunitx_tmpa_tl
- { \int_set:Nn \l_siunitx_process_precision_int { \l_siunitx_tmpa_tl } }
- { \int_zero:N \l_siunitx_process_precision_int }
- \tl_set:Nn \l_siunitx_round_tl { places }
+ \prop_get:NnNTF \l_@@_table_model_prop { mantissa-decimal-raw }
+ \l_@@_tmpa_tl
+ { \int_set:Nn \l_@@_process_precision_int { \l_@@_tmpa_tl } }
+ { \int_zero:N \l_@@_process_precision_int }
+ \tl_set:Nn \l_@@_round_tl { places }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_reserved_comparator:}
+% \begin{macro}{\@@_table_print_S_reserved_comparator:}
% The comparator is quite simple to deal with. Assuming that there is a
% comparator in the model, this is measured for the reserved width. The
% real comparator can then simply be typeset in a box of the same size.
@@ -14483,31 +14489,31 @@ This work consists of the file siunitx.dtx
% that for filling: this is needed so that any pre-note can be aligned
% freely.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_comparator:
+\cs_new_protected:Npn \@@_table_print_S_reserved_comparator:
{
- \prop_get:NnNTF \l_siunitx_table_model_prop { comparator }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNTF \l_@@_table_model_prop { comparator }
+ \l_@@_tmpa_tl
{
- \hbox_set:Nn \l_siunitx_tmp_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \prop_get:NnNTF \l_siunitx_number_out_prop { comparator }
- \l_siunitx_tmpa_tl
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \prop_get:NnNTF \l_@@_number_out_prop { comparator }
+ \l_@@_tmpa_tl
{
- \hbox_set_to_wd:Nnn \l_siunitx_table_result_box
- { \box_wd:N \l_siunitx_tmp_box }
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
+ \hbox_set_to_wd:Nnn \l_@@_table_result_box
+ { \box_wd:N \l_@@_tmp_box }
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
}
{
- \dim_add:Nn \l_siunitx_table_fill_pre_dim
- { \box_wd:N \l_siunitx_tmp_box }
- \cs_set_eq:NN \siunitx_table_print_S_reserved_store_fill:n
- \siunitx_table_print_S_reserved_store_fill_pre:n
+ \dim_add:Nn \l_@@_table_fill_pre_dim
+ { \box_wd:N \l_@@_tmp_box }
+ \cs_set_eq:NN \@@_table_print_S_reserved_store_fill:n
+ \@@_table_print_S_reserved_store_fill_pre:n
}
}
{
- \cs_set_eq:NN \siunitx_table_print_S_reserved_store_fill:n
- \siunitx_table_print_S_reserved_store_fill_pre:n
- \prop_if_in:NnT \l_siunitx_number_out_prop { comparator }
+ \cs_set_eq:NN \@@_table_print_S_reserved_store_fill:n
+ \@@_table_print_S_reserved_store_fill_pre:n
+ \prop_if_in:NnT \l_@@_number_out_prop { comparator }
{
\msg_error:nnx { siunitx } { table-partial-number }
{ a~comparator }
@@ -14519,24 +14525,24 @@ This work consists of the file siunitx.dtx
%
% \begin{macro}
% {
-% \siunitx_table_print_S_reserved_store_fill_pre:n ,
-% \siunitx_table_print_S_reserved_store_fill_mid:n
+% \@@_table_print_S_reserved_store_fill_pre:n ,
+% \@@_table_print_S_reserved_store_fill_mid:n
% }
% To allow for the various alignment options, fill is stored in a
% flexible way.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_store_fill_pre:n
- { \dim_add:Nn \l_siunitx_table_fill_pre_dim }
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_store_fill_mid:n
- { \dim_add:Nn \l_siunitx_table_fill_mid_dim }
+\cs_new_protected:Npn \@@_table_print_S_reserved_store_fill_pre:n
+ { \dim_add:Nn \l_@@_table_fill_pre_dim }
+\cs_new_protected:Npn \@@_table_print_S_reserved_store_fill_mid:n
+ { \dim_add:Nn \l_@@_table_fill_mid_dim }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_reserved_mantissa:}
+% \begin{macro}{\@@_table_print_S_reserved_mantissa:}
% \begin{macro}[aux]
% {
-% \siunitx_table_print_S_reserved_mantissa_parts: ,
-% \siunitx_table_print_S_reserved_mantissa_integer:
+% \@@_table_print_S_reserved_mantissa_parts: ,
+% \@@_table_print_S_reserved_mantissa_integer:
% }
% The mantissa of a number may contain a sign, an integer part, a
% decimal marker, a decimal part and a non-separated uncertainty. That
@@ -14547,29 +14553,29 @@ This work consists of the file siunitx.dtx
% to reserve, and see if there is anything at all to put in it. The
% complexity only starts if there is a mantissa in the current cell.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_mantissa:
+\cs_new_protected:Npn \@@_table_print_S_reserved_mantissa:
{
- \prop_get:NnNTF \l_siunitx_table_model_prop { mantissa }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNTF \l_@@_table_model_prop { mantissa }
+ \l_@@_tmpa_tl
{
- \hbox_set:Nn \l_siunitx_tmp_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \prop_get:NnNTF \l_siunitx_number_out_prop { mantissa }
- \l_siunitx_tmpa_tl
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \prop_get:NnNTF \l_@@_number_out_prop { mantissa }
+ \l_@@_tmpa_tl
{
- \dim_set:Nn \l_siunitx_table_mantissa_dim
- { \box_wd:N \l_siunitx_tmp_box }
- \hbox_set:Nn \l_siunitx_table_mantissa_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \siunitx_table_print_S_reserved_mantissa_parts:
+ \dim_set:Nn \l_@@_table_mantissa_dim
+ { \box_wd:N \l_@@_tmp_box }
+ \hbox_set:Nn \l_@@_table_mantissa_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \@@_table_print_S_reserved_mantissa_parts:
}
{
- \siunitx_table_print_S_reserved_store_fill:n
- { \box_wd:N \l_siunitx_tmp_box }
+ \@@_table_print_S_reserved_store_fill:n
+ { \box_wd:N \l_@@_tmp_box }
}
}
{
- \prop_if_in:NnT \l_siunitx_number_out_prop { mantissa }
+ \prop_if_in:NnT \l_@@_number_out_prop { mantissa }
{
\msg_error:nnx { siunitx } { table-partial-number }
{ a~mantissa }
@@ -14587,22 +14593,22 @@ This work consists of the file siunitx.dtx
% filler needed in the integer part. That is stored in the intermediate
% dimension for the present, although it may get moved.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_mantissa_parts:
+\cs_new_protected:Npn \@@_table_print_S_reserved_mantissa_parts:
{
- \siunitx_table_print_S_reserved_mantissa_integer:
- \hbox_set:Nn \l_siunitx_table_result_box
+ \@@_table_print_S_reserved_mantissa_integer:
+ \hbox_set:Nn \l_@@_table_result_box
{
- \hbox_unpack:N \l_siunitx_table_result_box
- \hbox_to_wd:nn { \l_siunitx_table_fill_mid_dim } { \tex_hfil:D }
- \hbox_unpack:N \l_siunitx_table_mantissa_box
+ \hbox_unpack:N \l_@@_table_result_box
+ \hbox_to_wd:nn { \l_@@_table_fill_mid_dim } { \tex_hfil:D }
+ \hbox_unpack:N \l_@@_table_mantissa_box
}
- \dim_set:Nn \l_siunitx_table_fill_mid_dim
+ \dim_set:Nn \l_@@_table_fill_mid_dim
{
- \l_siunitx_table_mantissa_dim
- - \box_wd:N \l_siunitx_table_mantissa_box
- - \l_siunitx_table_integer_dim
+ \l_@@_table_mantissa_dim
+ - \box_wd:N \l_@@_table_mantissa_box
+ - \l_@@_table_integer_dim
}
- \siunitx_table_print_S_reserved_mantissa_uncert:
+ \@@_table_print_S_reserved_mantissa_uncert:
}
% \end{macrocode}
% For the integer part, there is a need to measure both the sign and
@@ -14611,59 +14617,59 @@ This work consists of the file siunitx.dtx
% before or after any comparator. If there is an integer part, the
% size is measured and the any fill needed is stored for re-insertion.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_mantissa_integer:
+\cs_new_protected:Npn \@@_table_print_S_reserved_mantissa_integer:
{
- \prop_get:NnNF \l_siunitx_table_model_prop { mantissa-sign }
- \l_siunitx_tmpa_tl
- { \tl_clear:N \l_siunitx_tmpa_tl }
- \prop_get:NnNT \l_siunitx_table_model_prop { mantissa-integer }
- \l_siunitx_tmpb_tl
- { \tl_put_right:No \l_siunitx_tmpa_tl \l_siunitx_tmpb_tl }
- \siunitx_table_print_S_measure:NN \l_siunitx_tmpa_tl
- \l_siunitx_table_integer_dim
- \prop_get:NnNF \l_siunitx_number_out_prop { mantissa-sign }
- \l_siunitx_tmpa_tl
- { \tl_clear:N \l_siunitx_tmpa_tl }
- \prop_get:NnNT \l_siunitx_number_out_prop { mantissa-integer }
- \l_siunitx_tmpb_tl
- { \tl_put_right:No \l_siunitx_tmpa_tl \l_siunitx_tmpb_tl }
- \tl_if_empty:NF \l_siunitx_tmpa_tl
+ \prop_get:NnNF \l_@@_table_model_prop { mantissa-sign }
+ \l_@@_tmpa_tl
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \prop_get:NnNT \l_@@_table_model_prop { mantissa-integer }
+ \l_@@_tmpb_tl
+ { \tl_put_right:No \l_@@_tmpa_tl \l_@@_tmpb_tl }
+ \@@_table_print_S_measure:NN \l_@@_tmpa_tl
+ \l_@@_table_integer_dim
+ \prop_get:NnNF \l_@@_number_out_prop { mantissa-sign }
+ \l_@@_tmpa_tl
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \prop_get:NnNT \l_@@_number_out_prop { mantissa-integer }
+ \l_@@_tmpb_tl
+ { \tl_put_right:No \l_@@_tmpa_tl \l_@@_tmpb_tl }
+ \tl_if_empty:NF \l_@@_tmpa_tl
{
- \siunitx_table_print_S_measure:NN \l_siunitx_tmpa_tl
- \l_siunitx_tmp_dim
- \dim_sub:Nn \l_siunitx_table_integer_dim { \l_siunitx_tmp_dim }
+ \@@_table_print_S_measure:NN \l_@@_tmpa_tl
+ \l_@@_tmp_dim
+ \dim_sub:Nn \l_@@_table_integer_dim { \l_@@_tmp_dim }
}
- \siunitx_table_print_S_reserved_store_fill:n
- { \l_siunitx_table_integer_dim }
+ \@@_table_print_S_reserved_store_fill:n
+ { \l_@@_table_integer_dim }
}
% \end{macrocode}
% Here, a separated uncertainty is handled. If there is one, then there must
% be a \cs{pm} part to add. Once the space calculation is done, a flexible
% auxiliary does the spacing and pasting up.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_mantissa_uncert:
+\cs_new_protected:Npn \@@_table_print_S_reserved_mantissa_uncert:
{
- \prop_get:NnNT \l_siunitx_table_model_prop { mantissa-uncertainty }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_table_model_prop { mantissa-uncertainty }
+ \l_@@_tmpa_tl
{
- \siunitx_number_format_join_uncert_pm:N \l_siunitx_tmpa_tl
- \hbox_set:Nn \l_siunitx_tmp_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \prop_get:NnNTF \l_siunitx_number_out_prop { mantissa-uncertainty }
- \l_siunitx_tmpa_tl
+ \@@_number_format_join_uncert_pm:N \l_@@_tmpa_tl
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \prop_get:NnNTF \l_@@_number_out_prop { mantissa-uncertainty }
+ \l_@@_tmpa_tl
{
- \dim_set:Nn \l_siunitx_table_uncert_dim
- { \box_wd:N \l_siunitx_tmp_box }
- \siunitx_number_format_join_uncert_pm:N \l_siunitx_tmpa_tl
- \hbox_set:Nn \l_siunitx_tmp_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \bool_if:NTF \l_siunitx_table_align_uncert_bool
- { \siunitx_table_print_S_reserved_mantissa_uncert_aligned: }
- { \siunitx_table_print_S_reserved_mantissa_uncert_not_aligned: }
+ \dim_set:Nn \l_@@_table_uncert_dim
+ { \box_wd:N \l_@@_tmp_box }
+ \@@_number_format_join_uncert_pm:N \l_@@_tmpa_tl
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \bool_if:NTF \l_@@_table_align_uncert_bool
+ { \@@_table_print_S_reserved_mantissa_uncert_aligned: }
+ { \@@_table_print_S_reserved_mantissa_uncert_not_aligned: }
}
{
- \siunitx_table_print_S_reserved_store_fill:n
- { \box_wd:N \l_siunitx_tmp_box }
+ \@@_table_print_S_reserved_store_fill:n
+ { \box_wd:N \l_@@_tmp_box }
}
}
}
@@ -14674,99 +14680,99 @@ This work consists of the file siunitx.dtx
% any previous fill. The temporary box here contains the uncertainty part.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_table_print_S_reserved_mantissa_uncert_aligned:
+ \@@_table_print_S_reserved_mantissa_uncert_aligned:
{
- \hbox_set:Nn \l_siunitx_table_result_box
+ \hbox_set:Nn \l_@@_table_result_box
{
- \hbox_unpack:N \l_siunitx_table_result_box
- \hbox_to_wd:nn { \l_siunitx_table_fill_mid_dim } { \tex_hfil:D }
- \hbox_unpack:N \l_siunitx_tmp_box
+ \hbox_unpack:N \l_@@_table_result_box
+ \hbox_to_wd:nn { \l_@@_table_fill_mid_dim } { \tex_hfil:D }
+ \hbox_unpack:N \l_@@_tmp_box
}
- \dim_set:Nn \l_siunitx_table_fill_mid_dim
- { \l_siunitx_table_uncert_dim - \box_wd:N \l_siunitx_tmp_box }
+ \dim_set:Nn \l_@@_table_fill_mid_dim
+ { \l_@@_table_uncert_dim - \box_wd:N \l_@@_tmp_box }
}
\cs_new_protected:Npn
- \siunitx_table_print_S_reserved_mantissa_uncert_not_aligned:
+ \@@_table_print_S_reserved_mantissa_uncert_not_aligned:
{
- \hbox_set:Nn \l_siunitx_table_result_box
+ \hbox_set:Nn \l_@@_table_result_box
{
- \hbox_unpack:N \l_siunitx_table_result_box
- \hbox_unpack:N \l_siunitx_tmp_box
+ \hbox_unpack:N \l_@@_table_result_box
+ \hbox_unpack:N \l_@@_tmp_box
}
- \dim_add:Nn \l_siunitx_table_fill_mid_dim
+ \dim_add:Nn \l_@@_table_fill_mid_dim
{
- \l_siunitx_table_uncert_dim
- - \box_wd:N \l_siunitx_tmp_box
+ \l_@@_table_uncert_dim
+ - \box_wd:N \l_@@_tmp_box
}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\siunitx_table_print_S_reserved_exponent:}
+% \begin{macro}{\@@_table_print_S_reserved_exponent:}
% \begin{macro}[aux]
% {
-% \siunitx_table_print_S_reserved_exponent_product: ,
-% \siunitx_table_print_S_reserved_exponent_product_correction: ,
-% \siunitx_table_print_S_reserved_exponent_aligned: ,
-% \siunitx_table_print_S_reserved_exponent_not_aligned:
+% \@@_table_print_S_reserved_exponent_product: ,
+% \@@_table_print_S_reserved_exponent_product_correction: ,
+% \@@_table_print_S_reserved_exponent_aligned: ,
+% \@@_table_print_S_reserved_exponent_not_aligned:
% }
% Printing the exponent needs to deal with the exponent product. This
% is easiest to do by simply re-checking for a mantissa. If there is no
% exponent, then any space which needs to be added must be moved from
% the mid space to the post space at this stage.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_exponent:
+\cs_new_protected:Npn \@@_table_print_S_reserved_exponent:
{
- \prop_get:NnNTF \l_siunitx_table_model_prop { exponent-result }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNTF \l_@@_table_model_prop { exponent-result }
+ \l_@@_tmpa_tl
{
- \prop_if_in:NnT \l_siunitx_table_model_prop { mantissa }
- { \siunitx_table_print_S_reserved_exponent_product: }
- \hbox_set:Nn \l_siunitx_tmp_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \prop_get:NnNTF \l_siunitx_number_out_prop { exponent-result }
- \l_siunitx_tmpa_tl
+ \prop_if_in:NnT \l_@@_table_model_prop { mantissa }
+ { \@@_table_print_S_reserved_exponent_product: }
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \prop_get:NnNTF \l_@@_number_out_prop { exponent-result }
+ \l_@@_tmpa_tl
{
- \dim_set:Nn \l_siunitx_table_exponent_dim
- { \box_wd:N \l_siunitx_tmp_box }
- \prop_if_in:NnTF \l_siunitx_number_out_prop { mantissa }
- { \siunitx_table_print_S_reserved_exponent_product: }
- { \siunitx_table_print_S_reserved_exponent_product_correction: }
- \hbox_set:Nn \l_siunitx_tmp_box
- { \siunitx_print:nV { number } \l_siunitx_tmpa_tl }
- \bool_if:NTF \l_siunitx_table_align_exponent_bool
- { \siunitx_table_print_S_reserved_exponent_aligned: }
- { \siunitx_table_print_S_reserved_exponent_not_aligned: }
+ \dim_set:Nn \l_@@_table_exponent_dim
+ { \box_wd:N \l_@@_tmp_box }
+ \prop_if_in:NnTF \l_@@_number_out_prop { mantissa }
+ { \@@_table_print_S_reserved_exponent_product: }
+ { \@@_table_print_S_reserved_exponent_product_correction: }
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_print:nV { number } \l_@@_tmpa_tl }
+ \bool_if:NTF \l_@@_table_align_exponent_bool
+ { \@@_table_print_S_reserved_exponent_aligned: }
+ { \@@_table_print_S_reserved_exponent_not_aligned: }
}
{
- \dim_set:Nn \l_siunitx_table_fill_post_dim
- { \l_siunitx_table_fill_mid_dim + \box_wd:N \l_siunitx_tmp_box }
+ \dim_set:Nn \l_@@_table_fill_post_dim
+ { \l_@@_table_fill_mid_dim + \box_wd:N \l_@@_tmp_box }
}
}
{
- \prop_if_in:NnT \l_siunitx_number_out_prop { exponent-result }
+ \prop_if_in:NnT \l_@@_number_out_prop { exponent-result }
{
\msg_error:nnx { siunitx } { table-partial-number }
{ an~exponent }
}
- \dim_set_eq:NN \l_siunitx_table_fill_post_dim
- \l_siunitx_table_fill_mid_dim
+ \dim_set_eq:NN \l_@@_table_fill_post_dim
+ \l_@@_table_fill_mid_dim
}
}
% \end{macrocode}
% A short sub-function to deal with the appearance of the exponent product
% for both the real number and the model.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_exponent_product:
+\cs_new_protected:Npn \@@_table_print_S_reserved_exponent_product:
{
- \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:o \l_siunitx_tmpb_tl } } }
- \tl_set:Nx \l_siunitx_tmpa_tl
+ \tl_set_eq:NN \l_@@_tmpb_tl \l_@@_exponent_product_tl
+ \bool_if:NT \l_@@_tight_bool
+ { \tl_set:Nx \l_@@_tmpb_tl { { \exp_not:o \l_@@_tmpb_tl } } }
+ \tl_set:Nx \l_@@_tmpa_tl
{
- \exp_not:N \ensuremath { { } \exp_not:o \l_siunitx_tmpb_tl { } }
- \exp_not:o \l_siunitx_tmpa_tl
+ \exp_not:N \ensuremath { { } \exp_not:o \l_@@_tmpb_tl { } }
+ \exp_not:o \l_@@_tmpa_tl
}
}
% \end{macrocode}
@@ -14774,18 +14780,18 @@ This work consists of the file siunitx.dtx
% location where the product symbol would have been.
% \begin{macrocode}
\cs_new_protected:Npn
- \siunitx_table_print_S_reserved_exponent_product_correction:
+ \@@_table_print_S_reserved_exponent_product_correction:
{
\group_begin:
- \tl_clear:N \l_siunitx_tmpa_tl
- \siunitx_table_print_S_reserved_exponent_product:
- \tl_set:Nx \l_siunitx_tmpa_tl
- { { } \exp_not:o \l_siunitx_tmpa_tl { } }
- \siunitx_table_print_S_measure:NN \l_siunitx_tmpa_tl \l_siunitx_tmp_dim
+ \tl_clear:N \l_@@_tmpa_tl
+ \@@_table_print_S_reserved_exponent_product:
+ \tl_set:Nx \l_@@_tmpa_tl
+ { { } \exp_not:o \l_@@_tmpa_tl { } }
+ \@@_table_print_S_measure:NN \l_@@_tmpa_tl \l_@@_tmp_dim
\exp_args:NNNo \group_end:
- \dim_set:Nn \l_siunitx_tmp_dim { \dim_use:N \l_siunitx_tmp_dim }
- \siunitx_table_print_S_reserved_store_fill:n { \l_siunitx_tmp_dim }
- \dim_sub:Nn \l_siunitx_table_exponent_dim { \l_siunitx_tmp_dim }
+ \dim_set:Nn \l_@@_tmp_dim { \dim_use:N \l_@@_tmp_dim }
+ \@@_table_print_S_reserved_store_fill:n { \l_@@_tmp_dim }
+ \dim_sub:Nn \l_@@_table_exponent_dim { \l_@@_tmp_dim }
}
% \end{macrocode}
% There are two cases for adding the exponent to the result box, one
@@ -14794,33 +14800,33 @@ This work consists of the file siunitx.dtx
% or exclude the mid fill space. Doing that here avoids one extra assignment
% (to clear the mid fill in the aligned case).
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_reserved_exponent_aligned:
+\cs_new_protected:Npn \@@_table_print_S_reserved_exponent_aligned:
{
- \hbox_set:Nn \l_siunitx_table_result_box
+ \hbox_set:Nn \l_@@_table_result_box
{
- \hbox_unpack:N \l_siunitx_table_result_box
- \hbox_to_wd:nn { \l_siunitx_table_fill_mid_dim } { \tex_hfil:D }
- \hbox_unpack:N \l_siunitx_tmp_box
+ \hbox_unpack:N \l_@@_table_result_box
+ \hbox_to_wd:nn { \l_@@_table_fill_mid_dim } { \tex_hfil:D }
+ \hbox_unpack:N \l_@@_tmp_box
}
- \dim_set:Nn \l_siunitx_table_fill_post_dim
+ \dim_set:Nn \l_@@_table_fill_post_dim
{
- \l_siunitx_table_exponent_dim
- - \box_wd:N \l_siunitx_tmp_box
+ \l_@@_table_exponent_dim
+ - \box_wd:N \l_@@_tmp_box
}
}
\cs_new_protected:Npn
- \siunitx_table_print_S_reserved_exponent_not_aligned:
+ \@@_table_print_S_reserved_exponent_not_aligned:
{
- \hbox_set:Nn \l_siunitx_table_result_box
+ \hbox_set:Nn \l_@@_table_result_box
{
- \hbox_unpack:N \l_siunitx_table_result_box
- \hbox_unpack:N \l_siunitx_tmp_box
+ \hbox_unpack:N \l_@@_table_result_box
+ \hbox_unpack:N \l_@@_tmp_box
}
- \dim_set:Nn \l_siunitx_table_fill_post_dim
+ \dim_set:Nn \l_@@_table_fill_post_dim
{
- \l_siunitx_table_fill_mid_dim
- + \l_siunitx_table_exponent_dim
- - \box_wd:N \l_siunitx_tmp_box
+ \l_@@_table_fill_mid_dim
+ + \l_@@_table_exponent_dim
+ - \box_wd:N \l_@@_tmp_box
}
}
% \end{macrocode}
@@ -14834,33 +14840,33 @@ This work consists of the file siunitx.dtx
% \pkg{dcolumn} can be applied, which requires the decimal marker to
% be made active in math mode.
%
-% \begin{macro}{\siunitx_table_print_S_direct:N}
-% \begin{macro}{\siunitx_table_print_S_direct_text:n}
+% \begin{macro}{\@@_table_print_S_direct:N}
+% \begin{macro}{\@@_table_print_S_direct_text:n}
% The lead-off here first moves the \cs{ignorespaces} in the input to
% avoid picking it up. There is then a test to see if the very first item
% in the cell is a |{|. If it is, then we use the same approach as for
% parsed columns and set the material as text. Otherwise, switch to math
% mode and hand off to the main routine.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_table_print_S_direct:N #1
+\cs_new_protected:Npn \@@_table_print_S_direct:N #1
{
#1
- \cs_set:Npn \peek_execute_branches:
+ \cs_set:Npn \__peek_execute_branches:
{
\if_catcode:w \exp_not:N \l_peek_token \c_group_begin_token
- \exp_after:wN \siunitx_table_print_S_direct_text:n
+ \exp_after:wN \@@_table_print_S_direct_text:n
\else:
\m@th
- \exp_after:wN \siunitx_table_print_S_direct_main:
+ \exp_after:wN \@@_table_print_S_direct_main:
\fi:
}
- \peek_after:Nw \peek_ignore_spaces_execute_branches:
+ \peek_after:Nw \__peek_ignore_spaces_execute_branches:
}
-\cs_new_protected:Npn \siunitx_table_print_S_direct_text:n #1
+\cs_new_protected:Npn \@@_table_print_S_direct_text:n #1
{
- \siunitx_table_column_begin:n { \l_siunitx_table_text_align_skip }
+ \@@_table_column_begin:n { \l_@@_table_text_align_skip }
#1
- \siunitx_table_column_end:n { \l_siunitx_table_text_align_skip }
+ \@@_table_column_end:n { \l_@@_table_text_align_skip }
}
% \end{macrocode}
% \end{macro}
@@ -14868,32 +14874,32 @@ This work consists of the file siunitx.dtx
%
% \begin{macro}
% {
-% \siunitx_table_print_S_direct_centered: ,
-% \siunitx_table_print_S_direct_centered_end:
+% \@@_table_print_S_direct_centered: ,
+% \@@_table_print_S_direct_centered_end:
% }
-% \begin{macro}[aux]{\siunitx_table_print_S_direct_centered_aux:N}
+% \begin{macro}[aux]{\@@_table_print_S_direct_centered_aux:N}
% When centring the content about a decimal marker, the trick is
% to collect everything into two boxes and then compare the sizes.
% In that sense this is very similar to the normal method, except that
% it will work with non-numerical input.
% \begin{macrocode}
\char_set_catcode_active:N \@
-\cs_new_protected:Npn \siunitx_table_print_S_direct_centered:
+\cs_new_protected:Npn \@@_table_print_S_direct_centered:
{
- \cs_set_eq:NN \siunitx_table_print:
- \siunitx_table_print_S_direct_centered_end:
- \hbox_set:Nn \l_siunitx_tmp_box
- { \ensuremath { \l_siunitx_output_decimal_tl } }
- \hbox_set_to_wd:Nnn \l_siunitx_table_post_box
- { \box_wd:N \l_siunitx_tmp_box }
+ \cs_set_eq:NN \@@_table_print:
+ \@@_table_print_S_direct_centered_end:
+ \hbox_set:Nn \l_@@_tmp_box
+ { \ensuremath { \l_@@_output_decimal_tl } }
+ \hbox_set_to_wd:Nnn \l_@@_table_post_box
+ { \box_wd:N \l_@@_tmp_box }
{ \tex_hfil:D }
- \hbox_set:Nn \l_siunitx_table_pre_box
+ \hbox_set:Nn \l_@@_table_pre_box
\c_group_begin_token
\c_math_toggle_token
- \tl_map_function:NN \l_siunitx_input_decimal_tl
- \siunitx_table_print_S_direct_centered_aux:N
+ \tl_map_function:NN \l_@@_input_decimal_tl
+ \@@_table_print_S_direct_centered_aux:N
}
-\cs_new_protected:Npn \siunitx_table_print_S_direct_centered_aux:N #1
+\cs_new_protected:Npn \@@_table_print_S_direct_centered_aux:N #1
{
\char_set_lccode:nn { `\@ } { `#1 }
\char_set_mathcode:nn { `#1 } { 32768 }
@@ -14901,38 +14907,38 @@ This work consists of the file siunitx.dtx
{
\c_math_toggle_token
\c_group_end_token
- \hbox_set:Nn \l_siunitx_table_post_box
+ \hbox_set:Nn \l_@@_table_post_box
\c_group_begin_token
\c_math_toggle_token
- \l_siunitx_output_decimal_tl
+ \l_@@_output_decimal_tl
}
}
\char_set_catcode_letter:N \@
-\cs_new_protected:Npn \siunitx_table_print_S_direct_centered_end:
+\cs_new_protected:Npn \@@_table_print_S_direct_centered_end:
{
\c_math_toggle_token
\c_group_end_token
\dim_compare:nNnTF
- { \box_wd:N \l_siunitx_table_pre_box } >
- { \box_wd:N \l_siunitx_table_post_box }
+ { \box_wd:N \l_@@_table_pre_box } >
+ { \box_wd:N \l_@@_table_post_box }
{
- \hbox_set_to_wd:Nnn \l_siunitx_table_post_box
- { \box_wd:N \l_siunitx_table_pre_box }
+ \hbox_set_to_wd:Nnn \l_@@_table_post_box
+ { \box_wd:N \l_@@_table_pre_box }
{
- \hbox_unpack:N \l_siunitx_table_post_box
+ \hbox_unpack:N \l_@@_table_post_box
\tex_hfil:D
}
}
{
- \hbox_set_to_wd:Nnn \l_siunitx_table_pre_box
- { \box_wd:N \l_siunitx_table_post_box }
+ \hbox_set_to_wd:Nnn \l_@@_table_pre_box
+ { \box_wd:N \l_@@_table_post_box }
{
\tex_hfil:D
- \hbox_unpack:N \l_siunitx_table_pre_box
+ \hbox_unpack:N \l_@@_table_pre_box
}
}
- \box_use:N \l_siunitx_table_pre_box
- \box_use:N \l_siunitx_table_post_box
+ \box_use:N \l_@@_table_pre_box
+ \box_use:N \l_@@_table_post_box
}
% \end{macrocode}
% \end{macro}
@@ -14940,58 +14946,58 @@ This work consists of the file siunitx.dtx
%
% \begin{macro}
% {
-% \siunitx_table_print_S_direct_reserved: ,
-% \siunitx_table_print_S_direct_reserved_end:
+% \@@_table_print_S_direct_reserved: ,
+% \@@_table_print_S_direct_reserved_end:
% }
-% \begin{macro}[aux]{\siunitx_table_print_S_direct_reserved_aux:N}
+% \begin{macro}[aux]{\@@_table_print_S_direct_reserved_aux:N}
% The plan here is to box up the entire number using the information
% available about the size of the two parts. Relatively easy,
% but needs a bit of measuring. The first box here does need to use
% \cs{tex_hill:D} as \texttt{fil} glue will not work.
% \begin{macrocode}
\char_set_catcode_active:N \@
-\cs_new_protected:Npn \siunitx_table_print_S_direct_reserved:
+\cs_new_protected:Npn \@@_table_print_S_direct_reserved:
{
- \cs_set_eq:NN \siunitx_table_print:
- \siunitx_table_print_S_direct_reserved_end:
- \prop_get:NnNF \l_siunitx_table_model_prop { mantissa-integer }
- \l_siunitx_tmpa_tl
- { \tl_clear:N \l_siunitx_tmpa_tl }
- \hbox_set:Nn \l_siunitx_tmp_box
+ \cs_set_eq:NN \@@_table_print:
+ \@@_table_print_S_direct_reserved_end:
+ \prop_get:NnNF \l_@@_table_model_prop { mantissa-integer }
+ \l_@@_tmpa_tl
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \hbox_set:Nn \l_@@_tmp_box
{
\ensuremath
{
- \prop_get:NnNT \l_siunitx_table_model_prop { mantissa-sign }
- \l_siunitx_tmpb_tl
- { \l_siunitx_tmpb_tl }
- \l_siunitx_tmpa_tl
+ \prop_get:NnNT \l_@@_table_model_prop { mantissa-sign }
+ \l_@@_tmpb_tl
+ { \l_@@_tmpb_tl }
+ \l_@@_tmpa_tl
}
}
- \dim_set:Nn \l_siunitx_table_integer_dim
- { \box_wd:N \l_siunitx_tmp_box }
- \prop_get:NnNF \l_siunitx_table_model_prop { mantissa-decimal }
- \l_siunitx_tmpa_tl
- { \tl_clear:N \l_siunitx_tmpa_tl }
- \hbox_set:Nn \l_siunitx_tmp_box
+ \dim_set:Nn \l_@@_table_integer_dim
+ { \box_wd:N \l_@@_tmp_box }
+ \prop_get:NnNF \l_@@_table_model_prop { mantissa-decimal }
+ \l_@@_tmpa_tl
+ { \tl_clear:N \l_@@_tmpa_tl }
+ \hbox_set:Nn \l_@@_tmp_box
{
\ensuremath
{
- \l_siunitx_output_decimal_tl
- \l_siunitx_tmpa_tl
+ \l_@@_output_decimal_tl
+ \l_@@_tmpa_tl
}
}
- \hbox_set_to_wd:Nnn \l_siunitx_table_post_box
- { \box_wd:N \l_siunitx_tmp_box }
+ \hbox_set_to_wd:Nnn \l_@@_table_post_box
+ { \box_wd:N \l_@@_tmp_box }
{ \tex_hfil:D }
- \hbox_set_to_wd:Nnn \l_siunitx_table_pre_box
- { \l_siunitx_table_integer_dim }
+ \hbox_set_to_wd:Nnn \l_@@_table_pre_box
+ { \l_@@_table_integer_dim }
\c_group_begin_token
\c_math_toggle_token
- \tl_map_function:NN \l_siunitx_input_decimal_tl
- \siunitx_table_print_S_direct_reserved_aux:N
+ \tl_map_function:NN \l_@@_input_decimal_tl
+ \@@_table_print_S_direct_reserved_aux:N
\tex_hfill:D
}
-\cs_new_protected:Npn \siunitx_table_print_S_direct_reserved_aux:N #1
+\cs_new_protected:Npn \@@_table_print_S_direct_reserved_aux:N #1
{
\char_set_lccode:nn { `\@ } { `#1 }
\char_set_mathcode:nn { `#1 } { 32768 }
@@ -14999,23 +15005,23 @@ This work consists of the file siunitx.dtx
{
\c_math_toggle_token
\c_group_end_token
- \hbox_set_to_wd:Nnn \l_siunitx_table_post_box
- { \box_wd:N \l_siunitx_tmp_box }
+ \hbox_set_to_wd:Nnn \l_@@_table_post_box
+ { \box_wd:N \l_@@_tmp_box }
\c_group_begin_token
\c_math_toggle_token
- \l_siunitx_output_decimal_tl
+ \l_@@_output_decimal_tl
}
}
\char_set_catcode_letter:N \@
-\cs_new_protected:Npn \siunitx_table_print_S_direct_reserved_end:
+\cs_new_protected:Npn \@@_table_print_S_direct_reserved_end:
{
\c_math_toggle_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 }
+ \@@_table_align_left:n { \l_@@_table_number_align_skip }
+ \box_use:N \l_@@_table_pre_box
+ \box_use:N \l_@@_table_post_box
+ \@@_table_align_right:n { \l_@@_table_number_align_skip }
}
% \end{macrocode}
% \end{macro}
@@ -15048,11 +15054,11 @@ This work consists of the file siunitx.dtx
% problems. First, the symbols need to work in math and in text mode.
% Second, the user needs to be able to adjust each symbol.
%
-%\begin{macro}{\l_siunitx_redefine_symbols_bool}
+%\begin{macro}{\l_@@_redefine_symbols_bool}
% Only one setting applies here!
% \begin{macrocode}
\keys_define:nn { siunitx }
- { redefine-symbols .bool_set:N = \l_siunitx_redefine_symbols_bool }
+ { redefine-symbols .bool_set:N = \l_@@_redefine_symbols_bool }
\keys_set:nn { siunitx } { redefine-symbols = true }
% \end{macrocode}
%\end{macro}
@@ -15062,36 +15068,36 @@ This work consists of the file siunitx.dtx
% \begin{macrocode}
\AtBeginDocument
{
- \bool_if:NT \l_siunitx_redefine_symbols_bool
+ \bool_if:NT \l_@@_redefine_symbols_bool
{
\@ifpackageloaded { textcomp }
{
- \siunitx_option_unchanged:Nnn \l_siunitx_degree_math_tl
+ \@@_option_unchanged:Nnn \l_@@_degree_math_tl
{ { } ^ { \circ } }
{ \text { \textdegree } }
- \siunitx_option_unchanged:Nnn \l_siunitx_degree_text_tl
+ \@@_option_unchanged:Nnn \l_@@_degree_text_tl
{ \ensuremath { { } ^ { \circ } } }
{ \textdegree }
\@ifpackageloaded { mathptmx }
{ }
{
- \siunitx_option_unchanged:Nnn \l_siunitx_micro_text_tl
- { \c_siunitx_mu_tl }
+ \@@_option_unchanged:Nnn \l_@@_micro_text_tl
+ { \c_@@_mu_tl }
{ \textmu }
\@ifpackageloaded { fourier }
{ }
{
- \siunitx_option_unchanged:Nnn \l_siunitx_ohm_text_tl
- { \ensuremath { \c_siunitx_omega_tl } }
+ \@@_option_unchanged:Nnn \l_@@_ohm_text_tl
+ { \ensuremath { \c_@@_omega_tl } }
{ \textohm }
}
}
\str_if_eq:VnT \encodingdefault { OT1 }
{
- \siunitx_option_unchanged:Nnn \l_siunitx_angstrom_math_tl
+ \@@_option_unchanged:Nnn \l_@@_angstrom_math_tl
{ \text { \AA } }
{ \text { \capitalring { A } } }
- \siunitx_option_unchanged:Nnn \l_siunitx_angstrom_text_tl
+ \@@_option_unchanged:Nnn \l_@@_angstrom_text_tl
{ \AA }
{ \capitalring { A } }
}
@@ -15099,8 +15105,8 @@ This work consists of the file siunitx.dtx
{ }
\@ifpackageloaded { upgreek }
{
- \siunitx_option_unchanged:Nnn \l_siunitx_ohm_math_tl
- { \text { \ensuremath { \c_siunitx_omega_tl } } }
+ \@@_option_unchanged:Nnn \l_@@_ohm_math_tl
+ { \text { \ensuremath { \c_@@_omega_tl } } }
{ \Upomega }
}
{ }
@@ -15108,13 +15114,13 @@ This work consists of the file siunitx.dtx
}
% \end{macrocode}
%
-%\begin{macro}{\l_siunitx_angstrom_math_tl}
-%\begin{macro}{\l_siunitx_arcminute_math_tl}
-%\begin{macro}{\l_siunitx_arcsecond_math_tl}
-%\begin{macro}{\l_siunitx_celsius_math_tl}
-%\begin{macro}{\l_siunitx_degree_math_tl}
-%\begin{macro}{\l_siunitx_micro_math_tl}
-%\begin{macro}{\l_siunitx_ohm_math_tl}
+%\begin{macro}{\l_@@_angstrom_math_tl}
+%\begin{macro}{\l_@@_arcminute_math_tl}
+%\begin{macro}{\l_@@_arcsecond_math_tl}
+%\begin{macro}{\l_@@_celsius_math_tl}
+%\begin{macro}{\l_@@_degree_math_tl}
+%\begin{macro}{\l_@@_micro_math_tl}
+%\begin{macro}{\l_@@_ohm_math_tl}
% The symbol storage macros are created separately for math and text
% mode, although this is all pretty similar. The default definitions use
% what is generally available, except for those for micro, where
@@ -15123,13 +15129,13 @@ This work consists of the file siunitx.dtx
% deals with the case where \cs{mathnormal} has the wrong symbol.
% \begin{macrocode}
\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
+ math-angstrom .tl_set:N = \l_@@_angstrom_math_tl,
+ math-arcminute .tl_set:N = \l_@@_arcminute_math_tl,
+ math-arcsecond .tl_set:N = \l_@@_arcsecond_math_tl,
+ math-celsius .tl_set:N = \l_@@_celsius_math_tl,
+ math-degree .tl_set:N = \l_@@_degree_math_tl,
+ math-micro .tl_set:N = \l_@@_micro_math_tl,
+ math-ohm .tl_set:N = \l_@@_ohm_math_tl
}
\keys_set:nn { siunitx } {
math-angstrom = \text { \AA },
@@ -15137,8 +15143,8 @@ This work consists of the file siunitx.dtx
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 } },
+ math-micro = \text { \c_@@_mu_tl },
+ math-ohm = \text { \ensuremath { \c_@@_omega_tl } },
}
% \end{macrocode}
%\end{macro}
@@ -15148,23 +15154,23 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%\end{macro}
-%\begin{macro}{\l_siunitx_angstrom_text_tl}
-%\begin{macro}{\l_siunitx_arcminute_text_tl}
-%\begin{macro}{\l_siunitx_arcsecond_text_tl}
-%\begin{macro}{\l_siunitx_celsius_text_tl}
-%\begin{macro}{\l_siunitx_degree_text_tl}
-%\begin{macro}{\l_siunitx_micro_text_tl}
-%\begin{macro}{\l_siunitx_ohm_text_tl}
+%\begin{macro}{\l_@@_angstrom_text_tl}
+%\begin{macro}{\l_@@_arcminute_text_tl}
+%\begin{macro}{\l_@@_arcsecond_text_tl}
+%\begin{macro}{\l_@@_celsius_text_tl}
+%\begin{macro}{\l_@@_degree_text_tl}
+%\begin{macro}{\l_@@_micro_text_tl}
+%\begin{macro}{\l_@@_ohm_text_tl}
% Text versions are similar.
% \begin{macrocode}
\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,
+ text-angstrom .tl_set:N = \l_@@_angstrom_text_tl,
+ text-arcminute .tl_set:N = \l_@@_arcminute_text_tl,
+ text-arcsecond .tl_set:N = \l_@@_arcsecond_text_tl,
+ text-celsius .tl_set:N = \l_@@_celsius_text_tl,
+ text-degree .tl_set:N = \l_@@_degree_text_tl,
+ text-micro .tl_set:N = \l_@@_micro_text_tl,
+ text-ohm .tl_set:N = \l_@@_ohm_text_tl,
}
\keys_set:nn { siunitx } {
text-angstrom = \AA,
@@ -15173,8 +15179,8 @@ This work consists of the file siunitx.dtx
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 },
+ text-micro = \c_@@_mu_tl ,
+ text-ohm = \ensuremath { \c_@@_omega_tl },
}
% \end{macrocode}
%\end{macro}
@@ -15185,15 +15191,15 @@ This work consists of the file siunitx.dtx
%\end{macro}
%\end{macro}
%
-%\begin{macro}{\siunitx_symbol_new:n}
+%\begin{macro}{\@@_symbol_new:n}
% For creating the outer symbol macro.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_symbol_new:n #1 {
+\cs_new_protected:Npn \@@_symbol_new:n #1 {
\cs_set_protected: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 } } }
+ { \tl_to_lowercase:n { \use:c { l_@@_ #1 _math_tl } } }
+ { \tl_to_lowercase:n { \use:c { l_@@_ #1 _text_tl } } }
}
}
% \end{macrocode}
@@ -15208,13 +15214,13 @@ This work consists of the file siunitx.dtx
%\begin{macro}{\SIUnitSymbolOhm}
% The wrapper macros are created.
% \begin{macrocode}
-\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 }
+\@@_symbol_new:n { Angstrom }
+\@@_symbol_new:n { Arcminute }
+\@@_symbol_new:n { Arcsecond }
+\@@_symbol_new:n { Celsius }
+\@@_symbol_new:n { Degree }
+\@@_symbol_new:n { Micro }
+\@@_symbol_new:n { Ohm }
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -15226,12 +15232,12 @@ This work consists of the file siunitx.dtx
%
% \begin{variable}
% {
-% \c_siunitx_degree_int ,
-% \c_siunitx_micro_int ,
-% \c_siunitx_angstrom_int ,
-% \c_siunitx_ohm_int ,
-% \c_siunitx_arcminute_int,
-% \c_siunitx_arcsecond_int
+% \c_@@_degree_int ,
+% \c_@@_micro_int ,
+% \c_@@_angstrom_int ,
+% \c_@@_ohm_int ,
+% \c_@@_arcminute_int,
+% \c_@@_arcsecond_int
% }
% For UTF-8 engines, it may be possible to use better symbols than those set
% up as standard. Unicode normalises both the ohm and {\aa}ngstr{\"{o}}m
@@ -15246,49 +15252,49 @@ This work consists of the file siunitx.dtx
{
\@ifpackageloaded { fontspec }
{
- \int_const:Nn \c_siunitx_degree_int { 176 }
- \int_const:Nn \c_siunitx_micro_int { 181 }
- \int_const:Nn \c_siunitx_angstrom_int { 197 }
- \int_const:Nn \c_siunitx_ohm_int { 937 }
- \siunitx_option_unchanged:Nnn \l_siunitx_angstrom_math_tl
+ \int_const:Nn \c_@@_degree_int { 176 }
+ \int_const:Nn \c_@@_micro_int { 181 }
+ \int_const:Nn \c_@@_angstrom_int { 197 }
+ \int_const:Nn \c_@@_ohm_int { 937 }
+ \@@_option_unchanged:Nnn \l_@@_angstrom_math_tl
{ \text { \AA } }
- { \tex_char:D \c_siunitx_angstrom_int }
- \siunitx_option_unchanged:Nnn \l_siunitx_celsius_math_tl
+ { \tex_char:D \c_@@_angstrom_int }
+ \@@_option_unchanged:Nnn \l_@@_celsius_math_tl
{ { } ^ { \circ } \kern - \scriptspace \text { C } }
{
- \tex_char:D \c_siunitx_degree_int
+ \tex_char:D \c_@@_degree_int
C
}
- \siunitx_option_unchanged:Nnn \l_siunitx_degree_math_tl
+ \@@_option_unchanged:Nnn \l_@@_degree_math_tl
{ { } ^ { \circ } }
- { \tex_char:D \c_siunitx_degree_int }
- \siunitx_option_unchanged:Nnn \l_siunitx_micro_math_tl
- { \text { \c_siunitx_mu_tl } }
- { \tex_char:D \c_siunitx_micro_int }
- \siunitx_option_unchanged:Nnn \l_siunitx_ohm_math_tl
- { \text { \ensuremath { \c_siunitx_omega_tl } } }
- { \tex_char:D \c_siunitx_ohm_int }
- \siunitx_option_unchanged:Nnn \l_siunitx_angstrom_text_tl
+ { \tex_char:D \c_@@_degree_int }
+ \@@_option_unchanged:Nnn \l_@@_micro_math_tl
+ { \text { \c_@@_mu_tl } }
+ { \tex_char:D \c_@@_micro_int }
+ \@@_option_unchanged:Nnn \l_@@_ohm_math_tl
+ { \text { \ensuremath { \c_@@_omega_tl } } }
+ { \tex_char:D \c_@@_ohm_int }
+ \@@_option_unchanged:Nnn \l_@@_angstrom_text_tl
{ \AA }
- { \tex_char:D \c_siunitx_angstrom_int }
- \siunitx_option_unchanged:Nnn \l_siunitx_celsius_text_tl
+ { \tex_char:D \c_@@_angstrom_int }
+ \@@_option_unchanged:Nnn \l_@@_celsius_text_tl
{
\ensuremath
{ { } ^ { \circ } \kern - \scriptspace \text { C } }
}
{
- \tex_char:D \c_siunitx_degree_int
+ \tex_char:D \c_@@_degree_int
C
}
- \siunitx_option_unchanged:Nnn \l_siunitx_degree_text_tl
+ \@@_option_unchanged:Nnn \l_@@_degree_text_tl
{ \ensuremath { { } ^ { \circ } } }
- { \tex_char:D \c_siunitx_degree_int }
- \siunitx_option_unchanged:Nnn \l_siunitx_micro_text_tl
- { \c_siunitx_mu_tl }
- { \tex_char:D \c_siunitx_micro_int }
- \siunitx_option_unchanged:Nnn \l_siunitx_ohm_text_tl
- { \ensuremath { \c_siunitx_omega_tl } }
- { \tex_char:D \c_siunitx_ohm_int }
+ { \tex_char:D \c_@@_degree_int }
+ \@@_option_unchanged:Nnn \l_@@_micro_text_tl
+ { \c_@@_mu_tl }
+ { \tex_char:D \c_@@_micro_int }
+ \@@_option_unchanged:Nnn \l_@@_ohm_text_tl
+ { \ensuremath { \c_@@_omega_tl } }
+ { \tex_char:D \c_@@_ohm_int }
}
{ }
% \end{macrocode}
@@ -15297,20 +15303,20 @@ This work consists of the file siunitx.dtx
% \begin{macrocode}
\@ifpackageloaded { unicode-math }
{
- \int_const:Nn \c_siunitx_arcminute_int { 8242 }
- \int_const:Nn \c_siunitx_arcsecond_int { 8243 }
- \siunitx_option_unchanged:Nnn \l_siunitx_arcminute_math_tl
+ \int_const:Nn \c_@@_arcminute_int { 8242 }
+ \int_const:Nn \c_@@_arcsecond_int { 8243 }
+ \@@_option_unchanged:Nnn \l_@@_arcminute_math_tl
{ { } ^ { \prime } }
- { \ensuremath { \tex_char:D \c_siunitx_arcminute_int } }
- \siunitx_option_unchanged:Nnn \l_siunitx_arcsecond_math_tl
+ { \ensuremath { \tex_char:D \c_@@_arcminute_int } }
+ \@@_option_unchanged:Nnn \l_@@_arcsecond_math_tl
{ { } ^ { \prime \prime } }
- { \ensuremath { \tex_char:D \c_siunitx_arcsecond_int } }
- \siunitx_option_unchanged:Nnn \l_siunitx_arcminute_text_tl
+ { \ensuremath { \tex_char:D \c_@@_arcsecond_int } }
+ \@@_option_unchanged:Nnn \l_@@_arcminute_text_tl
{ \ensuremath { { } ^ { \prime } } }
- { \ensuremath { \tex_char:D \c_siunitx_arcminute_int } }
- \siunitx_option_unchanged:Nnn \l_siunitx_arcsecond_text_tl
+ { \ensuremath { \tex_char:D \c_@@_arcminute_int } }
+ \@@_option_unchanged:Nnn \l_@@_arcsecond_text_tl
{ \ensuremath { { } ^ { \prime \prime } } }
- { \ensuremath { \tex_char:D \c_siunitx_arcsecond_int } }
+ { \ensuremath { \tex_char:D \c_@@_arcsecond_int } }
}
{ }
}
@@ -15320,68 +15326,68 @@ This work consists of the file siunitx.dtx
%
%\subsection{Working with other packages}
%
-%\begin{macro}{\l_siunitx_pgf_link_clist}
-%\begin{macro}{\siunitx_pgf_link:}
+%\begin{macro}{\l_@@_pgf_link_clist}
+%\begin{macro}{\@@_pgf_link:}
% Here, the settings used by \pkg{siunitx} are translated into those for
% \pkg{pgf}. Things could be done more efficiently, but the logic would
% be more difficult to follow.
% \begin{macrocode}
-\clist_new:N \l_siunitx_pgf_link_clist
-\cs_new_protected:Npn \siunitx_pgf_link: {
- \clist_clear:N \l_siunitx_pgf_link_clist
- \str_if_eq:VnT \l_siunitx_round_tl { figure }
+\clist_new:N \l_@@_pgf_link_clist
+\cs_new_protected:Npn \@@_pgf_link: {
+ \clist_clear:N \l_@@_pgf_link_clist
+ \str_if_eq:VnT \l_@@_round_tl { figure }
{
- \clist_put_right:Nn \l_siunitx_pgf_link_clist { fixed }
- \clist_put_right:Nn \l_siunitx_pgf_link_clist
+ \clist_put_right:Nn \l_@@_pgf_link_clist { fixed }
+ \clist_put_right:Nn \l_@@_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
+ \clist_put_right:Nx \l_@@_pgf_link_clist
+ { precision = \int_use:N \l_@@_process_precision_int }
+ \clist_put_right:Nx \l_@@_pgf_link_clist
{
set~decimal~separator =
- { { \exp_not:V \l_siunitx_output_decimal_tl } }
+ { { \exp_not:V \l_@@_output_decimal_tl } }
}
- \clist_put_right:Nx \l_siunitx_pgf_link_clist
- { set~thousands~separator = { \exp_not:V \l_siunitx_group_sep_tl } }
- \clist_put_right:Nn \l_siunitx_pgf_link_clist
- { min~exponent~for~1000~sep = \int_use:N \l_siunitx_group_min_int }
+ \clist_put_right:Nx \l_@@_pgf_link_clist
+ { set~thousands~separator = { \exp_not:V \l_@@_group_sep_tl } }
+ \clist_put_right:Nn \l_@@_pgf_link_clist
+ { min~exponent~for~1000~sep = \int_use:N \l_@@_group_min_int }
\bool_if:nF
{
- \l_siunitx_group_decimal_bool ||
- \l_siunitx_group_integer_bool
+ \l_@@_group_decimal_bool ||
+ \l_@@_group_integer_bool
}
{
- \clist_put_right:Nn \l_siunitx_pgf_link_clist
+ \clist_put_right:Nn \l_@@_pgf_link_clist
{ min~exponent~for~1000~sep = 999 }
}
- \bool_if:NTF \l_siunitx_process_integer_zero_bool
+ \bool_if:NTF \l_@@_process_integer_zero_bool
{
- \clist_put_right:Nn \l_siunitx_pgf_link_clist
+ \clist_put_right:Nn \l_@@_pgf_link_clist
{ skip~0. = false }
}
{
- \clist_put_right:Nn \l_siunitx_pgf_link_clist
+ \clist_put_right:Nn \l_@@_pgf_link_clist
{ skip~0. = true }
}
- \str_if_eq:VnTF \l_siunitx_process_sign_tl { + }
+ \str_if_eq:VnTF \l_@@_process_sign_tl { + }
{
- \clist_put_right:Nn \l_siunitx_pgf_link_clist
+ \clist_put_right:Nn \l_@@_pgf_link_clist
{ showpos = true }
}
{
- \clist_put_right:Nn \l_siunitx_pgf_link_clist
+ \clist_put_right:Nn \l_@@_pgf_link_clist
{ showpos = false }
}
\group_begin:
- \cs_set:Npx \siunitx_tmp:w
+ \cs_set:Npx \@@_tmp:w
{
\group_end:
\exp_not:N \pgfqkeys
{ /pgf/number~format }
- { \exp_not:V \l_siunitx_pgf_link_clist }
+ { \exp_not:V \l_@@_pgf_link_clist }
}
- \siunitx_tmp:w
+ \@@_tmp:w
}
% \end{macrocode}
%\end{macro}
@@ -15553,25 +15559,25 @@ This work consists of the file siunitx.dtx
% Basically, a set of shuffles for arguments.
% \begin{macrocode}
\NewDocumentCommand \DeclareBinaryPrefix { m m m } {
- \siunitx_declare_prefix:Nnnn #1 {#2} { 2 } {#3}
+ \@@_declare_prefix:Nnnn #1 {#2} { 2 } {#3}
}
\NewDocumentCommand \DeclareSIPostPower { m m } {
- \siunitx_declare_power_after:Nn #1 {#2}
+ \@@_declare_power_after:Nn #1 {#2}
}
\NewDocumentCommand \DeclareSIPrefix { m m m } {
- \siunitx_declare_prefix:Nnnn #1 {#2} { 10 } {#3}
+ \@@_declare_prefix:Nnnn #1 {#2} { 10 } {#3}
}
\NewDocumentCommand \DeclareSIPrePower { m m } {
- \siunitx_declare_power_before:Nn #1 {#2}
+ \@@_declare_power_before:Nn #1 {#2}
}
\NewDocumentCommand \DeclareSIQualifier { m m } {
- \siunitx_declare_qualifier:Nn #1 {#2}
+ \@@_declare_qualifier:Nn #1 {#2}
}
\NewDocumentCommand \DeclareSIUnit { O { } m m } {
- \siunitx_declare_unit:Nnn #2 {#3} {#1}
+ \@@_declare_unit:Nnn #2 {#3} {#1}
}
\NewDocumentCommand \DeclareSIUnitWithOptions { m m m } {
- \siunitx_declare_unit:Nnn #1 {#2} {#3}
+ \@@_declare_unit:Nnn #1 {#2} {#3}
}
% \end{macrocode}
%\end{macro}
@@ -15596,7 +15602,7 @@ This work consists of the file siunitx.dtx
%\begin{macro}{\SendSettingsToPgf}
% A settings transfer function.
% \begin{macrocode}
-\cs_new_protected:Npn \SendSettingsToPgf { \siunitx_pgf_link: }
+\cs_new_protected:Npn \SendSettingsToPgf { \@@_pgf_link: }
% \end{macrocode}
%\end{macro}
%
@@ -15612,7 +15618,7 @@ This work consists of the file siunitx.dtx
\group_begin:
\IfNoValueF {#1}
{ \keys_set:nn { siunitx } {#1} }
- \siunitx_angle_output:nnn #2
+ \@@_angle_output:nnn #2
\group_end:
}
% \end{macrocode}
@@ -15627,7 +15633,7 @@ This work consists of the file siunitx.dtx
\group_begin:
\IfNoValueF {#1}
{ \keys_set:nn { siunitx } {#1} }
- \siunitx_number_output:n {#2}
+ \@@_number_output:n {#2}
\group_end:
}
% \end{macrocode}
@@ -15641,7 +15647,7 @@ This work consists of the file siunitx.dtx
\group_begin:
\IfNoValueF {#1}
{ \keys_set:nn { siunitx } {#1} }
- \siunitx_list_numbers:n {#2}
+ \@@_list_numbers:n {#2}
\group_end:
}
% \end{macrocode}
@@ -15656,7 +15662,7 @@ This work consists of the file siunitx.dtx
\group_begin:
\IfNoValueF {#1}
{ \keys_set:nn { siunitx } {#1} }
- \siunitx_range_numbers:nn {#2} {#3}
+ \@@_range_numbers:nn {#2} {#3}
\group_end:
}
% \end{macrocode}
@@ -15675,10 +15681,10 @@ This work consists of the file siunitx.dtx
\leavevmode
\group_begin:
\IfNoValueTF {#1}
- { \siunitx_list_units:nnn {#2} {#3} { } }
+ { \@@_list_units:nnn {#2} {#3} { } }
{
\keys_set:nn { siunitx } {#1}
- \siunitx_list_units:nnn {#2} {#3} {#1}
+ \@@_list_units:nnn {#2} {#3} {#1}
}
\group_end:
}
@@ -15686,10 +15692,10 @@ This work consists of the file siunitx.dtx
\leavevmode
\group_begin:
\IfNoValueTF {#1}
- { \siunitx_range_unit:nnnn {#4} { } {#2} {#3} }
+ { \@@_range_unit:nnnn {#4} { } {#2} {#3} }
{
\keys_set:nn { siunitx } {#1}
- \siunitx_range_unit:nnnn {#4} {#1} {#2} {#3}
+ \@@_range_unit:nnnn {#4} {#1} {#2} {#3}
}
\group_end:
}
@@ -15704,10 +15710,10 @@ This work consists of the file siunitx.dtx
\leavevmode
\group_begin:
\IfNoValueTF {#1}
- { \siunitx_combined:nnnn { } {#2} {#3} {#4} }
+ { \@@_combined:nnnn { } {#2} {#3} {#4} }
{
\keys_set:nn { siunitx } {#1}
- \siunitx_combined:nnnn {#1} {#2} {#3} {#4}
+ \@@_combined:nnnn {#1} {#2} {#3} {#4}
}
\group_end:
}
@@ -15734,13 +15740,13 @@ This work consists of the file siunitx.dtx
\leavevmode
\IfNoValueF {#1}
{ \keys_set:nn { siunitx } {#1} }
- \bool_if:NTF \l_siunitx_number_parse_bool
+ \bool_if:NTF \l_@@_number_parse_bool
{
- \tl_set:Nn \l_siunitx_table_collect_tl {#2}
- \bool_set_false:N \l_siunitx_table_collect_pre_bool
- \siunitx_table_print_S:
+ \tl_set:Nn \l_@@_table_collect_tl {#2}
+ \bool_set_false:N \l_@@_table_collect_pre_bool
+ \@@_table_print_S:
}
- { \siunitx_table_print_S_direct: #2 \siunitx_table_print: }
+ { \@@_table_print_S_direct: #2 \@@_table_print: }
}
% \end{macrocode}
%\end{macro}
@@ -15754,10 +15760,10 @@ This work consists of the file siunitx.dtx
\leavevmode
\group_begin:
\IfNoValueTF {#1}
- { \siunitx_unit_output:nn {#2} { } }
+ { \@@_unit_output:nn {#2} { } }
{
\keys_set:nn { siunitx } {#1}
- \siunitx_unit_output:nn {#2} {#1}
+ \@@_unit_output:nn {#2} {#1}
}
\group_end:
}
@@ -15772,7 +15778,7 @@ This work consists of the file siunitx.dtx
% \pkg{hyperref}, and ensure that everything works cleanly and with
% no unnecessary warnings.
%
-% \begin{macro}{\siunitx_contents_add:N}
+% \begin{macro}{\@@_contents_add:N}
% An updated version of \cs{addtocontents} which will ensure that
% everything works properly. Using \cs{token_to_str:N} means that
% there is no problem with the asynchronous nature of \TeX{}'s writing
@@ -15787,13 +15793,13 @@ This work consists of the file siunitx.dtx
\cs_set_eq:NN \label \use_none:n
\cs_set_eq:NN \index \use_none:n
\cs_set_eq:NN \glossary \use_none:n
- \seq_map_inline:Nn \l_siunitx_declare_list_seq
- { \siunitx_contents_add:N ##1 }
+ \seq_map_inline:Nn \l_@@_declare_list_seq
+ { \@@_contents_add:N ##1 }
}
{ \token_to_str:N \@writefile {#1} {#2} }
}
}
-\cs_new_protected:Npn \siunitx_contents_add:N #1
+\cs_new_protected:Npn \@@_contents_add:N #1
{
\cs_set:Npn #1
{
@@ -15804,7 +15810,7 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\siunitx_contents_bookmarks:}
+% \begin{macro}{\@@_contents_bookmarks:}
% The idea here is two-fold. First, all of the unit macros are set
% up to simply print their literal interpretation: this is hopefully
% good enough for most bookmark situations. Secondly, the document
@@ -15812,18 +15818,18 @@ This work consists of the file siunitx.dtx
% of the input, removes any set up options (which are being ignored)
% and stops \pkg{hyperref} issuing a warning.
% \begin{macrocode}
-\cs_new_protected:Npn \siunitx_contents_bookmarks:
+\cs_new_protected:Npn \@@_contents_bookmarks:
{
- \seq_map_inline:Nn \l_siunitx_declare_list_seq
- { \siunitx_unit_print_literal_aux:N ##1 }
+ \seq_map_inline:Nn \l_@@_declare_list_seq
+ { \@@_unit_print_literal_aux:N ##1 }
\msg_redirect_name:nnn { 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_eq:NN \si \siunitx_bookmark_si:w
- \cs_set_eq:NN \siunitx_textsuperscript:n \use:n
+ \cs_set_eq:NN \num \@@_bookmark_num:w
+ \cs_set_eq:NN \numrange \@@_bookmark_numrange:w
+ \cs_set_eq:NN \si \@@_bookmark_si:w
+ \cs_set_eq:NN \SI \@@_bookmark_SI:w
+ \cs_set_eq:NN \SIrange \@@_bookmark_SIrange:w
+ \cs_set_eq:NN \si \@@_bookmark_si:w
+ \cs_set_eq:NN \@@_textsuperscript:n \use:n
\cs_set:Npn \SIUnitSymbolAngstrom { \AA }
\cs_set:Npn \SIUnitSymbolArcminute { ' }
\cs_set:Npn \SIUnitSymbolArcsecond { '' }
@@ -15837,49 +15843,49 @@ This work consists of the file siunitx.dtx
%
% \begin{macro}
% {
-% \siunitx_bookmark_num:w ,
-% \siunitx_bookmark_numrange:w ,
-% \siunitx_bookmark_SIlist:w ,
-% \siunitx_bookmark_SIrange:w ,
-% \siunitx_bookmark_SI:w ,
-% \siunitx_bookmark_si:w
+% \@@_bookmark_num:w ,
+% \@@_bookmark_numrange:w ,
+% \@@_bookmark_SIlist:w ,
+% \@@_bookmark_SIrange:w ,
+% \@@_bookmark_SI:w ,
+% \@@_bookmark_si:w
% }
% To keep things fast, expandable versions of the document commands
% are created only once. These are then used if necessary to remove
% and re-order arguments in an expandable fashion.
% \begin{macrocode}
-\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 o m }
+\DeclareExpandableDocumentCommand \@@_bookmark_num:w { o m } {#2}
+\DeclareExpandableDocumentCommand \@@_bookmark_numrange:w { o m m }
+ { #2 \l_@@_range_phrase_tl #3 }
+\DeclareExpandableDocumentCommand \@@_bookmark_SI:w { o m o m }
{ \IfNoValueF {#3} {#3} #2 ~ #4 }
-\DeclareExpandableDocumentCommand \siunitx_bookmark_SIlist:w
- { o m m } { \siunitx_bookmark_SIlist_map:nn {#1} {#2} }
-\DeclareExpandableDocumentCommand \siunitx_bookmark_SIrange:w
- { o m m m } { #2 ~ #4 \l_siunitx_range_phrase_tl #3 ~ #4 }
-\DeclareExpandableDocumentCommand \siunitx_bookmark_si:w { o m } {#2}
+\DeclareExpandableDocumentCommand \@@_bookmark_SIlist:w
+ { o m m } { \@@_bookmark_SIlist_map:nn {#1} {#2} }
+\DeclareExpandableDocumentCommand \@@_bookmark_SIrange:w
+ { o m m m } { #2 ~ #4 \l_@@_range_phrase_tl #3 ~ #4 }
+\DeclareExpandableDocumentCommand \@@_bookmark_si:w { o m } {#2}
% \end{macrocode}
% \end{macro}
%
-%\begin{macro}{\siunitx_bookmark_SIlist_map:nn}
-%\begin{macro}[aux]{\siunitx_bookmark_SIlist_map_aux:nw}
+%\begin{macro}{\@@_bookmark_SIlist_map:nn}
+%\begin{macro}[aux]{\@@_bookmark_SIlist_map_aux:nw}
% An expandable mapping to replace the list separator in the
% input by appropriate output version.
% \begin{macrocode}
-\cs_new:Npn \siunitx_bookmark_SIlist_map:nn #1#2 {
- \siunitx_bookmark_SIlist_map_aux:nw {#2} #1 ; \q_recursion_tail ;
+\cs_new:Npn \@@_bookmark_SIlist_map:nn #1#2 {
+ \@@_bookmark_SIlist_map_aux:nw {#2} #1 ; \q_recursion_tail ;
\q_recursion_tail ; \q_recursion_stop
}
-\cs_new:Npn \siunitx_bookmark_SIlist_map_aux:nw #1#2 ; #3 ; #4 {
+\cs_new:Npn \@@_bookmark_SIlist_map_aux:nw #1#2 ; #3 ; #4 {
#2 ~ #1
\quark_if_recursion_tail_stop:n {#3}
\quark_if_recursion_tail_stop_do:nn {#4}
{
- \l_siunitx_list_separator_final_tl
+ \l_@@_list_separator_final_tl
#3 ~ #1
}
- \l_siunitx_list_separator_tl
- \siunitx_bookmark_SIlist_map_aux:nw {#1} #3 ; #4
+ \l_@@_list_separator_tl
+ \@@_bookmark_SIlist_map_aux:nw {#1} #3 ; #4
}
% \end{macrocode}
%\end{macro}
@@ -15889,7 +15895,7 @@ This work consists of the file siunitx.dtx
% \begin{macrocode}
\AtBeginDocument {
\@ifpackageloaded { hyperref }
- { \pdfstringdefDisableCommands { \siunitx_contents_bookmarks: } }
+ { \pdfstringdefDisableCommands { \@@_contents_bookmarks: } }
{ }
}
% \end{macrocode}
@@ -16224,8 +16230,8 @@ This work consists of the file siunitx.dtx
%
%\subsection{Strict application of the rules}
%
-%\begin{macro}{\siunitx_strict_option:n}
-%\begin{macro}[aux]{\siunitx_strict_option_aux:n}
+%\begin{macro}{\@@_strict_option:n}
+%\begin{macro}[aux]{\@@_strict_option_aux:n}
% When sticking to the rules closely, a few options are not available.
% \begin{macrocode}
\keys_define:nn { siunitx } {
@@ -16243,7 +16249,7 @@ This work consists of the file siunitx.dtx
parse-units = true,
product-units = repeat
}
- \siunitx_strict_option:n
+ \@@_strict_option:n
{
bracket-numbers ,
detect-family ,
@@ -16266,11 +16272,11 @@ This work consists of the file siunitx.dtx
}
}
}
-\siunitx_option_deactivate:n { strict }
-\cs_new_protected:Npn \siunitx_strict_option:n #1 {
- \clist_map_function:nN {#1} \siunitx_strict_option_aux:n
+\@@_option_deactivate:n { strict }
+\cs_new_protected:Npn \@@_strict_option:n #1 {
+ \clist_map_function:nN {#1} \@@_strict_option_aux:n
}
-\cs_new_protected:Npn \siunitx_strict_option_aux:n #1 {
+\cs_new_protected:Npn \@@_strict_option_aux:n #1 {
\keys_define:nn { siunitx }
{ #1 .code:n =
{ \msg_warning:nnx { siunitx } { option-not-available } {#1} }
@@ -16348,15 +16354,15 @@ This work consists of the file siunitx.dtx
%
% \subsection{Loading additional configurations}
%
-% \begin{variable}{\c_siunitx_configuration_ext_tl}
+% \begin{variable}{\c_@@_configuration_ext_tl}
% Logical mark-up for the file extension.
% \begin{macrocode}
-\tl_const:Nn \c_siunitx_configuration_ext_tl { cfg }
+\tl_const:Nn \c_@@_configuration_ext_tl { cfg }
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\siunitx_load_abbreviations:}
-% \begin{macro}{\siunitx_load_binary:}
+% \begin{macro}{\@@_load_abbreviations:}
+% \begin{macro}{\@@_load_binary:}
% Loading abbreviations is on by default, which therefore requires a bit
% of juggling. The idea here is that the abbreviations will be loaded unless
% specifically turned off. This can occur anywhere in the preamble.
@@ -16365,34 +16371,35 @@ This work consists of the file siunitx.dtx
{
abbreviations .choice:,
abbreviations /
- true .code:n = { \siunitx_load_abbreviations: },
+ true .code:n = { \@@_load_abbreviations: },
abbreviations /
false .code:n =
- { \cs_set_eq:NN \siunitx_load_abbreviations: \prg_do_nothing: } ,
+ { \cs_set_eq:NN \@@_load_abbreviations: \prg_do_nothing: } ,
abbreviations .default:n = true ,
binary-units .choice:,
binary-units /
- true .code:n = { \siunitx_load_binary: },
+ true .code:n = { \@@_load_binary: },
binary-units /
- false .code:n = { } ,
+ false .code:n =
+ { \cs_set_eq:NN \@@_load_binary: \prg_do_nothing: } ,
binary-units .default:n = true
}
-\cs_new_protected:Npn \siunitx_load_abbreviations:
+\cs_new_protected_nopar:Npn \@@_load_abbreviations:
{
\@onefilewithoptions { siunitx-abbreviations } [ ] [ ]
- \c_siunitx_configuration_ext_tl
+ \c_@@_configuration_ext_tl
}
-\cs_new_protected:Npn \siunitx_load_binary:
+\cs_new_protected_nopar:Npn \@@_load_binary:
{
\@onefilewithoptions { siunitx-binary } [ ] [ ]
- \c_siunitx_configuration_ext_tl
+ \c_@@_configuration_ext_tl
}
\AtBeginDocument
{
- \siunitx_load_abbreviations:
- \siunitx_load_binary:
+ \@@_load_abbreviations:
+ \@@_load_binary:
}
-\siunitx_option_deactivate:n { abbreviations , binary }
+\@@_option_deactivate:n { abbreviations , binary }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -16406,13 +16413,13 @@ This work consists of the file siunitx.dtx
true .code:n =
{
\@onefilewithoptions { siunitx-version-1 } [ ] [ ]
- \c_siunitx_configuration_ext_tl
+ \c_@@_configuration_ext_tl
},
version-1-compatibility /
false .code:n = { } ,
version-1-compatibility .default:n = true
}
-\siunitx_option_deactivate:n { version-1-compatibility }
+\@@_option_deactivate:n { version-1-compatibility }
% \end{macrocode}
%
% Dealing with the old \opt{load-configurations} option is pretty easy, as
@@ -16424,28 +16431,28 @@ This work consists of the file siunitx.dtx
\clist_if_in:nnT {#1} { version-1 }
{
\@onefilewithoptions { siunitx-version-1 } [ ] [ ]
- \c_siunitx_configuration_ext_tl
+ \c_@@_configuration_ext_tl
}
}
}
-\siunitx_option_deactivate:n { load-configurations }
+\@@_option_deactivate:n { load-configurations }
% \end{macrocode}
%
% Load any local configuration file.
% \begin{macrocode}
-\file_if_exist:nT { siunitx . \c_siunitx_configuration_ext_tl }
+\file_if_exist:nT { siunitx . \c_@@_configuration_ext_tl }
{
\@onefilewithoptions { siunitx } [ ] [ ]
- \c_siunitx_configuration_ext_tl
+ \c_@@_configuration_ext_tl
}
% \end{macrocode}
%
% The master control macro which occurs at the start of the document.
% \begin{macrocode}
\AtBeginDocument {
- \bool_if:NTF \l_siunitx_create_free_bool
- { \siunitx_unit_create_functions: }
- { \siunitx_unit_create_empty_functions: }
+ \bool_if:NTF \l_@@_create_free_bool
+ { \@@_unit_create_functions: }
+ { \@@_unit_create_empty_functions: }
}
% \end{macrocode}
%
@@ -16465,7 +16472,7 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplFile {siunitx-version-1.cfg} {2012/06/13} {2.5e}
+\ProvidesExplFile {siunitx-version-1.cfg} {2012/07/22} {2.5g}
{siunitx: Version 1 settings}
% \end{macrocode}
%
@@ -17172,7 +17179,7 @@ This work consists of the file siunitx.dtx
% The functions for creating qualifiers are easy to create again.
% \begin{macrocode}
\NewDocumentCommand \newqualifier { m m } {
- \siunitx_declare_qualifier:Nn #1 {#2}
+ \@@_declare_qualifier:Nn #1 {#2}
}
\cs_new_eq:NN \renewqualifier \newqualifier
\cs_new_eq:NN \providequalifier \newqualifier
@@ -17410,7 +17417,7 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/06/13} {2.5e}
+\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/07/22} {2.5g}
{siunitx: Abbreviated units}
% \end{macrocode}
%
@@ -17592,7 +17599,7 @@ This work consists of the file siunitx.dtx
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplFile {siunitx-binary.cfg} {2012/06/13} {2.5e}
+\ProvidesExplFile {siunitx-binary.cfg} {2012/07/22} {2.5g}
{siunitx: Binary units}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.ins b/Master/texmf-dist/source/latex/siunitx/siunitx.ins
index 3010645a30b..3baec495005 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.ins
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.ins
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ---------------------------------------------------------------
%%
-\input docstrip.tex
+\input l3docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble