summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-25 03:01:10 +0000
committerNorbert Preining <norbert@preining.info>2021-05-25 03:01:10 +0000
commit07dc96bc3bbd691fc52aca15a172eaf41a89d873 (patch)
treeeb7c276d652209d0d5eb4448b07aaadd440aa4c7 /macros/latex/contrib/siunitx
parent5f0d648973cab5784f4bdb361bbe261b60493432 (diff)
CTAN sync 202105250301
Diffstat (limited to 'macros/latex/contrib/siunitx')
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md15
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin1441845 -> 1443594 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-compound.dtx67
-rw-r--r--macros/latex/contrib/siunitx/siunitx-emulation.dtx3
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx6
-rw-r--r--macros/latex/contrib/siunitx/siunitx-print.dtx75
-rw-r--r--macros/latex/contrib/siunitx/siunitx-table.dtx4
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin605308 -> 598400 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex2
10 files changed, 104 insertions, 70 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index 093b87bada..a473e9cd49 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,18 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.0.5]
+
+### Changed
+- Documentation improvements
+
+### Fixed
+- Bracket separate uncertainties in compound quantities
+ (issue #441)
+- Color negative values in table cells correctly (issue #444)
+- Avoid consumption of any math alphabets (issue #445)
+- Mark `\bar` as removed (issue #448)
+
## [v3.0.4]
### Changed
@@ -1289,7 +1301,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.4...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.5...HEAD
+[v3.0.5]: https://github.com/josephwright/siunitx/compare/v3.0.4...v3.0.5
[v3.0.4]: https://github.com/josephwright/siunitx/compare/v3.0.3...v3.0.4
[v3.0.3]: https://github.com/josephwright/siunitx/compare/v3.0.2...v3.0.3
[v3.0.2]: https://github.com/josephwright/siunitx/compare/v3.0.1...v3.0.2
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index 718aeef446..d8f5d6536e 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-compound.dtx b/macros/latex/contrib/siunitx/siunitx-compound.dtx
index 83da873e6c..a164d883b7 100644
--- a/macros/latex/contrib/siunitx/siunitx-compound.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-compound.dtx
@@ -310,8 +310,9 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_unit_tl}
+% \begin{variable}{\l_@@_unit_bool, \l_@@_unit_tl}
% \begin{macrocode}
+\bool_new:N \l_@@_unit_bool
\tl_new:N \l_@@_unit_tl
% \end{macrocode}
% \end{variable}
@@ -412,6 +413,7 @@
%
% \begin{macro}{\siunitx_compound_number:n}
% \begin{macro}{\@@_format:n}
+% \begin{macro}{\@@_format:nn}
% \begin{macro}{\@@_format:nnn}
% Printing a generic set starts with the question of whether we want to
% extract exponents. If we do, then there is the work to do with extraction.
@@ -421,6 +423,7 @@
\cs_new_protected:Npn \siunitx_compound_number:n #1
{
\group_begin:
+ \bool_set_false:N \l_@@_unit_bool
\@@_format:nn {#1} { }
\@@_print:N \siunitx_print_number:x
\group_end:
@@ -445,16 +448,25 @@
\cs_new_protected:Npn \@@_format:nnn #1#2#3
{
\siunitx_number_parse:nN {#1} \l_@@_tmp_tl
- \tl_if_blank:nTF {#3}
- { \siunitx_number_process:NN \l_@@_tmp_tl \l_@@_first_tl }
+ \bool_if:NTF \l_@@_unit_bool
{ \@@_format_units:nn {#2} {#3} }
+ { \siunitx_number_process:NN \l_@@_tmp_tl \l_@@_first_tl }
\bool_lazy_and:nnTF
{ \l_@@_exp_combine_bool }
{ \int_compare_p:nNn { \tl_count:n {#2} } > 0 }
{ \@@_extract_exponents: }
{
- \tl_set:Nx \l_@@_tmp_tl
- { \siunitx_number_output:N \l_@@_first_tl }
+ \bool_if:NTF \l_@@_unit_bool
+ {
+ \tl_set:Nx \l_@@_tmp_tl
+ { \siunitx_number_output:NN \l_@@_first_tl \q_nil }
+ \tl_set:Nx \l_@@_tmp_tl
+ { \@@_uncert_bracket:N \l_@@_tmp_tl }
+ }
+ {
+ \tl_set:Nx \l_@@_tmp_tl
+ { \siunitx_number_output:N \l_@@_first_tl }
+ }
\seq_put_right:NV \l_@@_tmp_seq \l_@@_tmp_tl
}
\tl_map_function:nN {#2} \@@_parsed:n
@@ -464,7 +476,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_extract_exponents:N}
+% \begin{macro}{\@@_extract_exponents:}
% \begin{macro}{\@@_extract_exponents_auxi:w}
% \begin{macro}{\@@_extract_exponents_auxii:nw}
% \begin{macro}{\@@_extract_exponents_auxiii:nnnnnnn}
@@ -508,13 +520,23 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_parsed:n, \@@_unparsed:n}
% The simple cases for parsing (or not) all entries.
% \begin{macrocode}
\cs_new_protected:Npn \@@_parsed:n #1
{
- \siunitx_number_format:nN {#1} \l_@@_tmp_tl
+ \bool_if:NTF \l_@@_unit_bool
+ {
+ \siunitx_number_parse:nN {#1} \l_@@_tmp_tl
+ \siunitx_number_process:NN \l_@@_tmp_tl \l_@@_tmp_tl
+ \tl_set:Nx \l_@@_tmp_tl
+ { \siunitx_number_output:NN \l_@@_tmp_tl \q_nil }
+ \tl_set:Nx \l_@@_tmp_tl
+ { \@@_uncert_bracket:N \l_@@_tmp_tl }
+ }
+ { \siunitx_number_format:nN {#1} \l_@@_tmp_tl }
\seq_put_right:NV \l_@@_tmp_seq \l_@@_tmp_tl
}
\cs_new_protected:Npn \@@_unparsed:n #1
@@ -642,6 +664,7 @@
{ \l_@@_unit_bracket_bool }
{ ! \l_@@_unit_repeat_bool }
{ \bool_set_false:N \l_siunitx_number_bracket_ambiguous_bool }
+ \bool_set_true:N \l_@@_unit_bool
\@@_format:nn {#1} {#2}
\str_if_eq:VnT \l_siunitx_quantity_prefix_mode_tl { combine-exponent }
{ \tl_clear:N \l_@@_exp_tl }
@@ -785,6 +808,36 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}[EXP]{\@@_uncert_bracket:N}
+% \begin{macro}[EXP]{\@@_uncert_bracket:w}
+% \begin{macro}[EXP]{\@@_uncert_bracket:nnw}
+% Check for the case where there is a separate uncertainty but not exponent,
+% when we are handling units.
+% \begin{macrocode}
+\cs_new:Npn \@@_uncert_bracket:N #1
+ { \exp_after:wN \@@_uncert_bracket:w #1 \q_stop }
+\cs_new:Npn \@@_uncert_bracket:w
+ #1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_nil #7 \q_nil
+ #8 \q_nil #9 \q_stop
+ { \@@_uncert_bracket:nnw {#1#2#3#4#5#6} {#7#8} #9 \q_stop }
+\cs_new:Npn \@@_uncert_bracket:nnw #1#2 #3 \q_nil #4 \q_nil #5 \q_stop
+ {
+ \bool_lazy_or:nnTF
+ { \tl_if_blank_p:n {#2#3} }
+ { ! \tl_if_blank_p:n {#5} }
+ { \exp_not:n {#1#2#3#4#5} }
+ {
+ \exp_not:V \l_@@_bracket_open_tl
+ \exp_not:n {#1#2#3}
+ \exp_not:V \l_@@_bracket_close_tl
+ \exp_not:n {#4#5}
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Lists}
%
% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
diff --git a/macros/latex/contrib/siunitx/siunitx-emulation.dtx b/macros/latex/contrib/siunitx/siunitx-emulation.dtx
index 4ae6cd1590..48648e3c13 100644
--- a/macros/latex/contrib/siunitx/siunitx-emulation.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-emulation.dtx
@@ -1002,12 +1002,13 @@
{
\angstrom ,
\atomicmassunit ,
+ \bar ,
\bohr ,
\clight ,
\electronmass ,
\elementarycharge ,
\hartree ,
- \plackbar
+ \planckbar
}
{
\siunitx_declare_unit:Nx #1
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index dec433df02..67c9580ca6 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -472,12 +472,6 @@
% \end{syntax}
% \end{function}
%
-% \begin{function}{separate-uncertainty}
-% \begin{syntax}
-% |separate-uncertainty| = |true|\verb"|"|false|
-% \end{syntax}
-% \end{function}
-%
% \begin{function}{tight-spacing}
% \begin{syntax}
% |tight-spacing| = |true|\verb"|"|false|
diff --git a/macros/latex/contrib/siunitx/siunitx-print.dtx b/macros/latex/contrib/siunitx/siunitx-print.dtx
index 8cdc068b91..cc26177ef1 100644
--- a/macros/latex/contrib/siunitx/siunitx-print.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-print.dtx
@@ -82,6 +82,9 @@
% in text mode
% \item \pkg{amstext}: the \cs{text} command for printing in text mode
% \end{itemize}
+% For detection of math mode fonts, as well as \cs{mathrm}, the existence of
+% \cs{symoperators} is assumed; other math font commands are not
+% \emph{required} to exist.
%
% \begin{function}
% {
@@ -317,52 +320,13 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}{\l_@@_tmp_box, \l_@@_tmp_tl}
+% \begin{variable}{\l_@@_tmp_tl}
% Scratch space.
% \begin{macrocode}
-\box_new:N \l_@@_tmp_box
\tl_new:N \l_@@_tmp_tl
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\document}
-% \begin{macro}{\@@_store_fam:n}
-% \begin{variable}{\c_@@_mathrm_int, \c_@@_mathsf_int, \c_@@_mathtt_int}
-% In order to test math fonts, we need information about the \cs{fam} used
-% by the various options. As we are doing typesetting (if only in a box), we
-% need to be right at the start of the document: this also avoids any issue
-% with \pkg{fontspec}. With a sufficiently recent \LaTeXe{} this is easy;
-% for older kernels, we have to do things manually.
-% \begin{macrocode}
-\IfFormatAtLeastTF { 2020-10-01 }
- { \hook_gput_code:nnn { begindocument/end } { siunitx } }
- { \tl_put_right:Nn \document }
- {
- \@@_store_fam:n { rm }
- \@@_store_fam:n { sf }
- \@@_store_fam:n { tt }
- }
-\IfFormatAtLeastTF { 2020-10-01 }
- { }
- { \tl_put_right:Nn \document { \ignorespaces } }
-\cs_new_protected:Npn \@@_store_fam:n #1
- {
- \group_begin:
- \hbox_set:Nn \l_@@_tmp_box
- {
- \ensuremath
- {
- \use:c { math #1 }
- { \int_const:cn { c_@@_math #1 _int } { \fam } }
- }
- }
- \group_end:
- }
-% \end{macrocode}
-% \end{variable}
-% \end{macro}
-% \end{macro}
-%
% \subsection{Printing routines}
%
% \begin{variable}
@@ -559,6 +523,8 @@
% \@@_math_auxiv:n,
% \@@_math_auxv:n
% }
+% \begin{macro}{\@@_math_aux:N}
+% \begin{macro}{\@@_math_aux:w}
% \begin{macro}{\@@_math_aux:Nn, \@@_math_aux:cn}
% \begin{macro}{\@@_math_sub:n, \@@_math_super:n, \@@_math_script:n}
% \begin{macro}{\@@_math_text:n}
@@ -656,20 +622,12 @@
% cases. First, we are retaining the current math font, and the active one is
% \cs{mathsf} or \cs{mathtt}: that needs to be applied to the argument.
% Alternatively, if the current font is not retained, ensure that
-% normal math mode rules are active. The parts here are split up to allow
-% reuse when picking up the text family.
+% normal math mode rules are active.
% \begin{macrocode}
\cs_new_protected:Npn \@@_math_auxiv:n #1
{
\bool_if:NTF \l_@@_math_font_bool
- {
- \int_case:nnF \fam
- {
- \c_@@_mathsf_int { \@@_math_aux:Nn \mathsf }
- \c_@@_mathtt_int { \@@_math_aux:Nn \mathtt }
- }
- { \use:n }
- }
+ { \@@_math_aux:N \mathsf \mathtt \q_recursion_tail \q_recursion_stop }
{ \@@_math_auxv:n }
{#1}
}
@@ -677,11 +635,24 @@
{
\bool_lazy_or:nnTF
{ \int_compare_p:nNn \fam = { -1 } }
- { \int_compare_p:nNn \fam = \c_@@_mathrm_int }
+ { \int_compare_p:nNn \fam = \symoperators }
{ \use:n }
{ \mathrm }
{#1}
}
+\cs_new_protected:Npn \@@_math_aux:N #1
+ {
+ \quark_if_recursion_tail_stop_do:Nn #1 { \use:n }
+ \exp_after:wN \exp_after:wN \exp_after:wN \@@_math_aux:w
+ \cs:w \cs_to_str:N #1 \c_space_tl \cs_end:
+ \use@mathgroup ? { -2 } \q_stop #1
+ }
+\cs_new_protected:Npn \@@_math_aux:w #1 \use@mathgroup #2#3 #4 \q_stop #5
+ {
+ \int_compare:nNnTF \fam = {#3}
+ { \use_i_delimit_by_q_recursion_stop:nw { \@@_math_aux:Nn #5 } }
+ { \@@_math_aux:N }
+ }
% \end{macrocode}
% Search-and-replace fun: deal with any font commands in the argument and
% also inside sub/superscripts.
@@ -744,6 +715,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\siunitx_print_text:n}
% \begin{macro}{\@@_text_replace:n}
diff --git a/macros/latex/contrib/siunitx/siunitx-table.dtx b/macros/latex/contrib/siunitx/siunitx-table.dtx
index 3f8673c2fc..c033090022 100644
--- a/macros/latex/contrib/siunitx/siunitx-table.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-table.dtx
@@ -1196,7 +1196,6 @@
\exp_not:N \q_mark
\siunitx_number_output:NN \l_@@_tmp_tl \q_nil
}
- \@@_color_check:N \l_@@_tmp_tl
\exp_after:wN \@@_print_format_auxi:w
\l_@@_tmp_tl \q_stop
\hbox_set:Nn \l_@@_tmp_box { \l_@@_after_model_tl }
@@ -1213,7 +1212,7 @@
\box_use_drop:N \l_@@_before_box
\box_use_drop:N \l_@@_integer_box
\box_use_drop:N \l_@@_decimal_box
- \box_use_drop:N \l_@@_after_box
+ \box_use_drop:N \l_@@_after_box
}
}
\cs_new:Npn \@@_print_format:nnnnnn #1#2#3#4#5#6#7
@@ -1226,6 +1225,7 @@
\cs_new_protected:Npn \@@_print_format_auxi:w
#1 \q_nil #2 \q_mark #3 \q_nil #4 \q_stop
{
+ \@@_color_check:w #3 \q_nil \q_stop
\@@_print_format_box:Nn \l_@@_tmp_box {#1}
\bool_if:NTF \l_@@_align_before_bool
{
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 40ba293d81..7c75d7a983 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-21} {3.0.4}
+\ProvidesExplPackage {siunitx} {2021-05-24} {3.0.5}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 3a8e7d0277..3632749811 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex
index 857a1569a6..8af64c2708 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -451,7 +451,7 @@ The \meta{number} and \meta{unit} arguments work exactly like those for the
It is possible to set up the unit macros to be available outside of the
\cs{qty} and \cs{unit} functions. This is not the standard behaviour as there
-is the risk of name clashes (for example, \cs{bar} is used by other packages,
+is the risk of name clashes (for example, \cs{day} is a \TeX{} primitive
and several packages define \cs{degree}). Full details of using \enquote{stand
alone} units are found in \ref{sec:units:creating}.