diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md | 16 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf | bin | 647453 -> 647146 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | bin | 705436 -> 705175 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx | 31 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx | 24 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx | 15 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 56 |
9 files changed, 103 insertions, 43 deletions
diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index fcdd23876f4..2c9d384bf93 100644 --- a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md @@ -7,6 +7,19 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.3.12] - 2024-02-15 + +### Fixed +- Normalize active `<`/`>`in numerical input (see issue + [\#355](https://github.com/josephwright/siunitx/issues/355)) +- Allow for `\protect` inside symbolic units (see issue + [\#443](https://github.com/josephwright/siunitx/issues/443)) +- Do not error for entirely empty numerical input (see issue + [\#539](https://github.com/josephwright/siunitx/issues/539)) +- Print all numerical material in math mode when + `parse-numbers = false` is set (see issue + [\#721](https://github.com/josephwright/siunitx/issues/721)) + ## [v3.3.11] - 2024-02-07 ### Fixed @@ -2067,7 +2080,8 @@ 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.3.11...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.12...HEAD +[v3.3.12]: https://github.com/josephwright/siunitx/compare/v3.3.11...v3.3.12 [v3.3.11]: https://github.com/josephwright/siunitx/compare/v3.3.10...v3.3.11 [v3.3.10]: https://github.com/josephwright/siunitx/compare/v3.3.9...v3.3.10 [v3.3.9]: https://github.com/josephwright/siunitx/compare/v3.3.8...v3.3.9 diff --git a/Master/texmf-dist/doc/latex/siunitx/README.md b/Master/texmf-dist/doc/latex/siunitx/README.md index 1288929a5d9..9b5881aead7 100644 --- a/Master/texmf-dist/doc/latex/siunitx/README.md +++ b/Master/texmf-dist/doc/latex/siunitx/README.md @@ -21,4 +21,4 @@ This package is maintained by Joseph Wright: joseph.wright@morningstar2.co.uk ## License -Released under the LaTeX Project Public License v1.3c or later. See http://www.latex-project.org/lppl.txt
\ No newline at end of file +Released under the LaTeX Project Public License v1.3c or later. See https://www.latex-project.org/lppl.txt
\ No newline at end of file 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 06b482440bc..71adbfb38c1 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.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf Binary files differindex 825cef3f2dc..3d70a9723bb 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-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx index 19e2c32e9b1..8c94cefee49 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx @@ -764,9 +764,12 @@ \bool_if:NTF \l_siunitx_number_parse_bool { \siunitx_number_parse:nN {#1} \l_@@_parsed_tl - \siunitx_number_process:NN \l_@@_parsed_tl \l_@@_parsed_tl - \tl_set:Nx \l_@@_outputted_tl - { \siunitx_number_output:N \l_@@_parsed_tl } + \tl_if_empty:NF \l_@@_parsed_tl + { + \siunitx_number_process:NN \l_@@_parsed_tl \l_@@_parsed_tl + \tl_set:Nx \l_@@_outputted_tl + { \siunitx_number_output:N \l_@@_parsed_tl } + } } { \tl_set:Nn \l_@@_outputted_tl { \ensuremath {#1} } } \exp_args:NNNV \group_end: @@ -978,16 +981,16 @@ % % \begin{macro}{\siunitx_number_normalize_symbols:N} % \begin{macro}{\@@_normalize_aux:nN} -% \begin{macro}{\@@_normalize_sign:N} +% \begin{macro}{\@@_normalize_actives:N} % \begin{variable}{\c_@@_normalize_tl} -% There are two parts to the replacement code. First, any active -% hyphens signs are normalised: these can come up with some packages and +% There are two parts to the replacement code. First, any actives +% are normalised: these can come up with some packages and % cause issues. Multi-token signs then are converted to the single token % equivalents so that everything else can work on a one token basis. % \begin{macrocode} \cs_new_protected:Npn \siunitx_number_normalize_symbols:N #1 { - \@@_normalize_minus:N #1 + \@@_normalize_actives:N #1 \exp_after:wN \@@_normalize_aux:NnN \exp_after:wN #1 \c_@@_normalize_tl { ? } \q_recursion_tail @@ -1010,10 +1013,16 @@ } \group_begin: \char_set_catcode_active:N \- - \cs_new_protected:Npx \@@_normalize_minus:N #1 + \char_set_catcode_active:N \< + \char_set_catcode_active:N \> + \cs_new_protected:Npx \@@_normalize_actives:N #1 { \tl_replace_all:Nnn #1 { \exp_not:N - } { \token_to_str:N - } + \tl_replace_all:Nnn #1 + { \exp_not:N < } { \token_to_str:N < } + \tl_replace_all:Nnn #1 + { \exp_not:N > } { \token_to_str:N > } } \group_end: % \end{macrocode} @@ -1059,8 +1068,10 @@ \tl_map_inline:Nn \l_@@_input_ignore_tl { \tl_remove_all:Nn \l_@@_arg_tl {##1} } \tl_if_empty:NF \l_@@_arg_tl - { \@@_parse_comparator: } - \@@_parse_check: + { + \@@_parse_comparator: + \@@_parse_check: + } \exp_args:NNNV \group_end: \tl_set:Nn #2 \l_@@_parsed_tl } diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx index 8d969925dd9..9cc2e6aca25 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx @@ -344,8 +344,8 @@ % Color support is always required; to avoid a potential clash we delay to % the start of the document. % \begin{macrocode} -\cs_if_exist:NTF \hook_gput_code:nnn - { \hook_gput_code:nnn { begindocument / before } { siunitx } } +\cs_if_exist:NTF \AddToHook + { \AddToHook { begindocument / before } } { \AtBeginDocument } { \RequirePackage { color } } % \end{macrocode} @@ -466,6 +466,7 @@ % \siunitx_print_unit:o % } % \begin{macro}{\@@_aux:nn} +% \begin{macro}{\@@_number:n, \@@_unit:n} % The main printing function doesn't actually need to do very much: just set % the color and select the correct sub-function. The \cs{tl_if_empty:oF} is % needed to allow a leading \texttt{1} to be omitted in the case of a unit @@ -485,19 +486,22 @@ \tl_if_empty:cTF { l_@@_ #1 _color_tl } { \use:n } { \ExpandArgs { v } \textcolor { l_@@_ #1 _color_tl } } - { - \use:c - { - siunitx_print_ - \tl_use:c { l_@@_ #1 _mode_tl } :n - } - {#2} - } + { \use:c { @@ _ #1 :n } {#2} } } } +\cs_new_protected:Npn \@@_number:n #1 + { + \bool_if:NTF \l_siunitx_number_parse_bool + { \use:c { siunitx_print_ \l_@@_number_mode_tl :n } } + { \siunitx_print_math:n } + {#1} + } +\cs_new_protected:Npn \@@_unit:n #1 + { \use:c { siunitx_print_ \l_@@_unit_mode_tl :n } {#1} } % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\siunitx_print_match:n} % When the \emph{output} mode should match the input, a simple selection of diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx index 8c94acad0e3..6c0210cec11 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% File: siunitx-unit.dtx Copyright (C) 2014-2023 Joseph Wright +% File: siunitx-unit.dtx Copyright (C) 2014-2024 Joseph Wright % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -770,13 +770,24 @@ % the approach used is to set all of the symbolic unit commands expandable % and to do nothing, with the few special cases handled manually. We expand % the input here twice: this handles the case where there is a mapping or -% similar in |#1| which returns its result in \cs{exp_not:n}. +% similar in |#1| which returns its result in \cs{exp_not:n}. In the second +% \tn{protected@edef}, changing the meaning of \tn{@unexpandable@protect} +% allows removal of a literal \cs{protect} at the top level before +% known symbolic entries: this deals with the case where the user has +% put in a \cs{protect} for some edge cases. % \begin{macrocode} \prg_new_protected_conditional:Npnn \@@_if_symbolic:n #1 { TF } { \group_begin: \bool_set_true:N \l_@@_test_bool \protected@edef \l_@@_tmp_tl {#1} + \cs_set_eq:NN \@@_saved_@unexpandable@protect: \@unexpandable@protect + \cs_set_nopar:Npn \@unexpandable@protect ##1 + { + \cs_if_exist:cF { @@_ \token_to_str:N ##1 :w } + { \@@_saved_@unexpandable@protect: } + ##1 + } \protected@edef \l_@@_tmp_tl { \l_@@_tmp_tl } \exp_args:NNV \group_end: \tl_if_blank:nTF \l_@@_tmp_tl diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 4d6874c5123..bd231a50f7e 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} {2024-02-07} {3.3.11} +\ProvidesExplPackage {siunitx} {2024-02-15} {3.3.12} {A comprehensive (SI) units package} % \end{macrocode} % diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 67ae7ed801d..62f01a64816 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -41,7 +41,7 @@ }% \endinput }% -\ProvidesExplPackage {siunitx} {2024-02-07} {3.3.11} +\ProvidesExplPackage {siunitx} {2024-02-15} {3.3.12} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -81,9 +81,12 @@ \bool_if:NTF \l_siunitx_number_parse_bool { \siunitx_number_parse:nN {#1} \l__siunitx_number_parsed_tl - \siunitx_number_process:NN \l__siunitx_number_parsed_tl \l__siunitx_number_parsed_tl - \tl_set:Nx \l__siunitx_number_outputted_tl - { \siunitx_number_output:N \l__siunitx_number_parsed_tl } + \tl_if_empty:NF \l__siunitx_number_parsed_tl + { + \siunitx_number_process:NN \l__siunitx_number_parsed_tl \l__siunitx_number_parsed_tl + \tl_set:Nx \l__siunitx_number_outputted_tl + { \siunitx_number_output:N \l__siunitx_number_parsed_tl } + } } { \tl_set:Nn \l__siunitx_number_outputted_tl { \ensuremath {#1} } } \exp_args:NNNV \group_end: @@ -150,7 +153,7 @@ \bool_new:N \l__siunitx_number_validate_bool \cs_new_protected:Npn \siunitx_number_normalize_symbols:N #1 { - \__siunitx_number_normalize_minus:N #1 + \__siunitx_number_normalize_actives:N #1 \exp_after:wN \__siunitx_number_normalize_aux:NnN \exp_after:wN #1 \c__siunitx_number_normalize_tl { ? } \q_recursion_tail @@ -173,10 +176,16 @@ } \group_begin: \char_set_catcode_active:N \- - \cs_new_protected:Npx \__siunitx_number_normalize_minus:N #1 + \char_set_catcode_active:N \< + \char_set_catcode_active:N \> + \cs_new_protected:Npx \__siunitx_number_normalize_actives:N #1 { \tl_replace_all:Nnn #1 { \exp_not:N - } { \token_to_str:N - } + \tl_replace_all:Nnn #1 + { \exp_not:N < } { \token_to_str:N < } + \tl_replace_all:Nnn #1 + { \exp_not:N > } { \token_to_str:N > } } \group_end: \cs_new_protected:Npn \siunitx_number_parse:nN #1#2 @@ -208,8 +217,10 @@ \tl_map_inline:Nn \l__siunitx_number_input_ignore_tl { \tl_remove_all:Nn \l__siunitx_number_arg_tl {##1} } \tl_if_empty:NF \l__siunitx_number_arg_tl - { \__siunitx_number_parse_comparator: } - \__siunitx_number_parse_check: + { + \__siunitx_number_parse_comparator: + \__siunitx_number_parse_check: + } \exp_args:NNNV \group_end: \tl_set:Nn #2 \l__siunitx_number_parsed_tl } @@ -4741,8 +4752,8 @@ } \RequirePackage { amstext } \cs_new_eq:NN \__siunitx_print_ams_text:n \text -\cs_if_exist:NTF \hook_gput_code:nnn - { \hook_gput_code:nnn { begindocument / before } { siunitx } } +\cs_if_exist:NTF \AddToHook + { \AddToHook { begindocument / before } } { \AtBeginDocument } { \RequirePackage { color } } \cs_generate_variant:Nn \tl_replace_all:Nnn { NV } @@ -4817,16 +4828,18 @@ \tl_if_empty:cTF { l__siunitx_print_ #1 _color_tl } { \use:n } { \ExpandArgs { v } \textcolor { l__siunitx_print_ #1 _color_tl } } - { - \use:c - { - siunitx_print_ - \tl_use:c { l__siunitx_print_ #1 _mode_tl } :n - } - {#2} - } + { \use:c { __siunitx_print _ #1 :n } {#2} } } } +\cs_new_protected:Npn \__siunitx_print_number:n #1 + { + \bool_if:NTF \l_siunitx_number_parse_bool + { \use:c { siunitx_print_ \l__siunitx_print_number_mode_tl :n } } + { \siunitx_print_math:n } + {#1} + } +\cs_new_protected:Npn \__siunitx_print_unit:n #1 + { \use:c { siunitx_print_ \l__siunitx_print_unit_mode_tl :n } {#1} } \cs_new_protected:Npn \siunitx_print_match:n #1 { \mode_if_math:TF @@ -6247,6 +6260,13 @@ \group_begin: \bool_set_true:N \l__siunitx_unit_test_bool \protected@edef \l__siunitx_unit_tmp_tl {#1} + \cs_set_eq:NN \__siunitx_unit_saved_@unexpandable@protect: \@unexpandable@protect + \cs_set_nopar:Npn \@unexpandable@protect ##1 + { + \cs_if_exist:cF { __siunitx_unit_ \token_to_str:N ##1 :w } + { \__siunitx_unit_saved_@unexpandable@protect: } + ##1 + } \protected@edef \l__siunitx_unit_tmp_tl { \l__siunitx_unit_tmp_tl } \exp_args:NNV \group_end: \tl_if_blank:nTF \l__siunitx_unit_tmp_tl |