diff options
author | Karl Berry <karl@freefriends.org> | 2021-06-17 20:36:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-06-17 20:36:43 +0000 |
commit | f02598b65001239577c257d86bef00d4e12881af (patch) | |
tree | 617aaa8e5c97835a2350965ddecf83cda47cef30 /Master/texmf-dist | |
parent | 75aa1b8146b789463ab2404d05cf861f64b44170 (diff) |
siunitx (17jun21)
git-svn-id: svn://tug.org/texlive/trunk@59614 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
15 files changed, 270 insertions, 137 deletions
diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index 364058db974..1266b1623bb 100644 --- a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md @@ -7,6 +7,33 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.0.14] + +### Changed +- Auto-enable `table-fixed-width` when setting `table-column-width` + to a positive value +- Expand `table-format` input before splitting + +### Fixed +- Incorrect handling of `{}` in literal units (issue #487) +- Placement of sign in some complex numbers (issue #488) +- Printing of units in quantities when `uncertainty-mode` is + `separate` and an exponent is present (issue #490) + +## [v3.0.13] + +### Added +- Catalan translations for lists and ranges + +### Fixed +- Position of complex root when no real part is present (issue #481) +- Skip defining `\unit` if the `units` package is loaded (issue #482) +- Printing units in compound quantities when `parse-numbers` is + false (issue #484) +- Printing of `1` when both `print-zero-exponent` and + `print-unity-mantissa` are false (issue #485) +- Printing of ohm symbol in text mode with `fourier` package (issue #486) + ## [v3.0.12] ### Fixed @@ -1368,7 +1395,9 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ### Added - First public testing release (as `si`) -[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.12...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.14...HEAD +[v3.0.14]: https://github.com/josephwright/siunitx/compare/v3.0.13...v3.0.14 +[v3.0.13]: https://github.com/josephwright/siunitx/compare/v3.0.12...v3.0.13 [v3.0.12]: https://github.com/josephwright/siunitx/compare/v3.0.11...v3.0.12 [v3.0.11]: https://github.com/josephwright/siunitx/compare/v3.0.10...v3.0.11 [v3.0.10]: https://github.com/josephwright/siunitx/compare/v3.0.9...v3.0.10 diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf Binary files differindex b62b22632dc..ff484ac37da 100644 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf +++ b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx-table.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-table.pdf Binary files differdeleted file mode 100644 index 6c241941b53..00000000000 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx-table.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf Binary files differindex 36c97918d0b..02d552c6adc 100644 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf +++ b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx index 1a81054a5c2..ca4262bdce7 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx @@ -597,12 +597,12 @@ % % \begin{macro}{\@@_format:n} % \begin{macro}{\@@_format_auxi:n} -% \begin{macro}{\@@_format_unary:nnnnnnn} % \begin{macro}{\@@_format_auxii:n} % \begin{macro}{\@@_drop_exponent:nnnnnnn} % \begin{macro}{\@@_format_sign:nnnnnnn} % \begin{macro}{\@@_extract_exponent:nw} % \begin{macro}{\@@_extract_exponent_aux:w} +% \begin{macro}{\@@_format_unary:nnnnnnn} % \begin{macro}[EXP]{\@@_format_bracket:n} % We start here checking that there is something to do. % \begin{macrocode} @@ -614,53 +614,24 @@ { \@@_format_auxi:n {#1} } } % \end{macrocode} +% We split based on whether the number has a complex part at all, +% then print the result. % \begin{macrocode} \cs_new_protected:Npn \@@_format_auxi:n #1 { \tl_clear:N \l_@@_tmp_tl - \tl_if_empty:NTF \l_@@_real_tl + \tl_if_empty:NTF \l_@@_img_tl { - \@@_format_units:n {#1} - \exp_after:wN \@@_format_unary:nnnnnnn \l_@@_img_tl + \siunitx_number_process:NN \l_@@_real_tl \l_@@_real_tl \tl_set:Nx \l_@@_tmp_tl - { - \siunitx_number_output:N \l_@@_img_tl - \exp_not:V \l_@@_output_root_tl - } - } - { - \tl_if_empty:NTF \l_@@_img_tl - { - \siunitx_number_process:NN \l_@@_real_tl \l_@@_real_tl - \tl_set:Nx \l_@@_tmp_tl - { \siunitx_number_output:N \l_@@_real_tl } - } - { \@@_format_auxii:n {#1} } + { \siunitx_number_output:N \l_@@_real_tl } } + { \@@_format_auxii:n {#1} } \tl_if_blank:nTF {#1} { \siunitx_print_number:V \l_@@_tmp_tl } { \siunitx_quantity_print:VV \l_@@_tmp_tl \l_@@_unit_tl } } % \end{macrocode} -% An imaginary part that is exactly $1$ is omitted, with only the complex -% root printed. That means checking and removing a lone $1$ here. -% \begin{macrocode} -\cs_new_protected:Npn \@@_format_unary:nnnnnnn #1#2#3#4#5#6#7 - { - \tl_set:Nx \l_@@_img_tl - { - \exp_not:n { {#1} {#2} } - \tl_if_blank:nTF {#4} - { - \str_if_eq:nnTF {#3} { 1 } - { { } { } } - { \exp_not:n { {#3} {#4} } } - } - { \exp_not:n { {#3} {#4} } } - \exp_not:n { {#5} {#6} {#7} } - } - } -% \end{macrocode} % If we get to this stage we have both parts to a complex number. We % need to process both and do some massaging, then it's just a question % of reassembly with the right parts in the right places. @@ -668,8 +639,10 @@ \cs_new_protected:Npn \@@_format_auxii:n #1 { \@@_format_units:n {#1} - \exp_after:wN \@@_drop_exponent:nnnnnnn \l_@@_real_tl + \tl_if_empty:NF \l_@@_real_tl + { \exp_after:wN \@@_drop_exponent:nnnnnnn \l_@@_real_tl } \exp_after:wN \@@_format_sign:nnnnnnn \l_@@_img_tl + \exp_after:wN \@@_format_unary:nnnnnnn \l_@@_img_tl \tl_set:Nx \l_@@_tmp_tl { \siunitx_number_output:NN \l_@@_img_tl \q_nil } \exp_after:wN \@@_extract_exponent:w \l_@@_tmp_tl \q_stop @@ -706,7 +679,11 @@ \tl_set:Nx \l_@@_img_tl { { } - { \tl_if_blank:nTF {#2} { + } { \exp_not:n {#2} } } + { + \tl_if_blank:nTF {#2} + { \tl_if_empty:NF \l_@@_real_tl { + } } + { \exp_not:n {#2} } + } \tl_if_blank:nTF {#4} { \str_if_eq:nnTF {#3} { 1 } @@ -733,6 +710,25 @@ \tl_set:Nn \l_@@_tmp_tl {#1#2} \tl_set:Nn \l_@@_exp_tl {#3#4} } +% \end{macrocode} +% An imaginary part that is exactly $1$ is omitted, with only the complex +% root printed. That means checking and removing a lone $1$ here. +% \begin{macrocode} +\cs_new_protected:Npn \@@_format_unary:nnnnnnn #1#2#3#4#5#6#7 + { + \tl_set:Nx \l_@@_img_tl + { + \exp_not:n { {#1} {#2} } + \tl_if_blank:nTF {#4} + { + \str_if_eq:nnTF {#3} { 1 } + { { } { } } + { \exp_not:n { {#3} {#4} } } + } + { \exp_not:n { {#3} {#4} } } + \exp_not:n { {#5} {#6} {#7} } + } + } \cs_new_protected:Npn \@@_format_bracket:n #1 { \exp_not:V \l_@@_bracket_open_tl diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx index f377585b782..5f119f13720 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx @@ -666,6 +666,8 @@ { \bool_set_false:N \l_siunitx_number_bracket_ambiguous_bool } \bool_set_true:N \l_@@_unit_bool \@@_format:nn {#1} {#2} + \bool_if:NF \l_siunitx_number_parse_bool + { \siunitx_unit_format:nN {#2} \l_@@_unit_tl } \str_if_eq:VnT \l_siunitx_quantity_prefix_mode_tl { combine-exponent } { \tl_clear:N \l_@@_exp_tl } \bool_if:NTF \l_@@_unit_repeat_bool diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx index f037fcfae34..8535a74c206 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx @@ -136,6 +136,8 @@ \file_if_exist:nT { translations.sty } { \RequirePackage { translations } + \DeclareTranslation { Catalan } { and } { i } + \DeclareTranslation { Catalan } { to~(numerical~range) } { a } \DeclareTranslation { English } { to~(numerical~range) } { to } \DeclareTranslation { French } { to~(numerical~range) } { à } \DeclareTranslation { German } { to~(numerical~range) } { bis } diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx index 2dfa66374c8..737b503b374 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx @@ -3165,9 +3165,16 @@ % \begin{macrocode} \cs_new:Npn \@@_output_integer:nnn #1#2#3 { - \bool_lazy_or:nnT - { \l_@@_unity_mantissa_bool } - { ! \str_if_eq_p:nn { #1 . #2 } { 1. } } + \bool_lazy_any:nT + { + { \l_@@_unity_mantissa_bool } + { ! \str_if_eq_p:nn { #1 . #2 } { 1. } } + { + \bool_lazy_and_p:nn + { \str_if_eq_p:nn {#3} { 0 } } + { ! \l_@@_zero_exponent_bool } + } + } { \@@_output_digits:nn { integer } {#1} } } \cs_new:Npn \@@_output_decimal:nn #1#2 diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx index 930f75c5fc5..353fe94e6e8 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx @@ -221,6 +221,7 @@ % \begin{macro}{\@@_parsed_aux:w} % \begin{macro}{\@@_parsed_aux:nnnw} % \begin{macro}{\@@_parsed_aux:nnnn} +% \begin{macro}{\@@_parsed_aux:nnn} % For quantities, there is bit to do to combine things. The first question is % whether we are parsing at all: if not, things are quite short. Notice that % within this group we turn off bracketing in the number formatter: we @@ -319,17 +320,28 @@ { \bool_if:NTF \l_@@_uncert_repeat_bool { - \siunitx_quantity_print:nV {#1#2} - \l_@@_unit_tl - \siunitx_quantity_print:nV { { } #3 } - \l_@@_unit_tl - \siunitx_print_number:n { { } #4 } + \tl_if_blank:nTF {#4} + { \@@_parsed_aux:nnn {#1#2} {#3} { } } + { \@@_parsed_aux:nnn {#1#2} {#3} { { } #4 } } } { \siunitx_quantity_print:nV {#1#2#3#4} \l_@@_unit_tl } } } } % \end{macrocode} +% For the case of a separated uncertainty with repeated units, we print the +% two parts independently. The third argument here is the exponent if there +% is one, with the spacing correct in either case as we only pass the empty +% group if one is required. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parsed_aux:nnn #1#2#3 + { + \siunitx_quantity_print:nV {#1#3} \l_@@_unit_tl + \tl_if_blank:nF {#2} + { \siunitx_quantity_print:nV { { } #2#3 } \l_@@_unit_tl } + } +% \end{macrocode} +% \end{macro} % \end{macro} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx index 6c7154d7513..40b461bd84d 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx @@ -225,26 +225,38 @@ { \group_end: } % \end{macrocode} % For |\ohm|, there is a math mode symbol we can use, so there has to be -% a mode-dependent definition. +% a mode-dependent definition. This doesn't work if the text mode symbol is +% bust: the \pkg{fourier} package puts us in that position. % \begin{macrocode} \@@_if_replace:NnT \ohm { "03A9 } { \siunitx_declare_unit:Nx \ohm { - \exp_not:N \ifmmode - \cs_if_exist:NTF \upOmega - { \exp_not:N \upOmega } - { \exp_not:N \Omega } - \exp_not:N \else - \exp_not:N \text - { - \bool_lazy_or:nnTF - { \sys_if_engine_luatex_p: } - { \sys_if_engine_xetex_p: } - { \@@_non_latin:n { "03A9 } } - { \exp_not:N \textohm } - } - \exp_not:N \fi + \@ifpackageloaded { fourier } + { + \exp_not:N \ensuremath + { + \cs_if_exist:NTF \upOmega + { \exp_not:N \upOmega } + { \exp_not:N \Omega } + } + } + { + \exp_not:N \ifmmode + \cs_if_exist:NTF \upOmega + { \exp_not:N \upOmega } + { \exp_not:N \Omega } + \exp_not:N \else + \exp_not:N \text + { + \bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { \@@_non_latin:n { "03A9 } } + { \exp_not:N \textohm } + } + \exp_not:N \fi + } } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx index 137c2e18d65..efd2c6bc9b4 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx @@ -584,10 +584,15 @@ % \begin{variable}{\l_@@_column_width_dim, \l_@@_fixed_width_bool} % Settings which apply to aligned columns in general. % \begin{macrocode} +\dim_new:N \l_@@_column_width_dim \keys_define:nn { siunitx } { - table-column-width .dim_set:N = - \l_@@_column_width_dim , + table-column-width .code:n = + { + \dim_set:Nn \l_@@_column_width_dim {#1} + \dim_compare:nNnT \l_@@_column_width_dim > \c_zero_dim + { \bool_set_true:N \l_@@_fixed_width_bool } + } , table-fixed-width .bool_set:N = \l_@@_fixed_width_bool } @@ -776,7 +781,10 @@ \l_@@_auto_round_bool , table-format .code:n = { - \@@_split:nNNN {#1} + \group_begin: + \protected@edef \l_@@_tmp_tl {#1} + \exp_args:NNV \group_end: + \@@_split:nNNN \l_@@_tmp_tl \l_@@_before_model_tl \l_@@_model_tl \l_@@_after_model_tl diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx index 3cbfa728fc6..ab9c30a1c24 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx @@ -1189,7 +1189,7 @@ % } % \begin{macro}{\@@_format_literal_super:nn, \@@_format_literal_sub:nn} % \begin{macro}{\@@_format_literal_add:n} -% \begin{macro}{\@@_format_literal_auxvii:nn} +% \begin{macro}{\@@_format_literal_auxix:nn} % \begin{variable}{\l_@@_separator_tl} % To format literal units, there are two tasks to do. The input is % \texttt{x}-type expanded to force any symbolic units to be converted into @@ -1285,7 +1285,7 @@ { \tl_if_head_is_N_type:nTF {#2} { \@@_format_literal_auxvi:nN } - { \@@_format_literal_auxvii:nn } + { \@@_format_literal_auxix:nn } {#1} #2 \q_recursion_stop } \cs_new_protected:Npx \@@_format_literal_auxvi:nN #1#2 @@ -1308,7 +1308,7 @@ { \str_if_eq:nnTF {#2} { \protect } { \@@_format_literal_auxviii:nN {#1} } - { \@@_format_literal_auxvi:nN {#1#2} } + { \@@_format_literal_auxv:nw {#1#2} } } \cs_new_protected:Npn \@@_format_literal_auxviii:nN #1#2 { \@@_format_literal_auxv:nw { #1 \protect #2 } } @@ -1345,7 +1345,7 @@ } \tl_clear:N \l_@@_separator_tl } -\cs_new_protected:Npn \@@_format_literal_auxvii:nn #1#2 +\cs_new_protected:Npn \@@_format_literal_auxix:nn #1#2 { \@@_format_literal_auxvi:nN { #1 {#2} } } \tl_new:N \l_@@_separator_tl % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 53cfbd8426b..75c494abb4a 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -121,7 +121,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2021-06-09} {3.0.12} +\ProvidesExplPackage {siunitx} {2021-06-17} {3.0.14} {A comprehensive (SI) units package} % \end{macrocode} % @@ -309,6 +309,17 @@ \siunitx_print_number:V \l_@@_tmp_tl \group_end: } +\@ifpackageloaded { units } + { + \msg_new:nnn { siunitx } { units-pkg } + { + Detected~the~"units"~package: \\ + Omitting~definition~of~\token_to_str:N \unit. + } + \msg_warning:nn { siunitx } { units-pkg } + \use_none:nnnn + } + { } \NewDocumentCommand \unit { O { } > { \TrimSpaces } m } { \mode_leave_vertical: @@ -522,7 +533,7 @@ % \subsection{Document commands in bookmarks} % % In bookmarks, the \pkg{siunitx} document commands need to produce simple -% strings that represent their input as far a possible. +% strings that represent their input as far as possible. % % \begin{macro}{\@@_bookmark_cmd:Nn} % To keep things fast, expandable versions of the document command are diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.tex b/Master/texmf-dist/source/latex/siunitx/siunitx.tex index 28eaa37b2c0..2be2483297c 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.tex +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.tex @@ -1748,7 +1748,9 @@ if no sign was present in the input. \DescribeOption{print-zero-exponent} Printing of a mantissa of $1$ and an exponent of $0$ is controllable by the options \opt{print-unity-mantissa} and \opt{print-zero-exponent}. The standard -settings print a mantissa of $1$ but omit an exponent of $0$. +settings print a mantissa of $1$ but omit an exponent of $0$. Notice that where +both are set to \opt{false}, the value $1$ will still be printed +(\foreign{i.e.}~\opt{print-zero-exponent} has a higher priority). \begin{LaTeXdemo} \num{1e4} \\ \num[print-unity-mantissa = false]{1e4} \\ @@ -1993,7 +1995,7 @@ the \LaTeX3 floating-point unit, so is limited to $16$ decimal places. \DescribeOption{number-angle-product} The separator between the number and angle symbol (degrees, minutes or seconds) can be set using the \opt{number-angle-product} option, independent of the -related \opt{number-unit-product} option used by the \cs{qty} command. +related \opt{quantity-product} option used by the \cs{qty} command. \begin{LaTeXdemo} \ang{2.67} \\ \ang[number-angle-product = \,]{2.67} @@ -2102,6 +2104,14 @@ outside of the \cs{unit} and \cs{qty} arguments. When this option is method to achieve this does not overwrite any existing macros: this behaviour can be altered using the \opt{overwrite-commands} switch. +When using the approach of \enquote{free-standing} unit commands, only macros +created using \cs{DeclareSIUnit} are defined generally. Thus prefixes and +powers should be combined with the desired unit into a single free-standing +command, for example +\begin{LaTeXdemo}[code only] + \DeclareSIUnit\kilometre{\kilo\metre} +\end{LaTeXdemo} + \DescribeOption{space-before-unit} \DescribeOption{unit-optional-argument} \DescribeOption{use-xspace} @@ -2324,7 +2334,7 @@ needed. This can be turned on using the \opt{allow-quantity-breaks} option. \end{minipage} \end{LaTeXdemo} -\DescribeOption{number-unit-product} +\DescribeOption{quantity-product} The product symbol between the number and unit is set using the \opt{quantity-product} option. \begin{LaTeXdemo} @@ -2742,7 +2752,8 @@ content. However, there are cases where a strictly fixed width is desirable. For these cases, the \opt{table-fixed-width} and \opt{table-column-width} options are available. The \opt{table-fixed-width} option activates fixed-width columns, whilst \opt{table-column-width} defines the target width -(Table~\ref{tab:width:fixed}). +(Table~\ref{tab:width:fixed}). Setting \opt{table-column-width} to a positive +value automatically enables \opt{table-fixed-width}. \begin{LaTeXdemo}[code and float] \begin{table} \caption{Fixed-width columns.% @@ -3026,6 +3037,10 @@ When the \pkg{physics} package is loaded before \pkg{siunitx}, the command \cs{qty} is not defined: users will need to use the version~$2$ command \cs{SI}. +When the \pkg{units} package is loaded before \pkg{siunitx}, the command +\cs{unit} is not defined: users will need to use the version~$2$ command +\cs{si}. + \section{Hints for using \pkg{siunitx}} \subsection{Adjusting \cs{litre} and \cs{liter}% diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 3d9fa8db1a4..d9bb92ea9cc 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-06-09} {3.0.12} +\ProvidesExplPackage {siunitx} {2021-06-17} {3.0.14} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -654,49 +654,24 @@ \cs_new_protected:Npn \__siunitx_complex_format_auxi:n #1 { \tl_clear:N \l__siunitx_complex_tmp_tl - \tl_if_empty:NTF \l__siunitx_complex_real_tl + \tl_if_empty:NTF \l__siunitx_complex_img_tl { - \__siunitx_complex_format_units:n {#1} - \exp_after:wN \__siunitx_complex_format_unary:nnnnnnn \l__siunitx_complex_img_tl + \siunitx_number_process:NN \l__siunitx_complex_real_tl \l__siunitx_complex_real_tl \tl_set:Nx \l__siunitx_complex_tmp_tl - { - \siunitx_number_output:N \l__siunitx_complex_img_tl - \exp_not:V \l__siunitx_complex_output_root_tl - } - } - { - \tl_if_empty:NTF \l__siunitx_complex_img_tl - { - \siunitx_number_process:NN \l__siunitx_complex_real_tl \l__siunitx_complex_real_tl - \tl_set:Nx \l__siunitx_complex_tmp_tl - { \siunitx_number_output:N \l__siunitx_complex_real_tl } - } - { \__siunitx_complex_format_auxii:n {#1} } + { \siunitx_number_output:N \l__siunitx_complex_real_tl } } + { \__siunitx_complex_format_auxii:n {#1} } \tl_if_blank:nTF {#1} { \siunitx_print_number:V \l__siunitx_complex_tmp_tl } { \siunitx_quantity_print:VV \l__siunitx_complex_tmp_tl \l__siunitx_complex_unit_tl } } -\cs_new_protected:Npn \__siunitx_complex_format_unary:nnnnnnn #1#2#3#4#5#6#7 - { - \tl_set:Nx \l__siunitx_complex_img_tl - { - \exp_not:n { {#1} {#2} } - \tl_if_blank:nTF {#4} - { - \str_if_eq:nnTF {#3} { 1 } - { { } { } } - { \exp_not:n { {#3} {#4} } } - } - { \exp_not:n { {#3} {#4} } } - \exp_not:n { {#5} {#6} {#7} } - } - } \cs_new_protected:Npn \__siunitx_complex_format_auxii:n #1 { \__siunitx_complex_format_units:n {#1} - \exp_after:wN \__siunitx_complex_drop_exponent:nnnnnnn \l__siunitx_complex_real_tl + \tl_if_empty:NF \l__siunitx_complex_real_tl + { \exp_after:wN \__siunitx_complex_drop_exponent:nnnnnnn \l__siunitx_complex_real_tl } \exp_after:wN \__siunitx_complex_format_sign:nnnnnnn \l__siunitx_complex_img_tl + \exp_after:wN \__siunitx_complex_format_unary:nnnnnnn \l__siunitx_complex_img_tl \tl_set:Nx \l__siunitx_complex_tmp_tl { \siunitx_number_output:NN \l__siunitx_complex_img_tl \q_nil } \exp_after:wN \__siunitx_complex_extract_exponent:w \l__siunitx_complex_tmp_tl \q_stop @@ -726,7 +701,11 @@ \tl_set:Nx \l__siunitx_complex_img_tl { { } - { \tl_if_blank:nTF {#2} { + } { \exp_not:n {#2} } } + { + \tl_if_blank:nTF {#2} + { \tl_if_empty:NF \l__siunitx_complex_real_tl { + } } + { \exp_not:n {#2} } + } \tl_if_blank:nTF {#4} { \str_if_eq:nnTF {#3} { 1 } @@ -750,6 +729,21 @@ \tl_set:Nn \l__siunitx_complex_tmp_tl {#1#2} \tl_set:Nn \l__siunitx_complex_exp_tl {#3#4} } +\cs_new_protected:Npn \__siunitx_complex_format_unary:nnnnnnn #1#2#3#4#5#6#7 + { + \tl_set:Nx \l__siunitx_complex_img_tl + { + \exp_not:n { {#1} {#2} } + \tl_if_blank:nTF {#4} + { + \str_if_eq:nnTF {#3} { 1 } + { { } { } } + { \exp_not:n { {#3} {#4} } } + } + { \exp_not:n { {#3} {#4} } } + \exp_not:n { {#5} {#6} {#7} } + } + } \cs_new_protected:Npn \__siunitx_complex_format_bracket:n #1 { \exp_not:V \l__siunitx_complex_bracket_open_tl @@ -1074,6 +1068,8 @@ { \bool_set_false:N \l_siunitx_number_bracket_ambiguous_bool } \bool_set_true:N \l__siunitx_compound_unit_bool \__siunitx_compound_format:nn {#1} {#2} + \bool_if:NF \l_siunitx_number_parse_bool + { \siunitx_unit_format:nN {#2} \l__siunitx_compound_unit_tl } \str_if_eq:VnT \l_siunitx_quantity_prefix_mode_tl { combine-exponent } { \tl_clear:N \l__siunitx_compound_exp_tl } \bool_if:NTF \l__siunitx_compound_unit_repeat_bool @@ -1434,6 +1430,8 @@ \file_if_exist:nT { translations.sty } { \RequirePackage { translations } + \DeclareTranslation { Catalan } { and } { i } + \DeclareTranslation { Catalan } { to~(numerical~range) } { a } \DeclareTranslation { English } { to~(numerical~range) } { to } \DeclareTranslation { French } { to~(numerical~range) } { à } \DeclareTranslation { German } { to~(numerical~range) } { bis } @@ -3146,9 +3144,16 @@ } \cs_new:Npn \__siunitx_number_output_integer:nnn #1#2#3 { - \bool_lazy_or:nnT - { \l__siunitx_number_unity_mantissa_bool } - { ! \str_if_eq_p:nn { #1 . #2 } { 1. } } + \bool_lazy_any:nT + { + { \l__siunitx_number_unity_mantissa_bool } + { ! \str_if_eq_p:nn { #1 . #2 } { 1. } } + { + \bool_lazy_and_p:nn + { \str_if_eq_p:nn {#3} { 0 } } + { ! \l__siunitx_number_zero_exponent_bool } + } + } { \__siunitx_number_output_digits:nn { integer } {#1} } } \cs_new:Npn \__siunitx_number_output_decimal:nn #1#2 @@ -4079,10 +4084,15 @@ \skip_horizontal:n {#1} \tex_kern:D \c_zero_skip } +\dim_new:N \l__siunitx_table_column_width_dim \keys_define:nn { siunitx } { - table-column-width .dim_set:N = - \l__siunitx_table_column_width_dim , + table-column-width .code:n = + { + \dim_set:Nn \l__siunitx_table_column_width_dim {#1} + \dim_compare:nNnT \l__siunitx_table_column_width_dim > \c_zero_dim + { \bool_set_true:N \l__siunitx_table_fixed_width_bool } + } , table-fixed-width .bool_set:N = \l__siunitx_table_fixed_width_bool } @@ -4193,7 +4203,10 @@ \l__siunitx_table_auto_round_bool , table-format .code:n = { - \__siunitx_table_split:nNNN {#1} + \group_begin: + \protected@edef \l__siunitx_table_tmp_tl {#1} + \exp_args:NNV \group_end: + \__siunitx_table_split:nNNN \l__siunitx_table_tmp_tl \l__siunitx_table_before_model_tl \l__siunitx_table_model_tl \l__siunitx_table_after_model_tl @@ -4968,7 +4981,7 @@ { \tl_if_head_is_N_type:nTF {#2} { \__siunitx_unit_format_literal_auxvi:nN } - { \__siunitx_unit_format_literal_auxvii:nn } + { \__siunitx_unit_format_literal_auxix:nn } {#1} #2 \q_recursion_stop } \cs_new_protected:Npx \__siunitx_unit_format_literal_auxvi:nN #1#2 @@ -4988,7 +5001,7 @@ { \str_if_eq:nnTF {#2} { \protect } { \__siunitx_unit_format_literal_auxviii:nN {#1} } - { \__siunitx_unit_format_literal_auxvi:nN {#1#2} } + { \__siunitx_unit_format_literal_auxv:nw {#1#2} } } \cs_new_protected:Npn \__siunitx_unit_format_literal_auxviii:nN #1#2 { \__siunitx_unit_format_literal_auxv:nw { #1 \protect #2 } } @@ -5025,7 +5038,7 @@ } \tl_clear:N \l__siunitx_unit_separator_tl } -\cs_new_protected:Npn \__siunitx_unit_format_literal_auxvii:nn #1#2 +\cs_new_protected:Npn \__siunitx_unit_format_literal_auxix:nn #1#2 { \__siunitx_unit_format_literal_auxvi:nN { #1 {#2} } } \tl_new:N \l__siunitx_unit_separator_tl \cs_new_protected:Npn \siunitx_unit_pdfstring_context: @@ -5962,16 +5975,20 @@ { \bool_if:NTF \l__siunitx_quantity_uncert_repeat_bool { - \siunitx_quantity_print:nV {#1#2} - \l__siunitx_quantity_unit_tl - \siunitx_quantity_print:nV { { } #3 } - \l__siunitx_quantity_unit_tl - \siunitx_print_number:n { { } #4 } + \tl_if_blank:nTF {#4} + { \__siunitx_quantity_parsed_aux:nnn {#1#2} {#3} { } } + { \__siunitx_quantity_parsed_aux:nnn {#1#2} {#3} { { } #4 } } } { \siunitx_quantity_print:nV {#1#2#3#4} \l__siunitx_quantity_unit_tl } } } } +\cs_new_protected:Npn \__siunitx_quantity_parsed_aux:nnn #1#2#3 + { + \siunitx_quantity_print:nV {#1#3} \l__siunitx_quantity_unit_tl + \tl_if_blank:nF {#2} + { \siunitx_quantity_print:nV { { } #2#3 } \l__siunitx_quantity_unit_tl } + } \cs_new_protected:Npn \__siunitx_quantity_extract_exp:nNN #1#2#3 { \__siunitx_quantity_extract_exp:nnnnnnnNN #1 #2 #3 } \cs_new_protected:Npn \__siunitx_quantity_extract_exp:nnnnnnnNN #1#2#3#4#5#6#7#8#9 @@ -6131,20 +6148,31 @@ { \siunitx_declare_unit:Nx \ohm { - \exp_not:N \ifmmode - \cs_if_exist:NTF \upOmega - { \exp_not:N \upOmega } - { \exp_not:N \Omega } - \exp_not:N \else - \exp_not:N \text - { - \bool_lazy_or:nnTF - { \sys_if_engine_luatex_p: } - { \sys_if_engine_xetex_p: } - { \__siunitx_symbol_non_latin:n { "03A9 } } - { \exp_not:N \textohm } - } - \exp_not:N \fi + \@ifpackageloaded { fourier } + { + \exp_not:N \ensuremath + { + \cs_if_exist:NTF \upOmega + { \exp_not:N \upOmega } + { \exp_not:N \Omega } + } + } + { + \exp_not:N \ifmmode + \cs_if_exist:NTF \upOmega + { \exp_not:N \upOmega } + { \exp_not:N \Omega } + \exp_not:N \else + \exp_not:N \text + { + \bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { \__siunitx_symbol_non_latin:n { "03A9 } } + { \exp_not:N \textohm } + } + \exp_not:N \fi + } } } \__siunitx_symbol_if_replace:NnT \micro { "03BC } @@ -7272,6 +7300,17 @@ \siunitx_print_number:V \l__siunitx_tmp_tl \group_end: } +\@ifpackageloaded { units } + { + \msg_new:nnn { siunitx } { units-pkg } + { + Detected~the~"units"~package: \\ + Omitting~definition~of~\token_to_str:N \unit. + } + \msg_warning:nn { siunitx } { units-pkg } + \use_none:nnnn + } + { } \NewDocumentCommand \unit { O { } > { \TrimSpaces } m } { \mode_leave_vertical: |