diff options
author | Norbert Preining <norbert@preining.info> | 2021-05-20 03:00:38 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-05-20 03:00:38 +0000 |
commit | 6d6c3b4ee419b9f485a213d2ece28b06e9ca2f7c (patch) | |
tree | 243789c085bcb650c397f86eeaaddbc45ca92dff /macros/latex/contrib/siunitx | |
parent | 94c996b5f40175b4a858ddd1f19e3947198b9bd0 (diff) |
CTAN sync 202105200300
Diffstat (limited to 'macros/latex/contrib/siunitx')
-rw-r--r-- | macros/latex/contrib/siunitx/CHANGELOG.md | 20 | ||||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-code.pdf | bin | 1432693 -> 1437526 bytes | |||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-emulation.dtx | 19 | ||||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-emulation.pdf | bin | 0 -> 484705 bytes | |||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-number.dtx | 19 | ||||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-symbol.dtx | 32 | ||||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-table.dtx | 67 | ||||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx.dtx | 2 | ||||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx.pdf | bin | 601047 -> 600972 bytes | |||
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx.tex | 4 |
10 files changed, 131 insertions, 32 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md index 958d0b50d6..dc30ec5d79 100644 --- a/macros/latex/contrib/siunitx/CHANGELOG.md +++ b/macros/latex/contrib/siunitx/CHANGELOG.md @@ -7,6 +7,23 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.0.2] + +### Changed +- Documentation improvements +- Better default for `product-symbol` + +### Fixed +- Option settings `group-digits = true` and `group-digits = false` (issue #422) +- Correct position of decimal marker in some tables (issue #423) +- Coloring of negative numbers in tables (issue #424) +- Alignment of numbers when printing without a `table-format` (issue #424) +- Emulation of `\celsius` (issue #426) +- Allow `\cdot` to work in text mode (issue #430) + +### Deprecated +- Unit macro `\celsius` + ## [v3.0.1] ### Added @@ -1253,7 +1270,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.0.1...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.2...HEAD +[v3.0.2]: https://github.com/josephwright/siunitx/compare/v3.0.1...v3.0.2 [v3.0.1]: https://github.com/josephwright/siunitx/compare/v3.0.0...v3.0.1 [v3.0.0]: https://github.com/josephwright/siunitx/compare/v2.8e...v3.0.0 [v2.8e]: https://github.com/josephwright/siunitx/compare/v2.8d...v2.8e diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf Binary files differindex dd338db3ac..ca24d4d13e 100644 --- a/macros/latex/contrib/siunitx/siunitx-code.pdf +++ b/macros/latex/contrib/siunitx/siunitx-code.pdf diff --git a/macros/latex/contrib/siunitx/siunitx-emulation.dtx b/macros/latex/contrib/siunitx/siunitx-emulation.dtx index 40f145a6c6..5287f2c8cf 100644 --- a/macros/latex/contrib/siunitx/siunitx-emulation.dtx +++ b/macros/latex/contrib/siunitx/siunitx-emulation.dtx @@ -346,6 +346,18 @@ % \begin{macrocode} \keys_define:nn { siunitx } { + group-digits / false .code:n = + { + \@@_option_deprecated:nn + { group-digits ~ = ~ false } + { group-digits ~ = ~ none } + } , + group-digits / true .code:n = + { + \@@_option_deprecated:nn + { group-digits ~ = ~ true } + { group-digits ~ = ~ all } + } , separate-uncertainty .choice: , separate-uncertainty / false .code:n = { @@ -965,6 +977,13 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\celsius} +% Deprecated but should work. +% \begin{macrocode} +\siunitx_declare_unit:Nn \celsius { \degreeCelsius } +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} %</interfaces> % \end{macrocode} diff --git a/macros/latex/contrib/siunitx/siunitx-emulation.pdf b/macros/latex/contrib/siunitx/siunitx-emulation.pdf Binary files differnew file mode 100644 index 0000000000..b439f74a67 --- /dev/null +++ b/macros/latex/contrib/siunitx/siunitx-emulation.pdf diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx index adc798fb2c..45f8ad2562 100644 --- a/macros/latex/contrib/siunitx/siunitx-number.dtx +++ b/macros/latex/contrib/siunitx/siunitx-number.dtx @@ -59,6 +59,17 @@ % % \begin{documentation} % +% This submodule is dedicated to parsing and formatting numbers. A small number +% of \LaTeXe{} math mode commands are assumed to be available as part of the +% formatted output. The sign commands \cs{mp}, \cs{pm}, \cs{ll}, \cs{le}, +% \cs{gg} and \cs{ge} are used to replace two-character input; \cs{pm} +% is also required for the output of uncertainties. The standard settings +% require \cs{times}. For the display of colored negative numbers, the command +% \cs{color} is assumed to be available. Where the latter may apply, numbers +% should be printed inside a group: note that \TeX{} grouping is not added +% \emph{within} formatted numbers as they may need to be decomposed into parts +% (see \cs{siunitx_number_output:NN}). +% % \section{Formatting numbers} % % \begin{function}{\siunitx_number_parse:nN, \siunitx_number_parse:VN} @@ -3085,11 +3096,9 @@ \cs_new:Npn \@@_output_sign_color:w #1 \@@_output_end: { - \exp_not:N \textcolor { \exp_not:V \l_@@_negative_color_tl } - { - #1 - \@@_output_end: - } + \exp_not:N \color { \exp_not:V \l_@@_negative_color_tl } + #1 + \@@_output_end: } \cs_new:Npn \@@_output_sign_brackets:w #1 \@@_output_end: diff --git a/macros/latex/contrib/siunitx/siunitx-symbol.dtx b/macros/latex/contrib/siunitx/siunitx-symbol.dtx index 6d67c5a29d..1307e2ee0b 100644 --- a/macros/latex/contrib/siunitx/siunitx-symbol.dtx +++ b/macros/latex/contrib/siunitx/siunitx-symbol.dtx @@ -259,6 +259,8 @@ % same as |\textmu| support. It's hard to check for the product symbol, so % we just go with it an hope for the best! % \begin{macrocode} +\keys_set:nn { siunitx } + { product-symbol = \ifmmode \times \else \texttimes \fi } \AtBeginDocument { \group_begin: @@ -273,12 +275,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_@@_tmpb_tl { 2 \cdot 10 ^ { 1 } } + \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl + { + \group_end: + \keys_set:nn { siunitx } + { + exponent-product = + \ifmmode \cdot \else \textperiodcentered \fi + } + } + { \group_end: } + } + \group_begin: + \tl_set:Nn \l_@@_tmpa_tl { \mathrm { m } \cdot \mathrm { s } } + \tl_set:Nn \l_siunitx_unit_font_tl { \mathrm } + \siunitx_unit_format:nN { m . s } \l_@@_tmpb_tl + \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl + { + \group_end: + \keys_set:nn { siunitx } + { + inter-unit-product = + \ifmmode \cdot \else \textperiodcentered \fi + } + } + { \group_end: } } % \end{macrocode} % diff --git a/macros/latex/contrib/siunitx/siunitx-table.dtx b/macros/latex/contrib/siunitx/siunitx-table.dtx index d16d2d7780..430a715710 100644 --- a/macros/latex/contrib/siunitx/siunitx-table.dtx +++ b/macros/latex/contrib/siunitx/siunitx-table.dtx @@ -315,7 +315,8 @@ % % \begin{macro}{\@@_collect_loop:} % \begin{macro}{\@@_collect_group:n} -% \begin{macro}{\@@_collect_token:N} +% \begin{macro}{\@@_collect_token:N, \@@_collect_token_aux:N} +% \begin{macro}{\@@_collect_relax:N} % \begin{macro}{\@@_collect_search:NnF} % \begin{macro}{\@@_collect_search_aux:NNn} % Collecting up the cell content needs a loop: this is done using @@ -325,7 +326,8 @@ % (\foreign{cf.}~the approach in \pkg{collcell}): the special cases are % pulled out for manual handling. The flexible lookup approach is more-or-less % the same idea as in the kernel |case| functions. The |\relax| special case -% covers the case where |\\| has been expanded in an empty cell. +% covers the case where |\\| has been expanded in an empty cell. This has to +% be an explicit token as we can get the same meaning from |\protect|. % \begin{macrocode} \cs_new_protected:Npn \@@_collect_loop: { @@ -344,14 +346,22 @@ { \unskip { \@@_collect_loop: } \end { \tabularnewline \end } - \relax { \relax } + \relax { \@@_collect_relax:N #1 } \tabularnewline { \tabularnewline } \siunitx_cell_end: { \siunitx_cell_end: } } - { - \tl_put_right:Nn \l_@@_collect_tl {#1} - \@@_collect_loop: - } + { \@@_collect_token_aux:N #1 } + } +\cs_new_protected:Npn \@@_collect_token_aux:N #1 + { + \tl_put_right:Nn \l_@@_collect_tl {#1} + \@@_collect_loop: + } +\cs_new_protected:Npn \@@_collect_relax:N #1 + { + \str_if_eq:nnTF {#1} { \relax } + { \relax } + { \@@_collect_token_aux:N #1 } } \AtBeginDocument { @@ -365,14 +375,11 @@ \tab@setcr { \@@_collect_loop: } \unskip { \@@_collect_loop: } \end { \tabularnewline \end } - \relax { \relax } + \relax { \@@_collect_relax:N #1 } \tabularnewline { \tabularnewline } \siunitx_cell_end: { \siunitx_cell_end: } } - { - \tl_put_right:Nn \l_@@_collect_tl {#1} - \@@_collect_loop: - } + { \@@_collect_token_aux:N #1 } } } { } @@ -396,6 +403,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \subsection{Separating collected material} % @@ -682,16 +690,26 @@ % \begin{macro}{\@@_center_marker:} % When centering on the decimal marker, the easiest approach is to simply % re-box the two parts. That is needed whether or not we are parsing numbers, -% so is best as a short auxiliary. +% so is best as a short auxiliary. Notice that we need to allow for the width +% of the decimal marker itself. % \begin{macrocode} \cs_new_protected:Npn \@@_center_marker: { + \hbox_set:Nn \l_@@_tmp_box + { \ensuremath { \mathord { \l_siunitx_number_output_decimal_tl } } } \dim_compare:nNnTF { \box_wd:N \l_@@_integer_box } - > { \box_wd:N \l_@@_decimal_box } + > + { + \box_wd:N \l_@@_decimal_box + - \box_wd:N \l_@@_tmp_box + } { \hbox_set_to_wd:Nnn \l_@@_decimal_box - { \box_wd:N \l_@@_integer_box } + { + \box_wd:N \l_@@_integer_box + + \box_wd:N \l_@@_tmp_box + } { \hbox_unpack:N \l_@@_decimal_box \@@_fil: @@ -699,7 +717,10 @@ } { \hbox_set_to_wd:Nnn \l_@@_integer_box - { \box_wd:N \l_@@_decimal_box } + { + \box_wd:N \l_@@_decimal_box + - \box_wd:N \l_@@_tmp_box + } { \@@_fil: \hbox_unpack:N \l_@@_integer_box @@ -903,8 +924,11 @@ \c_math_toggle_token \hbox_set_end: \@@_center_marker: - \box_use_drop:N \l_@@_integer_box - \box_use_drop:N \l_@@_decimal_box + \use:c { @@_align_ \l_@@_align_text_tl :n } + { + \box_use_drop:N \l_@@_integer_box + \box_use_drop:N \l_@@_decimal_box + } } % \end{macrocode} % For the version where there is space reserved, first format and decompose @@ -1093,8 +1117,11 @@ { \@@_print_marker_aux:w #4 } } \@@_center_marker: - \box_use_drop:N \l_@@_integer_box - \box_use_drop:N \l_@@_decimal_box + \use:c { @@_align_ \l_@@_align_text_tl :n } + { + \box_use_drop:N \l_@@_integer_box + \box_use_drop:N \l_@@_decimal_box + } } \cs_new:Npn \@@_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 diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx index 99932bd943..9e4705dd4d 100644 --- a/macros/latex/contrib/siunitx/siunitx.dtx +++ b/macros/latex/contrib/siunitx/siunitx.dtx @@ -121,7 +121,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2021-05-18} {3.0.1} +\ProvidesExplPackage {siunitx} {2021-05-19} {3.0.2} {A comprehensive (SI) units package} % \end{macrocode} % diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf Binary files differindex d09687fc0d..9a362bf17c 100644 --- a/macros/latex/contrib/siunitx/siunitx.pdf +++ b/macros/latex/contrib/siunitx/siunitx.pdf diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex index 2fc9e465d0..e7035ee5c8 100644 --- a/macros/latex/contrib/siunitx/siunitx.tex +++ b/macros/latex/contrib/siunitx/siunitx.tex @@ -481,7 +481,7 @@ Runs of products of of numbers with units can be handled using the \begin{function}{\qtyrange} \begin{syntax} - \cs{qtyrange}\oarg{options}\marg{number1}\meta{number2}\marg{unit} + \cs{qtyrange}\oarg{options}\marg{number1}\marg{number2}\marg{unit} \end{syntax} \end{function} Products of numbers with units can be handled using the \cs{qtyrange} @@ -3567,7 +3567,7 @@ unzip this in your local \path{texmf} directory. The package requires \LaTeX3 support as provided in the \pkg{l3kernel} and \pkg{l3packages} bundles. Both of these are included in \TeX{} Live and -MiK\TeX{}, or are again available in ready-to-install form from \acro{CTAN}. +MiK\TeX{}, or are again available in ready-to-install from \acro{CTAN}. \section{Thanks} |