diff options
author | Karl Berry <karl@freefriends.org> | 2021-07-28 20:48:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-07-28 20:48:28 +0000 |
commit | 8d926a39de2bc76c0488c7ae02fe3665a543399f (patch) | |
tree | 6d75ffb83ed815e70c1cd84ce8c4673dc32f3f68 /Master/texmf-dist/tex/latex/siunitx/siunitx.sty | |
parent | 308bb1108f05d9f3b498559bb2037cbd8cefb156 (diff) |
siunitx (28jul21)
git-svn-id: svn://tug.org/texlive/trunk@60105 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/siunitx/siunitx.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 490 |
1 files changed, 245 insertions, 245 deletions
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 8af08eb1376..d0b6477cb1a 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -20,8 +20,8 @@ %% siunitx-command.dtx (with options: `package') %% siunitx-emulation.dtx (with options: `package,options') %% siunitx.dtx (with options: `package,options') -%% siunitx-emulation.dtx (with options: `package,interfaces') %% siunitx.dtx (with options: `package,interfaces') +%% siunitx-emulation.dtx (with options: `package,interfaces') %% \providecommand\DeclareRelease[3]{} \providecommand\DeclareCurrentRelease[2]{} @@ -42,7 +42,7 @@ }% \endinput }% -\ProvidesExplPackage {siunitx} {2021-07-22} {3.0.22} +\ProvidesExplPackage {siunitx} {2021-07-26} {3.0.23} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -7087,249 +7087,6 @@ } \RequirePackage { l3keys2e } \ProcessKeysOptions { siunitx } -\NewDocumentCommand \DeclareBinaryPrefix { +m m m } - { - \siunitx_declare_prefix:Nn #1 {#2} - } -\NewDocumentCommand \DeclareSIPrePower { +m m } - { - \siunitx_declare_power:NNn #1 \__siunitx_tmp:w {#2} - \seq_remove_all:Nn \l_siunitx_unit_symbolic_seq { \__siunitx_tmp:w } - } -\NewDocumentCommand \DeclareSIPostPower { +m m } - { - \siunitx_declare_power:NNn \__siunitx_tmp:w #1 {#2} - \seq_remove_all:Nn \l_siunitx_unit_symbolic_seq { \__siunitx_tmp:w } - } -\NewDocumentCommand \si { O { } m } - { - \mode_leave_vertical: - \group_begin: - \keys_set:nn { siunitx } {#1} - \siunitx_unit_format:nN {#2} \l__siunitx_tmp_tl - \siunitx_print_unit:V \l__siunitx_tmp_tl - \group_end: - } -\NewDocumentCommand \SI { O { } m o m } - { - \mode_leave_vertical: - \group_begin: - \keys_set:nn { siunitx } {#1} - \IfNoValueF {#3} - { - \siunitx_unit_format:nN {#3} \l__siunitx_tmp_tl - \siunitx_print_unit:V \l__siunitx_tmp_tl - \nobreak - } - \siunitx_quantity:nn {#2} {#4} - \group_end: - } -\NewDocumentCommand \SIlist - { O { } > { \SplitList { ; } } m > { \TrimSpaces } m } - { - \mode_leave_vertical: - \group_begin: - \siunitx_unit_options_apply:n {#3} - \keys_set:nn { siunitx } {#1} - \siunitx_quantity_list:nn {#2} {#3} - \group_end: - } -\NewDocumentCommand \SIrange { O { } m m > { \TrimSpaces } m } - { - \mode_leave_vertical: - \group_begin: - \siunitx_unit_options_apply:n {#4} - \keys_set:nn { siunitx } {#1} - \siunitx_quantity_range:nnn {#2} {#3} {#4} - \group_end: - } -\bool_lazy_or:nnTF - { \sys_if_engine_luatex_p: } - { \sys_if_engine_xetex_p: } - { - \cs_new:Npn \__siunitx_emulation_non_latin:n #1 - { \char_generate:nn {#1} { \char_value_catcode:n {#1} } } - } - { - \cs_new:Npn \__siunitx_emulation_non_latin:n #1 - { - \exp_last_unbraced:Nf \__siunitx_emulation_non_latin:nnnn - { \char_to_utfviii_bytes:n {#1} } - } - \cs_new:Npn \__siunitx_emulation_non_latin:nnnn #1#2#3#4 - { - \exp_after:wN \exp_after:wN \exp_after:wN - \exp_not:N \char_generate:nn {#1} { 13 } - \exp_after:wN \exp_after:wN \exp_after:wN - \exp_not:N \char_generate:nn {#2} { 13 } - } - } -\AtBeginDocument - { - \cs_new_protected:Npn \SIUnitSymbolArcminute - { \ensuremath { { } ' } } - \cs_new_protected:Npn \SIUnitSymbolArcsecond - { \ensuremath { { } '' } } - \@ifpackageloaded { fontspec } - { - \cs_new_protected:Npx \SIUnitSymbolAngstrom - { \__siunitx_emulation_non_latin:n { "00C5 } } - \cs_new_protected:Npx \SIUnitSymbolDegree - { \__siunitx_emulation_non_latin:n { "00B0 } } - \cs_new_protected:Npx \SIUnitSymbolCelsius - { \__siunitx_emulation_non_latin:n { "00B0 } C } - } - { - \cs_new_protected:Npx \SIUnitSymbolAngstrom - { - \siunitx_print_text:n - { \__siunitx_emulation_non_latin:n { "00C5 } } - } - \cs_new_protected:Npx \SIUnitSymbolCelsius - { - \siunitx_print_text:n - { \__siunitx_emulation_non_latin:n { "00B0 } } C - } - \cs_new_protected:Npx \SIUnitSymbolDegree - { - \siunitx_print_text:n - { \__siunitx_emulation_non_latin:n { "00B0 } } - } - } - \cs_new_protected:Npx \SIUnitSymbolMicro - { - \siunitx_print_text:n - { - \bool_lazy_or:nnTF - { \sys_if_engine_luatex_p: } - { \sys_if_engine_xetex_p: } - { \__siunitx_emulation_non_latin:n { "00B5 } } - { \exp_not:N \textmu } - } - } - \cs_new_protected:Npx \SIUnitSymbolOhm - { - \exp_not:N \ifmmode - \cs_if_exist:NTF \upOmega - { \exp_not:N \upOmega } - { \exp_not:N \Omega } - \exp_not:N \else - \siunitx_print_text:n - { - \bool_lazy_or:nnTF - { \sys_if_engine_luatex_p: } - { \sys_if_engine_xetex_p: } - { \__siunitx_emulation_non_latin:n { "03A9 } } - { \exp_not:N \textohm } - } - \exp_not:N \fi - } - } -\siunitx_declare_unit:Nn \celsius { \degreeCelsius } -\msg_new:nnn { siunitx } { unit-deprecated } - { - Unit~macro~#1~has~been~deprecated~in~this~release. \\ \\ - The~BIPM~have~removed~this~unit~from~the~SI~Brochure.~ - You~should~define~it~yourself~using~\token_to_str:N \DeclareSIUnit\ % - in~your~source.~The~current~definition~is\\ \\ - \token_to_str:N \DeclareSIUnit #1 \{ #2 \} - } -\cs_gset_protected:Npn \__siunitx_emulation_tmp:w #1#2 - { - \quark_if_recursion_tail_stop:N #1 - \bool_new:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool } - \siunitx_declare_unit:Nx #1 - { - \exp_not:N \bool_if:NF - \exp_not:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool } - { - \exp_not:N \bool_gset_true:N - \exp_not:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool } - \msg_warning:nnnn { siunitx } { unit-deprecated } - { \token_to_str:N #1 } {#2} - } - #2 - } - \__siunitx_emulation_tmp:w - } -\__siunitx_emulation_tmp:w - \atomicmassunit { u } - \bar { bar } - \barn { b } - \bohr - { - \exp_not:N \text - { \exp_not:N \ensuremath { a } } \char_generate:nn { `\_ } { 8 } { 0 } - } - \clight - { - \exp_not:N \text - { \exp_not:N \ensuremath { c } } \char_generate:nn { `\_ } { 8 } { 0 } - } - \electronmass - { - \exp_not:N \text { \exp_not:N \ensuremath { m } } - \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { e } } - } - \elementarycharge { \text { \ensuremath { e } } } - \hartree - { - \exp_not:N \text { \exp_not:N \ensuremath { E } } - \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { h } } - } - \knot { kn } - \mmHg { mmHg } - \nauticalmile { M } - \planckbar - { \exp_not:N \text { \exp_not:N \ensuremath { \exp_not:N \hbar } } } - \q_recursion_tail { } - \q_recursion_stop -\@ifpackageloaded { fontspec } - { - \__siunitx_emulation_tmp:w \angstrom { \__siunitx_emulation_non_latin:n { "00C5 } } - } - { - \__siunitx_emulation_tmp:w \angstrom - { \exp_not:N \text { \__siunitx_emulation_non_latin:n { "00C5 } } } - } - \q_recursion_tail { } - \q_recursion_stop -\NewDocumentCommand \SendSettingsToPgf { } - { - \use:x - { - \exp_not:N \pgfqkeys { /pgf/number~format } - { - \str_if_eq:VnT \l__siunitx_number_round_mode_tl { figures } - { - fixed , - fixed~zerofill = true , - } - precision = \int_use:N \l__siunitx_number_round_precision_int , - set~decimal~separator = - \str_if_eq:VnTF \l_siunitx_number_output_decimal_tl { , } - { \exp_not:N \mathord } - { \use:n } - { \exp_not:V \l_siunitx_number_output_decimal_tl } , - set~thousands~separator = - set~decimal~separator = - \str_if_eq:VnTF \l__siunitx_number_group_separator_tl { , } - { \exp_not:N \mathord } - { \use:n } - { \exp_not:V \l__siunitx_number_group_separator_tl } , - min~exponent~for~1000~sep = - \int_eval:n { \l__siunitx_number_group_minimum_int - 1 } , - \bool_lazy_or:nnF - { \l__siunitx_number_group_decimal_bool } - { \l__siunitx_number_group_integer_bool } - { min~exponent~for~1000~sep = 999 , } - showpos = - \bool_if:NTF \l__siunitx_number_implicit_plus_bool - { true } - { false } - } - } - } \IfFormatAtLeastTF { 2020-10-01 } { } { \RequirePackage { xparse } } @@ -7691,6 +7448,249 @@ \exp_not:N \tl_if_blank:nF {#1} { + 1 } \exp_not:N \__siunitx_list_count:w \c_space_tl } +\NewDocumentCommand \DeclareBinaryPrefix { +m m m } + { + \siunitx_declare_prefix:Nn #1 {#2} + } +\NewDocumentCommand \DeclareSIPrePower { +m m } + { + \siunitx_declare_power:NNn #1 \__siunitx_tmp:w {#2} + \seq_remove_all:Nn \l_siunitx_unit_symbolic_seq { \__siunitx_tmp:w } + } +\NewDocumentCommand \DeclareSIPostPower { +m m } + { + \siunitx_declare_power:NNn \__siunitx_tmp:w #1 {#2} + \seq_remove_all:Nn \l_siunitx_unit_symbolic_seq { \__siunitx_tmp:w } + } +\NewDocumentCommand \si { O { } m } + { + \mode_leave_vertical: + \group_begin: + \keys_set:nn { siunitx } {#1} + \siunitx_unit_format:nN {#2} \l__siunitx_tmp_tl + \siunitx_print_unit:V \l__siunitx_tmp_tl + \group_end: + } +\NewDocumentCommand \SI { O { } m o m } + { + \mode_leave_vertical: + \group_begin: + \keys_set:nn { siunitx } {#1} + \IfNoValueF {#3} + { + \siunitx_unit_format:nN {#3} \l__siunitx_tmp_tl + \siunitx_print_unit:V \l__siunitx_tmp_tl + \nobreak + } + \siunitx_quantity:nn {#2} {#4} + \group_end: + } +\NewDocumentCommand \SIlist + { O { } > { \SplitList { ; } } m > { \TrimSpaces } m } + { + \mode_leave_vertical: + \group_begin: + \siunitx_unit_options_apply:n {#3} + \keys_set:nn { siunitx } {#1} + \siunitx_quantity_list:nn {#2} {#3} + \group_end: + } +\NewDocumentCommand \SIrange { O { } m m > { \TrimSpaces } m } + { + \mode_leave_vertical: + \group_begin: + \siunitx_unit_options_apply:n {#4} + \keys_set:nn { siunitx } {#1} + \siunitx_quantity_range:nnn {#2} {#3} {#4} + \group_end: + } +\bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { + \cs_new:Npn \__siunitx_emulation_non_latin:n #1 + { \char_generate:nn {#1} { \char_value_catcode:n {#1} } } + } + { + \cs_new:Npn \__siunitx_emulation_non_latin:n #1 + { + \exp_last_unbraced:Nf \__siunitx_emulation_non_latin:nnnn + { \char_to_utfviii_bytes:n {#1} } + } + \cs_new:Npn \__siunitx_emulation_non_latin:nnnn #1#2#3#4 + { + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:N \char_generate:nn {#1} { 13 } + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:N \char_generate:nn {#2} { 13 } + } + } +\AtBeginDocument + { + \cs_new_protected:Npn \SIUnitSymbolArcminute + { \ensuremath { { } ' } } + \cs_new_protected:Npn \SIUnitSymbolArcsecond + { \ensuremath { { } '' } } + \@ifpackageloaded { fontspec } + { + \cs_new_protected:Npx \SIUnitSymbolAngstrom + { \__siunitx_emulation_non_latin:n { "00C5 } } + \cs_new_protected:Npx \SIUnitSymbolDegree + { \__siunitx_emulation_non_latin:n { "00B0 } } + \cs_new_protected:Npx \SIUnitSymbolCelsius + { \__siunitx_emulation_non_latin:n { "00B0 } C } + } + { + \cs_new_protected:Npx \SIUnitSymbolAngstrom + { + \siunitx_print_text:n + { \__siunitx_emulation_non_latin:n { "00C5 } } + } + \cs_new_protected:Npx \SIUnitSymbolCelsius + { + \siunitx_print_text:n + { \__siunitx_emulation_non_latin:n { "00B0 } } C + } + \cs_new_protected:Npx \SIUnitSymbolDegree + { + \siunitx_print_text:n + { \__siunitx_emulation_non_latin:n { "00B0 } } + } + } + \cs_new_protected:Npx \SIUnitSymbolMicro + { + \siunitx_print_text:n + { + \bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { \__siunitx_emulation_non_latin:n { "00B5 } } + { \exp_not:N \textmu } + } + } + \cs_new_protected:Npx \SIUnitSymbolOhm + { + \exp_not:N \ifmmode + \cs_if_exist:NTF \upOmega + { \exp_not:N \upOmega } + { \exp_not:N \Omega } + \exp_not:N \else + \siunitx_print_text:n + { + \bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { \__siunitx_emulation_non_latin:n { "03A9 } } + { \exp_not:N \textohm } + } + \exp_not:N \fi + } + } +\siunitx_declare_unit:Nn \celsius { \degreeCelsius } +\msg_new:nnn { siunitx } { unit-deprecated } + { + Unit~macro~#1~has~been~deprecated~in~this~release. \\ \\ + The~BIPM~have~removed~this~unit~from~the~SI~Brochure.~ + You~should~define~it~yourself~using~\token_to_str:N \DeclareSIUnit\ % + in~your~source.~The~current~definition~is\\ \\ + \token_to_str:N \DeclareSIUnit #1 \{ #2 \} + } +\cs_gset_protected:Npn \__siunitx_emulation_tmp:w #1#2 + { + \quark_if_recursion_tail_stop:N #1 + \bool_new:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool } + \siunitx_declare_unit:Nx #1 + { + \exp_not:N \bool_if:NF + \exp_not:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool } + { + \exp_not:N \bool_gset_true:N + \exp_not:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool } + \msg_warning:nnnn { siunitx } { unit-deprecated } + { \token_to_str:N #1 } {#2} + } + #2 + } + \__siunitx_emulation_tmp:w + } +\__siunitx_emulation_tmp:w + \atomicmassunit { u } + \bar { bar } + \barn { b } + \bohr + { + \exp_not:N \text + { \exp_not:N \ensuremath { a } } \char_generate:nn { `\_ } { 8 } { 0 } + } + \clight + { + \exp_not:N \text + { \exp_not:N \ensuremath { c } } \char_generate:nn { `\_ } { 8 } { 0 } + } + \electronmass + { + \exp_not:N \text { \exp_not:N \ensuremath { m } } + \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { e } } + } + \elementarycharge { \text { \ensuremath { e } } } + \hartree + { + \exp_not:N \text { \exp_not:N \ensuremath { E } } + \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { h } } + } + \knot { kn } + \mmHg { mmHg } + \nauticalmile { M } + \planckbar + { \exp_not:N \text { \exp_not:N \ensuremath { \exp_not:N \hbar } } } + \q_recursion_tail { } + \q_recursion_stop +\@ifpackageloaded { fontspec } + { + \__siunitx_emulation_tmp:w \angstrom { \__siunitx_emulation_non_latin:n { "00C5 } } + } + { + \__siunitx_emulation_tmp:w \angstrom + { \exp_not:N \text { \__siunitx_emulation_non_latin:n { "00C5 } } } + } + \q_recursion_tail { } + \q_recursion_stop +\NewDocumentCommand \SendSettingsToPgf { } + { + \use:x + { + \exp_not:N \pgfqkeys { /pgf/number~format } + { + \str_if_eq:VnT \l__siunitx_number_round_mode_tl { figures } + { + fixed , + fixed~zerofill = true , + } + precision = \int_use:N \l__siunitx_number_round_precision_int , + set~decimal~separator = + \str_if_eq:VnTF \l_siunitx_number_output_decimal_tl { , } + { \exp_not:N \mathord } + { \use:n } + { \exp_not:V \l_siunitx_number_output_decimal_tl } , + set~thousands~separator = + set~decimal~separator = + \str_if_eq:VnTF \l__siunitx_number_group_separator_tl { , } + { \exp_not:N \mathord } + { \use:n } + { \exp_not:V \l__siunitx_number_group_separator_tl } , + min~exponent~for~1000~sep = + \int_eval:n { \l__siunitx_number_group_minimum_int - 1 } , + \bool_lazy_or:nnF + { \l__siunitx_number_group_decimal_bool } + { \l__siunitx_number_group_integer_bool } + { min~exponent~for~1000~sep = 999 , } + showpos = + \bool_if:NTF \l__siunitx_number_implicit_plus_bool + { true } + { false } + } + } + } %% Copyright (C) 2008-2021 by %% Joseph Wright <joseph.wright@morningstar2.co.uk> %% |