From 1b5aa0794f701aa855c0dd5aafc06a49ec40be37 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 4 May 2012 23:47:51 +0000 Subject: siunitx (4may12) git-svn-id: svn://tug.org/texlive/trunk@26194 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | Bin 576521 -> 576529 bytes Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 65 +++++++++++++-------- .../latex/siunitx/config/siunitx-abbreviations.cfg | 2 +- .../tex/latex/siunitx/config/siunitx-binary.cfg | 2 +- .../tex/latex/siunitx/config/siunitx-version-1.cfg | 2 +- Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 55 ++++++++++------- 6 files changed, 78 insertions(+), 48 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf index 775bf277d84..eb5e1184e40 100644 Binary files a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf and b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf differ diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 1d5a5d135d2..97dfb15c5a8 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -582,6 +582,9 @@ This work consists of the file siunitx.dtx % in literal units when \pkg{breqn} package is loaded} %\changes{v2.5b}{2012/04/20}{Detect \pkg{eulervm} package and alter % math mode font setting accordingly} +%\changes{v2.5c}{2012/04/03}{Allow conversion of numbers with more than +% nine digits when using fixed exponents} +%\changes{v2.5c}{2012/05/03}{Detect entirely empty cells in \texttt{s} columns} % %\begin{abstract} % Physical quantities have both numbers and units, and each physical @@ -5075,7 +5078,7 @@ This work consists of the file siunitx.dtx % % The usual preliminaries. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2012/04/21} {2.5b} +\ProvidesExplPackage {siunitx} {2012/05/03} {2.5c} {A comprehensive (SI) units package} % \end{macrocode} % @@ -8060,6 +8063,7 @@ This work consists of the file siunitx.dtx %\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 , @@ -8100,26 +8104,38 @@ This work consists of the file siunitx.dtx % 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 + { + \prop_put:Nnn \l_siunitx_number_in_prop { exponent } { true } + \int_compare:nNnTF { \l_siunitx_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: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 } { - } + } + \siunitx_number_process_fixed_aux_ii:nnn {#1} {#2} {#3} + } +\cs_new_protected:Npn \siunitx_number_process_fixed_aux_ii:nnn #1#2#3 + { + \bool_set_true:N \l_siunitx_tmp_bool + \tl_map_inline:nn {#1#2} + { + \str_if_eq:nnF {##1} { 0 } + { + \bool_set_false:N \l_siunitx_tmp_bool + \tl_map_break: + } + } + \bool_if:NF \l_siunitx_tmp_bool + { \siunitx_number_process_fixed_aux_iii:nnn {#1} {#2} {#3} } + } \cs_new_protected:Npn - \siunitx_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: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: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 } { - } - } - \int_compare:nNnF { #1 + 0 #2 } = { 0 } - { \siunitx_number_process_fixed_aux_ii:nnn {#1} {#2} {#3} } -} -\cs_new_protected:Npn - \siunitx_number_process_fixed_aux_ii:nnn #1#2#3 { + \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} } { @@ -13689,7 +13705,8 @@ This work consists of the file siunitx.dtx \cs_new_protected:Npn \siunitx_table_print_s: { \siunitx_table_column_begin:n { \l_siunitx_table_unit_align_skip } - \siunitx_unit_output:Vn \l_siunitx_table_collect_tl { } + \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 } } % \end{macrocode} @@ -16403,7 +16420,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-version-1.cfg} {2012/04/21} {2.5b} +\ProvidesExplFile {siunitx-version-1.cfg} {2012/05/03} {2.5c} {siunitx: Version 1 settings} % \end{macrocode} % @@ -17348,7 +17365,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/04/21} {2.5b} +\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/05/03} {2.5c} {siunitx: Abbreviated units} % \end{macrocode} % @@ -17530,7 +17547,7 @@ This work consists of the file siunitx.dtx % \end{macrocode} % % \begin{macrocode} -\ProvidesExplFile {siunitx-binary.cfg} {2012/04/21} {2.5b} +\ProvidesExplFile {siunitx-binary.cfg} {2012/05/03} {2.5c} {siunitx: Binary units} % \end{macrocode} % diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg index dc813a21333..11d17a80cc8 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviations.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/04/21} {2.5b} +\ProvidesExplFile {siunitx-abbreviations.cfg} {2012/05/03} {2.5c} {siunitx: Abbreviated units} \DeclareSIUnit \A { \ampere } \DeclareSIUnit \pA { \pico \ampere } diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg index f2e76e93aa1..ebca64c0c6e 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-binary.cfg} {2012/04/21} {2.5b} +\ProvidesExplFile {siunitx-binary.cfg} {2012/05/03} {2.5c} {siunitx: Binary units} \DeclareBinaryPrefix \kibi { Ki } { 10 } \DeclareBinaryPrefix \mebi { Mi } { 20 } diff --git a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg index 143b2889919..820967ab99c 100644 --- a/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg +++ b/Master/texmf-dist/tex/latex/siunitx/config/siunitx-version-1.cfg @@ -13,7 +13,7 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\ProvidesExplFile {siunitx-version-1.cfg} {2012/04/21} {2.5b} +\ProvidesExplFile {siunitx-version-1.cfg} {2012/05/03} {2.5c} {siunitx: Version 1 settings} \keys_define:nn { siunitx } { addsign .choice: , diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index b80d7e078c5..e729c455ff9 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -14,7 +14,7 @@ %% --------------------------------------------------------------- %% \RequirePackage{expl3} -\ProvidesExplPackage {siunitx} {2012/04/21} {2.5b} +\ProvidesExplPackage {siunitx} {2012/05/03} {2.5c} {A comprehensive (SI) units package} \@ifpackagelater { expl3 } { 2011/09/05 } { } @@ -1990,26 +1990,38 @@ \l_siunitx_tmpa_tl } } +\cs_new_protected:Npn \siunitx_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: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: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 } { - } + } + \siunitx_number_process_fixed_aux_ii:nnn {#1} {#2} {#3} + } +\cs_new_protected:Npn \siunitx_number_process_fixed_aux_ii:nnn #1#2#3 + { + \bool_set_true:N \l_siunitx_tmp_bool + \tl_map_inline:nn {#1#2} + { + \str_if_eq:nnF {##1} { 0 } + { + \bool_set_false:N \l_siunitx_tmp_bool + \tl_map_break: + } + } + \bool_if:NF \l_siunitx_tmp_bool + { \siunitx_number_process_fixed_aux_iii:nnn {#1} {#2} {#3} } + } \cs_new_protected:Npn - \siunitx_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: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: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 } { - } - } - \int_compare:nNnF { #1 + 0 #2 } = { 0 } - { \siunitx_number_process_fixed_aux_ii:nnn {#1} {#2} {#3} } -} -\cs_new_protected:Npn - \siunitx_number_process_fixed_aux_ii:nnn #1#2#3 { + \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} } { @@ -5751,7 +5763,8 @@ \cs_new_protected:Npn \siunitx_table_print_s: { \siunitx_table_column_begin:n { \l_siunitx_table_unit_align_skip } - \siunitx_unit_output:Vn \l_siunitx_table_collect_tl { } + \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 } } \prop_new:N \l_siunitx_table_model_prop -- cgit v1.2.3