diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-20 20:17:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-20 20:17:51 +0000 |
commit | 5d4d6e312887e7c62c64d35f26f62f135998afa9 (patch) | |
tree | 5cdafd396e4a508472cb363f360c639d5e5dd6ae /Master/texmf-dist/tex/latex/siunitx | |
parent | 7f67c7c0b66228ec6cdb3c7e8c42b50a5ad40105 (diff) |
siunitx (20may21)
git-svn-id: svn://tug.org/texlive/trunk@59279 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/siunitx')
-rw-r--r-- | Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 112 |
1 files changed, 86 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index e8760fb6dfe..f4640b447d5 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -42,7 +42,7 @@ }% \endinput }% -\ProvidesExplPackage {siunitx} {2021-05-18} {3.0.1} +\ProvidesExplPackage {siunitx} {2021-05-19} {3.0.2} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -3057,11 +3057,9 @@ \cs_new:Npn \__siunitx_number_output_sign_color:w #1 \__siunitx_number_output_end: { - \exp_not:N \textcolor { \exp_not:V \l__siunitx_number_negative_color_tl } - { - #1 - \__siunitx_number_output_end: - } + \exp_not:N \color { \exp_not:V \l__siunitx_number_negative_color_tl } + #1 + \__siunitx_number_output_end: } \cs_new:Npn \__siunitx_number_output_sign_brackets:w #1 \__siunitx_number_output_end: @@ -3868,14 +3866,22 @@ { \unskip { \__siunitx_table_collect_loop: } \end { \tabularnewline \end } - \relax { \relax } + \relax { \__siunitx_table_collect_relax:N #1 } \tabularnewline { \tabularnewline } \siunitx_cell_end: { \siunitx_cell_end: } } - { - \tl_put_right:Nn \l__siunitx_table_collect_tl {#1} - \__siunitx_table_collect_loop: - } + { \__siunitx_table_collect_token_aux:N #1 } + } +\cs_new_protected:Npn \__siunitx_table_collect_token_aux:N #1 + { + \tl_put_right:Nn \l__siunitx_table_collect_tl {#1} + \__siunitx_table_collect_loop: + } +\cs_new_protected:Npn \__siunitx_table_collect_relax:N #1 + { + \str_if_eq:nnTF {#1} { \relax } + { \relax } + { \__siunitx_table_collect_token_aux:N #1 } } \AtBeginDocument { @@ -3889,14 +3895,11 @@ \tab@setcr { \__siunitx_table_collect_loop: } \unskip { \__siunitx_table_collect_loop: } \end { \tabularnewline \end } - \relax { \relax } + \relax { \__siunitx_table_collect_relax:N #1 } \tabularnewline { \tabularnewline } \siunitx_cell_end: { \siunitx_cell_end: } } - { - \tl_put_right:Nn \l__siunitx_table_collect_tl {#1} - \__siunitx_table_collect_loop: - } + { \__siunitx_table_collect_token_aux:N #1 } } } { } @@ -4062,12 +4065,21 @@ { #1#2#3#4#5#6#7 } \cs_new_protected:Npn \__siunitx_table_center_marker: { + \hbox_set:Nn \l__siunitx_table_tmp_box + { \ensuremath { \mathord { \l_siunitx_number_output_decimal_tl } } } \dim_compare:nNnTF { \box_wd:N \l__siunitx_table_integer_box } - > { \box_wd:N \l__siunitx_table_decimal_box } + > + { + \box_wd:N \l__siunitx_table_decimal_box + - \box_wd:N \l__siunitx_table_tmp_box + } { \hbox_set_to_wd:Nnn \l__siunitx_table_decimal_box - { \box_wd:N \l__siunitx_table_integer_box } + { + \box_wd:N \l__siunitx_table_integer_box + + \box_wd:N \l__siunitx_table_tmp_box + } { \hbox_unpack:N \l__siunitx_table_decimal_box \__siunitx_table_fil: @@ -4075,7 +4087,10 @@ } { \hbox_set_to_wd:Nnn \l__siunitx_table_integer_box - { \box_wd:N \l__siunitx_table_decimal_box } + { + \box_wd:N \l__siunitx_table_decimal_box + - \box_wd:N \l__siunitx_table_tmp_box + } { \__siunitx_table_fil: \hbox_unpack:N \l__siunitx_table_integer_box @@ -4211,8 +4226,11 @@ \c_math_toggle_token \hbox_set_end: \__siunitx_table_center_marker: - \box_use_drop:N \l__siunitx_table_integer_box - \box_use_drop:N \l__siunitx_table_decimal_box + \use:c { __siunitx_table_align_ \l__siunitx_table_align_text_tl :n } + { + \box_use_drop:N \l__siunitx_table_integer_box + \box_use_drop:N \l__siunitx_table_decimal_box + } } \cs_new_protected:Npn \__siunitx_table_direct_format: { @@ -4329,8 +4347,11 @@ { \__siunitx_table_print_marker_aux:w #4 } } \__siunitx_table_center_marker: - \box_use_drop:N \l__siunitx_table_integer_box - \box_use_drop:N \l__siunitx_table_decimal_box + \use:c { __siunitx_table_align_ \l__siunitx_table_align_text_tl :n } + { + \box_use_drop:N \l__siunitx_table_integer_box + \box_use_drop:N \l__siunitx_table_decimal_box + } } \cs_new:Npn \__siunitx_table_print_marker_aux:w #1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_nil #7 \q_nil @@ -6035,6 +6056,8 @@ } } } +\keys_set:nn { siunitx } + { product-symbol = \ifmmode \times \else \texttimes \fi } \AtBeginDocument { \group_begin: @@ -6049,12 +6072,36 @@ \keys_set:nn { siunitx } { exponent-product = - \ifmmode \times \else \texttimes \fi , - product-symbol = \ifmmode \times \else \texttimes \fi } } - { \group_end: } + { + \tl_set:Nn \l__siunitx_symbol_tmpb_tl { 2 \cdot 10 ^ { 1 } } + \tl_if_eq:NNTF \l__siunitx_symbol_tmpa_tl \l__siunitx_symbol_tmpb_tl + { + \group_end: + \keys_set:nn { siunitx } + { + exponent-product = + \ifmmode \cdot \else \textperiodcentered \fi + } + } + { \group_end: } + } + \group_begin: + \tl_set:Nn \l__siunitx_symbol_tmpa_tl { \mathrm { m } \cdot \mathrm { s } } + \tl_set:Nn \l_siunitx_unit_font_tl { \mathrm } + \siunitx_unit_format:nN { m . s } \l__siunitx_symbol_tmpb_tl + \tl_if_eq:NNTF \l__siunitx_symbol_tmpa_tl \l__siunitx_symbol_tmpb_tl + { + \group_end: + \keys_set:nn { siunitx } + { + inter-unit-product = + \ifmmode \cdot \else \textperiodcentered \fi + } + } + { \group_end: } } \AtBeginDocument { @@ -6482,6 +6529,18 @@ } \keys_define:nn { siunitx } { + group-digits / false .code:n = + { + \__siunitx_option_deprecated:nn + { group-digits ~ = ~ false } + { group-digits ~ = ~ none } + } , + group-digits / true .code:n = + { + \__siunitx_option_deprecated:nn + { group-digits ~ = ~ true } + { group-digits ~ = ~ all } + } , separate-uncertainty .choice: , separate-uncertainty / false .code:n = { @@ -6993,6 +7052,7 @@ \exp_not:N \fi } } +\siunitx_declare_unit:Nn \celsius { \degreeCelsius } \IfFormatAtLeastTF { 2020-10-01 } { } { \RequirePackage { xparse } } |