texlive[73053] Master/texmf-dist: siunitx (6dec24)
commits+karl at tug.org
commits+karl at tug.org
Fri Dec 6 23:32:28 CET 2024
Revision: 73053
https://tug.org/svn/texlive?view=revision&revision=73053
Author: karl
Date: 2024-12-06 23:32:28 +0100 (Fri, 06 Dec 2024)
Log Message:
-----------
siunitx (6dec24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-command.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
Modified: trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md 2024-12-06 22:32:28 UTC (rev 73053)
@@ -7,8 +7,44 @@
## [Unreleased]
+## [v3.4.0] - 2024-12-06
+
+### Added
+- Option `simplify-uncertainty` (see issue
+ [\#688](https://github.com/josephwright/siunitx/issues/688))
+- Option `complex-phase-command` (see issue
+ [\#732](https://github.com/josephwright/siunitx/issues/732))
+- Option `allow-uncertainty-breaks` (see issue
+ [\#753](https://github.com/josephwright/siunitx/issues/753))
+- `\siunitx_unit_options_declare:Nn` to support fine-tuning of unit commands
+
+### Changed
+- Extend automatic range phase coverage to Italian (see issue
+ [\#650](https://github.com/josephwright/siunitx/issues/650))
+ - Allow control of zero-filling when integer angles are converted to arc
+ format (see issue
+ [\#685](https://github.com/josephwright/siunitx/issues/685))
+- Automatically convert `~` to `\sim` (see issue
+ [\#746](https://github.com/josephwright/siunitx/issues/746))
+- Support uncertainties in seconds part of arc angles (see issue
+ [\#749](https://github.com/josephwright/siunitx/issues/749))
+- Require LaTeX release 2022-11-01 or later
+- Typeset documentation with LuaTeX
+- Support `unicode-math` definitions for non-letter characters
+
+### Deprecated
+
+- Option `number-angle-product`in favor of using settings applying to relevant
+ units
+- Option `complex-symbol-angle` in favor of `complex-phase-command`
+
+### Fixed
+- Conversion of 'bare' i to polar form (see issue
+ [\#761](https://github.com/josephwright/siunitx/issues/761))
+
## [v3.3.24] - 2024-11-19
+### Fixed
- Stack exhaustion with `tabularray` (see issue
[\#760](https://github.com/josephwright/siunitx/issues/760))
@@ -55,12 +91,14 @@
## [v3.3.19] - 2024-06-24
### Fixed
-- Add \textonly at unskip` to special tokens to cell content (see issue [\#737](https://github.com/josephwright/siunitx/issues/737))
+- Add \textonly at unskip` to special tokens to cell content (see issue
+ [\#737](https://github.com/josephwright/siunitx/issues/737))
## [v3.3.18] - 2024-06-14
### Fixed
-- Use `fill` glue for aligning comparators (see issue [\#733](https://github.com/josephwright/siunitx/issues/733))
+- Use `fill` glue for aligning comparators (see issue
+ [\#733](https://github.com/josephwright/siunitx/issues/733))
## [v3.3.17] - 2024-05-06
@@ -2165,7 +2203,8 @@
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.24...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.4.0...HEAD
+[v3.4.0]: https://github.com/josephwright/siunitx/compare/v3.3.24...v3.4.0
[v3.3.24]: https://github.com/josephwright/siunitx/compare/v3.3.23...v3.3.24
[v3.3.23]: https://github.com/josephwright/siunitx/compare/v3.3.22...v3.3.23
[v3.3.22]: https://github.com/josephwright/siunitx/compare/v3.3.21...v3.3.22
Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -149,14 +149,6 @@
% arc. The standard setting is |false|.
% \end{function}
%
-% \begin{function}{number-angle-product}
-% \begin{syntax}
-% |number-angle-product| = \meta{separator}
-% \end{syntax}
-% Inserted between the value of an angle and the unit (degree, minute or
-% second component). The standard setting is |\,|.
-% \end{function}
-%
% \end{documentation}
%
% \begin{implementation}
@@ -168,8 +160,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_angle>
% \end{macrocode}
@@ -194,8 +185,7 @@
% \l_@@_separator_tl ,
% \l_@@_fill_degrees_bool ,
% \l_@@_fill_minutes_bool ,
-% \l_@@_fill_seconds_bool ,
-% \l_@@_product_tl
+% \l_@@_fill_seconds_bool
% }
% \begin{macrocode}
\keys_define:nn { siunitx }
@@ -232,8 +222,6 @@
\l_@@_fill_minutes_bool ,
fill-angle-seconds .bool_set:N =
\l_@@_fill_seconds_bool ,
- number-angle-product .tl_set:N =
- \l_@@_product_tl
}
\bool_new:N \l_@@_force_arc_bool
\bool_new:N \l_@@_force_decimal_bool
@@ -243,6 +231,7 @@
% \begin{macro}{\siunitx_angle:n, \siunitx_angle:e, \@@_angle:n}
% \begin{macro}{\siunitx_angle:nnn, \siunitx_angle:eee}
% \begin{macro}{\@@_arc_convert:n, \@@_arc_convert:e}
+% \begin{macro}{\@@_arc_convert:w}
% The first step here is to force format conversion if required. Going to
% a decimal is easy, going to arc format is a bit more painful: avoid
% repeating calculations mainly for code readability.
@@ -285,7 +274,7 @@
\bool_if:NTF \l_@@_force_decimal_bool
{
\siunitx_angle:e
- { \fp_eval:n { #1 + (#2) / 60 + (#3) / 3600 } }
+ { \fp_eval:n { #1 + ( 0 #2 ) / 60 + ( 0 #3 ) / 3600 } }
}
{ \@@_arc_sign:nnn {#1} {#2} {#3} }
}
@@ -305,30 +294,46 @@
\cs_generate_variant:Nn \siunitx_angle:nnn { eee , xxx }
% \end{macrocode}
% Here, the need for absolute values is to handle conversion of negative
-% values: the result should be exactly one sign in the integer part.
+% values: the result should be exactly one sign in the integer part. For
+% integer input, we can control whether there are minute or second parts
+% at all.
% \begin{macrocode}
\cs_new_protected:Npn \@@_arc_convert:n #1
{
- \siunitx_angle:eee
- { \fp_eval:n { trunc(#1,0) } }
- { \fp_eval:n { abs(trunc((#1 - trunc(#1,0)) * 60,0)) } }
+ \@@_arc_convert:w #1 . \q_nil . \q_stop
+ }
+\cs_generate_variant:Nn \@@_arc_convert:n { e }
+\cs_new_protected:Npn \@@_arc_convert:w #1 . #2 . #3 \q_stop
+ {
+ \quark_if_nil:nTF {#2}
{
- \fp_eval:n
+ \siunitx_angle:eee
+ { \fp_eval:n { trunc(#1,0) } }
+ { \bool_if:NT \l_@@_fill_minutes_bool { 0 } }
+ { \bool_if:NT \l_@@_fill_seconds_bool { 0 } }
+ }
+ {
+ \siunitx_angle:eee
+ { \fp_eval:n { trunc(#1.#2,0) } }
+ { \fp_eval:n { abs(trunc((#1.#2 - trunc(#1,0)) * 60,0)) } }
{
- abs
- (
- (#1 - trunc(#1,0)) * 60
- - trunc((#1 - trunc(#1,0)) * 60,0)
- )
- * 60
+ \fp_eval:n
+ {
+ abs
+ (
+ (#1.#2 - trunc(#1.#2,0)) * 60
+ - trunc((#1.#2 - trunc(#1.#2,0)) * 60,0)
+ )
+ * 60
+ }
}
}
}
-\cs_generate_variant:Nn \@@_arc_convert:n { e }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{variable}{\c_@@_parts_tl}
% For mappings.
@@ -360,27 +365,32 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\@@_suppress_exp_uncert:, \@@_suppress_comp:}
+% \begin{macro}{\@@_suppress_comp:, \@@_suppress_exp:, \@@_suppress_uncert:,}
% Pre-compilation of keys to suppress uncertainties and exponents,
% and
% \begin{macrocode}
\keys_precompile:nnN
{ siunitx }
+ { input-comparators = }
+ \l_@@_tmp_tl
+\cs_set_protected:Npx \@@_suppress_comp:
+ { \exp_not:V \l_@@_tmp_tl }
+\keys_precompile:nnN
+ { siunitx }
+ { input-exponent-markers = }
+ \l_@@_tmp_tl
+\cs_set_protected:Npx \@@_suppress_exp:
+ { \exp_not:V \l_@@_tmp_tl }
+\keys_precompile:nnN
+ { siunitx }
{
input-close-uncertainty = ,
- input-exponent-markers = ,
input-open-uncertainty = ,
input-uncertainty-signs =
}
\l_@@_tmp_tl
-\cs_set_protected:Npx \@@_suppress_exp_uncert:
+\cs_set_protected:Npx \@@_suppress_uncert:
{ \exp_not:V \l_@@_tmp_tl }
-\keys_precompile:nnN
- { siunitx }
- { input-comparators = }
- \l_@@_tmp_tl
-\cs_set_protected:Npx \@@_suppress_comp:
- { \exp_not:V \l_@@_tmp_tl }
% \end{macrocode}
% \end{macro}
%
@@ -392,23 +402,45 @@
% To get the sign in the right place whilst dealing with zero filling
% means doing some shuffling. That means doing processing of each number
% manually. For degrees, auto-conversion can give |-0|, which needs to be
-% picked up early to set the sign.
+% picked up early to set the sign. A bit of shuffling is needed as only
+% the seconds argument is permitted to have an uncertainty.
% \begin{macrocode}
\cs_new_protected:Npn \@@_arc_sign:nnn #1#2#3
{
\group_begin:
- \@@_suppress_exp_uncert:
+ \@@_suppress_exp:
\tl_clear:N \l_@@_sign_tl
\bool_set_false:N \l_@@_signed_bool
- \str_if_eq:nnTF {#1} { -0 }
- {
- \@@_arc_sign:nn { } { degrees }
- \@@_suppress_comp:
- \tl_set:Nn \l_@@_sign_tl { - }
- \bool_set_true:N \l_@@_signed_bool
- }
- { \@@_arc_sign:nn {#1} { degrees } }
- \@@_arc_sign:nn {#2} { minutes }
+ \group_begin:
+ \@@_suppress_uncert:
+ \str_if_eq:nnTF {#1} { -0 }
+ {
+ \@@_arc_sign:nn { } { degrees }
+ \@@_suppress_comp:
+ \tl_set:Nn \l_@@_sign_tl { - }
+ \bool_set_true:N \l_@@_signed_bool
+ }
+ { \@@_arc_sign:nn {#1} { degrees } }
+ \@@_arc_sign:nn {#2} { minutes }
+ \tl_set:Nx \l_@@_tmp_tl
+ {
+ \tl_set:Nn \exp_not:N \l_@@_sign_tl
+ { \exp_not:V \l_@@_sign_tl }
+ \tl_set:Nn \exp_not:N \l_@@_degrees_tl
+ { \exp_not:V \l_@@_degrees_tl }
+ \tl_set:Nn \exp_not:N \l_@@_minutes_tl
+ { \exp_not:V \l_@@_minutes_tl }
+ \exp_not:c
+ {
+ bool_set_
+ \bool_if:NTF \l_@@_signed_bool
+ { true }
+ { false }
+ :N
+ }
+ \exp_not:N \l_@@_signed_bool
+ }
+ \exp_after:wN \group_end: \l_@@_tmp_tl
\@@_arc_sign:nn {#3} { seconds }
\tl_if_empty:NF \l_@@_sign_tl
{
@@ -435,8 +467,11 @@
}
{
\siunitx_number_parse:nN {#1} \l_@@_tmp_tl
- \exp_after:wN \@@_extract_sign:nnnnnnnn \l_@@_tmp_tl {#2}
- \bool_set_true:N \l_@@_signed_bool
+ \tl_if_empty:NF \l_@@_tmp_tl
+ {
+ \exp_after:wN \@@_extract_sign:nnnnnnnn \l_@@_tmp_tl {#2}
+ \bool_set_true:N \l_@@_signed_bool
+ }
}
}
\cs_new_protected:Npn \@@_arc_sign_auxi:n #1
@@ -629,10 +664,11 @@
{ \siunitx_print_number:n {#1#2#3#4#5} }
\cs_new_protected:Npn \@@_arc_print_auxvi:n #1
{
- \nobreak
- \l_@@_product_tl
- \siunitx_unit_format:nN {#1} \l_@@_tmp_tl
- \siunitx_print_unit:V \l_@@_tmp_tl
+ \group_begin:
+ \siunitx_unit_options_apply:n {#1}
+ \siunitx_unit_format:nN {#1} \l_@@_tmp_tl
+ \siunitx_quantity_print:nV { } \l_@@_tmp_tl
+ \group_end:
}
% \end{macrocode}
% \end{macro}
@@ -651,7 +687,34 @@
}
% \end{macrocode}
%
+% \subsection{Deprecated options}
+%
% \begin{macrocode}
+\msg_new:nnn { siunitx } { angle-option-deprecated }
+ {
+ Option~"#1"~has~been~deprecated~in~this~release.\\ \\
+ Set~the~"quantity-product"~option~for~the~units~
+ \token_to_str:N \arcminute,~\arcsecond\ and~\degree\ instead.
+ }
+\keys_define:nn { siunitx }
+ {
+ number-angle-product .code:n =
+ {
+ \msg_info:nnn { siunitx } { angle-option-deprecated }
+ { number-angle-product }
+ \siunitx_unit_options_declare:Nn \arcminute
+ { quantity-product = {#1} }
+ \siunitx_unit_options_declare:Nn \arcsecond
+ { quantity-product = {#1} }
+ \siunitx_unit_options_declare:Nn \degree
+ { quantity-product = {#1} }
+ }
+ }
+% \end{macrocode}
+%
+% \subsection{Standard settings for module options}
+%
+% \begin{macrocode}
\keys_set:nn { siunitx }
{
angle-mode = input ,
@@ -662,8 +725,7 @@
angle-separator = ,
fill-angle-degrees = false ,
fill-angle-minutes = false ,
- fill-angle-seconds = false ,
- number-angle-product =
+ fill-angle-seconds = false
}
% \end{macrocode}
%
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-command.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-command.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-command.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -135,8 +135,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_command>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -132,6 +132,14 @@
% |input|.
% \end{function}
%
+% \begin{function}{complex-phase-command}
+% \begin{syntax}
+% |complex-phase-command| = \meta{cmd}
+% \end{syntax}
+% Sets the command used during output of the phase of a complex number in
+% polar form. The standard setting is |\angle|.
+% \end{function}
+%
% \begin{function}{complex-root-position}
% \begin{syntax}
% |complex-root-position| = |after-number|\verb"|"|before-number|
@@ -140,13 +148,6 @@
% to the numbers. The standard setting is |after-number|.
% \end{function}
%
-% \begin{function}{complex-symbol-angle}
-% \begin{syntax}
-% |complex-symbol-angle| = \meta{symbol}
-% \end{syntax}
-% Sets the symbol used before the polar angle.
-% \end{function}
-%
% \begin{function}{complex-symbol-degree}
% \begin{syntax}
% |complex-symbol-degree| = \meta{symbol}
@@ -189,8 +190,7 @@
%
% \section{\pkg{siunitx-complex} implementation}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_complex>
% \end{macrocode}
@@ -254,8 +254,8 @@
% \l_@@_root_after_bool ,
% \l_@@_force_cartesian_bool ,
% \l_@@_force_polar_bool ,
+% \l_@@_phase_tl ,
% \l_@@_polar_degree_bool ,
-% \l_@@_symbol_angle_tl ,
% \l_@@_symbol_degree_tl ,
% \l_@@_input_root_tl ,
% \l_@@_output_root_tl
@@ -288,13 +288,13 @@
{ \bool_set_true:N \l_@@_polar_degree_bool } ,
complex-angle-unit / radians .code:n =
{ \bool_set_false:N \l_@@_polar_degree_bool } ,
+ complex-phase-command .tl_set:N =
+ \l_@@_phase_tl ,
complex-root-position .choice: ,
complex-root-position / after-number .code:n =
{ \bool_set_true:N \l_@@_root_after_bool } ,
complex-root-position / before-number .code:n =
{ \bool_set_false:N \l_@@_root_after_bool } ,
- complex-symbol-angle .tl_set:N =
- \l_@@_symbol_angle_tl ,
complex-symbol-degree .tl_set:N =
\l_@@_symbol_degree_tl ,
input-complex-root .tl_set:N =
@@ -1029,6 +1029,7 @@
% \@@_format_extract-exponent:n ,
% \@@_format_polar_input:n
% }
+% \begin{macro}{\@@_format_phase:}
% We see similar ideas here to the Cartesian versions, but with only
% the magnitude to adjust, things are rather simpler in the exponent
% manipulations.
@@ -1053,17 +1054,9 @@
\bool_if:NTF \l_siunitx_number_parse_bool
{ \siunitx_number_output:N \l_@@_mag_tl }
{ \exp_not:V \l_@@_mag_tl }
- \exp_not:V \l_@@_symbol_angle_tl
- \mathord % TEMP
- \exp_not:V \l_@@_angle_tl
}
\siunitx_print_number:V \l_@@_tmp_tl
- \bool_if:NT \l_@@_polar_degree_bool
- {
- \siunitx_unit_format:VN \l_@@_symbol_degree_tl \l_@@_tmp_tl
- \nobreak
- \siunitx_print_unit:V \l_@@_tmp_tl
- }
+ \l_@@_phase_tl { \@@_format_phase: }
\siunitx_quantity_print:nV { } \l_@@_unit_tl
}
\cs_new_protected:cpn { @@_format_polar_combine-exponent:n } #1
@@ -1088,8 +1081,21 @@
{ \siunitx_number_process:NN \l_@@_mag_tl \l_@@_mag_tl }
\siunitx_unit_format:nN {#1} \l_@@_unit_tl
}
+\cs_new_protected:Npn \@@_format_phase:
+ {
+ \group_begin:
+ \bool_if:NTF \l_@@_polar_degree_bool
+ {
+ \exp_args:NV \siunitx_unit_options_apply:n \l_@@_symbol_degree_tl
+ \siunitx_unit_format:VN \l_@@_symbol_degree_tl \l_@@_tmp_tl
+ }
+ { \tl_clear:N \l_@@_tmp_tl }
+ \siunitx_quantity_print:VV \l_@@_angle_tl \l_@@_tmp_tl
+ \group_end:
+ }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \subsection{Conversion}
%
@@ -1173,7 +1179,7 @@
\tl_if_blank:nTF {#4}
{ \@@_convert_polar_auxiv:nnw {#1} {#2} #3 - - \q_stop }
{
- \str_if_eq:nnTF {#4} { i }
+ \str_if_eq:eeTF { \use:n #4 } { i }
{ \@@_convert_polar_auxvii:nnn {#2#3} { 1 } {#1} }
{ \@@_convert_polar_auxv:nnw {#2#3} {#1} #4 i \q_nil i \q_stop }
}
@@ -1183,7 +1189,7 @@
\tl_if_blank:nTF {#4}
{ \@@_convert_polar_auxv:nnw { } {#1} #2#3 i \q_nil i \q_stop }
{
- \str_if_eq:nnTF {#4} { i }
+ \str_if_eq:eeTF { \use:n #4 } { i }
{ \@@_convert_polar_auxvii:nnn { } { -1 } {#1} }
{ \@@_convert_polar_auxv:nnw {#2#3} {#1} -#4 i \q_nil i \q_stop }
}
@@ -1249,6 +1255,21 @@
}
% \end{macrocode}
%
+% \subsection{Deprecated options}
+%
+% \begin{macrocode}
+\keys_define:nn { siunitx }
+ {
+ complex-symbol-angle .code:n =
+ {
+ \msg_info:nnnn { siunitx } { option-deprecated }
+ { number-angle-product }
+ { complex-phase-command }
+ complex-phase-command = {#1}
+ }
+ }
+% \end{macrocode}
+%
% \subsection{Standard settings for module options}
%
% Some of these follow naturally from the point of definition
@@ -1257,13 +1278,13 @@
% \begin{macrocode}
\keys_set:nn { siunitx }
{
- complex-angle-unit = degrees ,
- complex-mode = input ,
- complex-root-position = after-number ,
- complex-symbol-angle = \angle ,
- complex-symbol-degree = \degree ,
- input-complex-root = ij ,
- output-complex-root = \mathrm { i } ,
+ complex-angle-unit = degrees ,
+ complex-mode = input ,
+ complex-root-position = after-number ,
+ complex-phase-command = \ensuremath { \angle } ,
+ complex-symbol-degree = \degree ,
+ input-complex-root = ij ,
+ output-complex-root = \mathrm { i } ,
print-complex-unity = false
}
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -370,8 +370,7 @@
%
% \subsection{General mechanism}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_compound>
% \end{macrocode}
@@ -1052,8 +1051,7 @@
%
% \subsection{Lists}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_list>
% \end{macrocode}
@@ -1143,8 +1141,7 @@
%
% \subsection{Products}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_product>
% \end{macrocode}
@@ -1246,8 +1243,7 @@
%
% \subsection{Ranges}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_range>
% \end{macrocode}
@@ -1344,9 +1340,9 @@
compound-exponents = individual ,
compound-final-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
compound-independent-prefix = false ,
compound-open-boundary = ,
@@ -1353,12 +1349,12 @@
compound-open-bracket = ( , % )
compound-pair-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
compound-separator =
- { , \ifmmode \ \else \space \fi } ,
+ { , \TextOrMath { \space } { \ } } ,
compound-separator-mode = text ,
compound-units = repeat , % (
list-close-bracket = ) ,
@@ -1365,20 +1361,20 @@
list-exponents = individual ,
list-final-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
list-independent-prefix = false ,
list-open-bracket = ( , % )
list-pair-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
list-separator =
- { , \ifmmode \ \else \space \fi } ,
+ { , \TextOrMath { \space } { \ } } ,
list-units = repeat , % (
product-close-bracket = ) ,
product-exponents = individual ,
@@ -1387,9 +1383,9 @@
product-open-bracket = ( , % )
product-phrase =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { by }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
product-symbol = \times ,
product-units = repeat , % (
@@ -1400,9 +1396,9 @@
range-open-phrase = ,
range-phrase =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { to }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
range-units = repeat
}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -67,9 +67,7 @@
%
% \section{\pkg{siunitx-emulation} implementation}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention). In contrast
-% to other parts of the bundle, the functions here may need to redefine those
-% from various submodules.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx>
% \end{macrocode}
@@ -1008,20 +1006,22 @@
}
\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: }
- { \@@_non_latin:n { "03A9 } }
- { \exp_not:N \textohm }
- }
- \exp_not:N \fi
+ \exp_not:N \TextOrMath
+ {
+ \siunitx_print_text:n
+ {
+ \bool_lazy_or:nnTF
+ { \sys_if_engine_luatex_p: }
+ { \sys_if_engine_xetex_p: }
+ { \@@_non_latin:n { "03A9 } }
+ { \exp_not:N \textohm }
+ }
+ }
+ {
+ \cs_if_exist:NTF \upOmega
+ { \exp_not:N \upOmega }
+ { \exp_not:N \Omega }
+ }
}
}
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -83,8 +83,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_locale>
% \end{macrocode}
@@ -159,6 +158,7 @@
\DeclareTranslation { Italian } { and } { e }
\DeclareTranslation { Portuguese } { and } { e }
\DeclareTranslation { Slovene } { and } { in }
+ \DeclareTranslation { Italian } { from~(numerical~range) } { da }
\DeclareTranslation { Brazilian } { to~(numerical~range) } { a }
\DeclareTranslation { Catalan } { to~(numerical~range) } { a }
\DeclareTranslation { English } { to~(numerical~range) } { to }
@@ -173,21 +173,39 @@
{
list-final-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { \GetTranslation { and } }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
- list-pair-separator =
+ list-pair-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { \GetTranslation { and } }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
- range-phrase =
+ range-open-phrase =
{
- \ifmmode \ \else \space \fi
+ \bool_lazy_or:nnF
+ {
+ \tl_if_blank_p:e
+ { \GetTranslation { from~(numerical~range) } }
+ }
+ {
+ \str_if_eq_p:ee
+ { \GetTranslation { from~(numerical~range) } }
+ { from~(numerical~range) }
+ }
+ {
+ \TextOrMath { \space } { \ }
+ \text { \GetTranslation { from~(numerical~range) } }
+ \TextOrMath { \space } { \ }
+ }
+ } ,
+ range-phrase =
+ {
+ \TextOrMath { \space } { \ }
\text { \GetTranslation { to~(numerical~range) } }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
}
}
}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -64,13 +64,14 @@
% 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}). Such a color will be the \emph{first}
-% part of the result, meaning that a test for an initial |\color| and following
+% is also required for the output of uncertainties, and \cs{sim} for
+% approximate values. 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}). Such a color will be the \emph{first} part of
+% the result, meaning that a test for an initial |\color| and following
% brace group may be used to detect/remove/adjust this part.
%
% \section{Formatting numbers}
@@ -246,6 +247,14 @@
% The options defined by this submodule are available within the \pkg{l3keys}
% |siunitx| tree.
%
+% \begin{function}{allow-uncertainty-breaks}
+% \begin{syntax}
+% |allow-uncertainty-breaks| = |true|\verb"|"|false|
+% \end{syntax}
+% Specifies whether breaks are permitted for a (separated) uncertainties. The
+% standard setting is |true|.
+% \end{function}
+%
% \begin{function}{bracket-ambiguous-numbers}
% \begin{syntax}
% |bracket-ambiguous-numbers| = |true|\verb"|"|false|
@@ -604,6 +613,14 @@
% number if the input was negative. The standard setting is |true|.
% \end{function}
%
+% \begin{function}{simplify-uncertainty}
+% \begin{syntax}
+% |simplify-uncertainty| = |true|\verb"|"|false|
+% \end{syntax}
+% Switch to control whether uncertainties given with two equal components
+% are printed as a single value.
+% \end{function}
+%
% \begin{function}{tight-spacing}
% \begin{syntax}
% |tight-spacing| = |true|\verb"|"|false|
@@ -703,8 +720,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_number>
% \end{macrocode}
@@ -1002,19 +1018,24 @@
\tl_replace_all:Nnn #1 {#2} {#3}
\@@_normalize_aux:NnN #1
}
-\tl_const:Nn \c_@@_normalize_tl
- {
- { -+ } \mp
- { +- } \pm
- { << } \ll
- { <= } \le
- { >> } \gg
- { >= } \ge
- }
\group_begin:
+ \char_set_catcode_other:N \~
+ \tl_const:Nn \c_@@_normalize_tl
+ {
+ { -+ } \mp
+ { +- } \pm
+ { << } \ll
+ { <= } \le
+ { >> } \gg
+ { >= } \ge
+ { ~ } \sim
+ }
+\group_end:
+\group_begin:
\char_set_catcode_active:N \-
\char_set_catcode_active:N \<
\char_set_catcode_active:N \>
+ \char_set_catcode_active:N \~
\cs_new_protected:Npx \@@_normalize_actives:N #1
{
\tl_replace_all:Nnn #1
@@ -1023,6 +1044,8 @@
{ \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}
@@ -1067,6 +1090,8 @@
\siunitx_number_normalize_symbols:N \l_@@_arg_tl
\tl_map_inline:Nn \l_@@_input_ignore_tl
{ \tl_remove_all:Nn \l_@@_arg_tl {##1} }
+ \protected at edef \l_@@_input_digit_tl
+ { \l_@@_input_digit_tl }
\tl_if_empty:NF \l_@@_arg_tl
{
\@@_parse_comparator:
@@ -3850,11 +3875,13 @@
% \l_@@_output_exp_marker_tl ,
% \l_@@_output_uncert_close_tl ,
% \l_@@_output_uncert_open_tl ,
+% \l_@@_uncert_break_bool ,
% \l_@@_uncert_desc_mode_tl ,
% \l_@@_uncert_desc_separator_tl ,
% \l_@@_uncert_desc_clist ,
% \l_@@_uncert_mode_tl ,
% \l_@@_uncert_separator_tl ,
+% \l_@@_uncert_simplify_bool ,
% \l_@@_tight_bool ,
% \l_@@_unity_mantissa_bool ,
% \l_@@_zero_exponent_bool ,
@@ -3864,6 +3891,8 @@
% \begin{macrocode}
\keys_define:nn { siunitx }
{
+ allow-uncertainty-breaks .bool_set:N =
+ \l_@@_uncert_break_bool ,
bracket-ambiguous-numbers .bool_set:N =
\l_siunitx_number_bracket_ambiguous_bool ,
bracket-negative-numbers .bool_set:N =
@@ -3933,6 +3962,8 @@
\l_@@_zero_exponent_bool ,
print-zero-integer .bool_set:N =
\l_@@_zero_integer_bool ,
+ simplify-uncertainty .bool_set:N =
+ \l_@@_uncert_simplify_bool ,
tight-spacing .bool_set:N =
\l_@@_tight_bool ,
uncertainty-descriptor-mode .choices:nn =
@@ -4012,6 +4043,7 @@
% \begin{macro}[EXP]{\@@_output_uncert_S_loop:w}
% \begin{macro}[EXP]{\@@_output_uncert_A:nnnn, \@@_output_uncert_A_multi:nnnn}
% \begin{macro}[EXP]{\@@_output_uncert_A:nnnnn}
+% \begin{macro}[EXP]{\@@_output_uncert_A_aux:nnnn}
% \begin{macro}[EXP]
% {
% \@@_output_uncert_S:nnnn ,
@@ -4522,20 +4554,28 @@
{ \@@_output_uncert_A:nnnnn {#1} {#2} {#3} #4 }
\cs_new_eq:NN \@@_output_uncert_A_multi:nnnn
\@@_output_uncert_A:nnnn
-\cs_new:Npx \@@_output_uncert_A:nnnnn #1#2#3#4#5
+\cs_new:Npn \@@_output_uncert_A:nnnnn #1#2#3#4#5
{
+ \bool_lazy_and:nnTF
+ { \l_@@_uncert_simplify_bool }
+ { \str_if_eq_p:nn {#4} {#5} }
+ { \@@_output_uncert_S_sep:nnnn {#1} {#2} { } {#4} }
+ { \@@_output_uncert_A_aux:nnnn {#1} {#2} {#4} {#5} }
+ }
+\cs_new:Npx \@@_output_uncert_A_aux:nnnn #1#2#3#4
+ {
{ }
^
{
+
\exp_not:N \@@_output_uncert_augment:nnnn
- {#4} {#1} {#4} { }
+ {#3} {#1} {#3} { }
}
\char_generate:nn { `\_ } { 8 }
{
-
\exp_not:N \@@_output_uncert_augment:nnnn
- {#5} {#1} {#5} { }
+ {#4} {#1} {#4} { }
}
\exp_not:N \@@_output_uncertainty_unaligned:n {#2}
}
@@ -4565,7 +4605,8 @@
\bool_if:NTF \l_@@_tight_bool
{ \exp_not:N \mathord }
{ \use:n }
- { \exp_not:n { \pm } }
+ { \pm }
+ \bool_if:NF \l_@@_uncert_break_bool { \exp_not:N \nobreak }
\exp_not:n {#2}
\@@_output_uncert_augment:nnnn {#4} {#1} {#4} {#2}
}
@@ -4772,6 +4813,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Miscellaneous tools}
%
@@ -4886,6 +4928,7 @@
% \begin{macrocode}
\keys_set:nn { siunitx }
{
+ allow-uncertainty-breaks = true ,
bracket-ambiguous-numbers = true ,
bracket-negative-numbers = false ,
drop-exponent = false ,
@@ -4936,6 +4979,7 @@
round-pad = true ,
round-precision = 2 ,
round-zero-positive = true ,
+ simplify-uncertainty = false ,
tight-spacing = false ,
uncertainty-descriptor-mode = bracket-separator ,
uncertainty-descriptor-separator = \ ,
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -323,8 +323,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_print>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-quantity.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -141,8 +141,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_quantity>
% \end{macrocode}
@@ -424,27 +423,16 @@
%
% \subsection{Adjustments to units}
%
-% \begin{macro}{\@@_non_latin:n}
-% A shortcut.
-% \begin{macrocode}
-\cs_new:Npn \@@_non_latin:n #1
- { \codepoint_generate:nn {#1} { \char_value_catcode:n {#1} } }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\arcminute, \arcsecond, \degree}
-% The angles units are re-declared here: this is needed for using it
+% The angles units are adjusted here: this is needed for using it
% in quantities. This is done here as it avoids a dependency in
% \pkg{siunitx-unit} on options it does not contain.
% \begin{macrocode}
-\siunitx_declare_unit:Nen \arcminute
- { \@@_non_latin:n { "02B9 } }
+\siunitx_unit_options_declare:Nn \arcminute
{ quantity-product = { } }
-\siunitx_declare_unit:Nen \arcsecond
- { \@@_non_latin:n { "02BA } }
+\siunitx_unit_options_declare:Nn \arcsecond
{ quantity-product = { } }
-\siunitx_declare_unit:Nen \degree
- { \@@_non_latin:n { "00B0 } }
+\siunitx_unit_options_declare:Nn \degree
{ quantity-product = { } }
% \end{macrocode}
% \end{macro}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -72,8 +72,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_symbol>
% \end{macrocode}
@@ -289,6 +288,16 @@
}
% \end{macrocode}
%
+% As \pkg{uinicode-math} does stuff at the start of the document,
+% \pkg{siunitx} needs to come after. As the former has two separate
+% files internally, two rules are needed.
+% \begin{macrocode}
+\DeclareHookRule { begindocument } { siunitx } { after }
+ { unicode-math-luatex }
+\DeclareHookRule { begindocument } { siunitx } { after }
+ { unicode-math-xetex }
+% \end{macrocode}
+%
% \subsection{Bookmark definitions}
%
% Inside PDF strings we disable the text printing function. The definition of
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -229,8 +229,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_table>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -292,15 +292,25 @@
%
% \section{Per-unit options}
%
+% \begin{function}{\siunitx_unit_options_declare:Nn}
+% \begin{syntax}
+% \cs{siunitx_unit_options_declare:Nn} \meta{unit} \Arg{options}
+% \end{syntax}
+% Declares that the \meta{options} should be applied with the \meta{unit}
+% is used. The \meta{options} stored override any saved when the unit was
+% declared. This function is intended for adjusting options when the unit
+% command is otherwise unchanged.
+% \end{function}
+%
% \begin{function}{\siunitx_unit_options_apply:n}
% \begin{syntax}
-% \cs{siunitx_unit_options_apply:n} \meta{unit(s)}
+% \cs{siunitx_unit_options_apply:n} \Arg{unit(s)}
% \end{syntax}
% Applies any unit-specific options set up using
% \cs{siunitx_declare_unit:Nnn}. This allows there use outside of unit
% formatting, for example to influence spacing in quantities. The options
% are applied only once at a given group level, which allows for user
-% over-ride \foreign{via} |\keys_set:nn { siunitx } { ... }|.
+% override \foreign{via} |\keys_set:nn { siunitx } { ... }|.
% \end{function}
%
% \section{Units in (PDF) strings}
@@ -701,8 +711,7 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
-% internal material in this \emph{submodule} should be used directly.
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx_unit>
% \end{macrocode}
@@ -940,9 +949,7 @@
{#2}
{ \@@_parse_unit:Nn #1 {#2} }
}
- \tl_clear_new:c { l_@@_options_ \token_to_str:N #1 _tl }
- \tl_if_empty:nF {#3}
- { \tl_set:cn { l_@@_options_ \token_to_str:N #1 _tl } {#3} }
+ \siunitx_unit_options_declare:Nn #1 {#3}
}
\cs_generate_variant:Nn \siunitx_declare_unit:Nnn { Ne , Nx }
% \end{macrocode}
@@ -951,11 +958,17 @@
%
% \subsection{Applying unit options}
%
-% \begin{variable}{\l_@@_options_bool}
+% \begin{macro}{\siunitx_unit_options_declare:Nn}
+% For setting options for existing units without needing to alter the
+% symbol.
% \begin{macrocode}
-\bool_new:N \l_@@_options_bool
+\cs_new_protected:Npn \siunitx_unit_options_declare:Nn #1#2
+ {
+ \tl_clear_new:c { l_@@_options_ \token_to_str:N #1 _tl }
+ \tl_set:cn { l_@@_options_ \token_to_str:N #1 _tl } {#2}
+ }
% \end{macrocode}
-% \end{variable}
+% \end{macro}
%
% \begin{macro}{\siunitx_unit_options_apply:n}
% Options apply only if they have not already been set at this group
@@ -963,18 +976,14 @@
% \begin{macrocode}
\cs_new_protected:Npn \siunitx_unit_options_apply:n #1
{
- \bool_if:NF \l_@@_options_bool
+ \tl_if_single_token:nT {#1}
{
- \tl_if_single_token:nT {#1}
+ \tl_if_exist:cT { l_@@_options_ \token_to_str:N #1 _tl }
{
- \tl_if_exist:cT { l_@@_options_ \token_to_str:N #1 _tl }
- {
- \keys_set:nv { siunitx }
- { l_@@_options_ \token_to_str:N #1 _tl }
- }
+ \keys_set:nv { siunitx }
+ { l_@@_options_ \token_to_str:N #1 _tl }
}
}
- \bool_set_true:N \l_@@_options_bool
}
% \end{macrocode}
% \end{macro}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx 2024-12-06 22:32:28 UTC (rev 73053)
@@ -73,39 +73,48 @@
%<*package>
% \end{macrocode}
%
-% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention).
+% Identify the internal prefix.
% \begin{macrocode}
%<@@=siunitx>
% \end{macrocode}
%
-% \subsection{Initial set up}
-%
% \begin{macrocode}
%<*init>
% \end{macrocode}
%
-% Set up a couple of commands in recent-ish \LaTeXe{} releases.
+% \subsection{Provide a kernel command}
+%
+% \begin{macro}{\IfFormatAtLeastTF}
+% Not present in older kernels: use the \LaTeXe{} mechanism as this is correct
+% for this case.
% \begin{macrocode}
-\providecommand\DeclareRelease[3]{}
-\providecommand\DeclareCurrentRelease[2]{}
+\providecommand \IfFormatAtLeastTF { \@ifl at t@r \fmtversion }
% \end{macrocode}
+% \end{macro}
%
-% Allow rollback to version~$2$: if we need to, version~$1$ could eventually
-% be added here too.
+% \subsection{Initial set up}
+%
% \begin{macrocode}
+\IfFormatAtLeastTF { 2022-11-01 }
+ { }
+ {%
+ \PackageError{siunitx}{LaTeX kernel too old}
+ {%
+ You need a newer LaTeX to use this release of siunitx.\MessageBreak
+ Loading~siunitx~will~abort!%
+ }%
+ \endinput
+ }
+% \end{macrocode}
+%
+% Allow rollback to version~\version{2}: if we need to, version~\version{1}
+% could eventually be added here too.
+% \begin{macrocode}
\DeclareRelease{2}{2010-05-23}{siunitx-v2.sty}
\DeclareRelease{v2}{2010-05-23}{siunitx-v2.sty}
\DeclareCurrentRelease{}{2021-05-17}
% \end{macrocode}
%
-% Load only the essential support (\pkg{expl3}) \enquote{up-front}, and
-% only if required.
-% \begin{macrocode}
-\@ifundefined{ExplLoaderFileDate}
- {\RequirePackage{expl3}}
- {}
-% \end{macrocode}
-%
% Make sure that the version of \pkg{l3kernel} in use is sufficiently new.
% We use \cs{ExplFileDate} as \cs{@ifpackagelater} doesn't work for pre-loaded
% \pkg{expl3} in the absence of the package.
@@ -124,7 +133,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2024-11-19} {3.3.24}
+\ProvidesExplPackage {siunitx} {2024-12-06} {3.4.0}
{A comprehensive (SI) units package}
% \end{macrocode}
%
@@ -157,16 +166,6 @@
% \end{macrocode}
%\end{macro}
%
-% \subsection{Provide a kernel command}
-%
-% \begin{macro}{\IfFormatAtLeastTF}
-% Not present in older kernels: use the \LaTeXe{} mechanism as this is correct
-% for this case.
-% \begin{macrocode}
-\providecommand \IfFormatAtLeastTF { \@ifl at t@r \fmtversion }
-% \end{macrocode}
-% \end{macro}
-%
% \subsection{Top-level scratch space}
%
% \begin{macro}{\l_@@_tmp_tl}
@@ -238,12 +237,7 @@
% \end{macro}
%
% \begin{macrocode}
-\IfFormatAtLeastTF { 2022-06-01 }
- { \ProcessKeyOptions [ siunitx ] }
- {
- \RequirePackage { l3keys2e }
- \ProcessKeysOptions { siunitx }
- }
+\ProcessKeyOptions
% \end{macrocode}
%
% \begin{macrocode}
@@ -261,17 +255,6 @@
% relevant code. Things could be re-arranged by \pkg{DocStrip} but there is no
% advantage.
%
-% User level interfaces are all created by \pkg{ltcmd}/\pkg{xparse}.
-% \begin{macrocode}
-\IfFormatAtLeastTF { 2020-10-01 }
- { }
- {
- \RequirePackage { xparse }
- \providecommand \ExpandArgs [1]
- { \cs_if_exist_use:c { exp_args:N #1 } }
- }
-% \end{macrocode}
-%
% \subsubsection{Preamble commands}
%
% \begin{macro}
@@ -701,7 +684,7 @@
{
\seq_map_inline:Nn \c_@@_bookmark_seq
{
- \cs_set_eq:Nc #1
+ \ExpandArgs { Nc } \DeclareCommandCopy #1
{ \cs_to_str:N #1 \c_space_tl ( pdfstring ~ context ) }
}
}
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex 2024-12-06 22:32:28 UTC (rev 73053)
@@ -4,7 +4,7 @@
It may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this
-license or (at your option) any later version. The latest version
+license or (at your option) any later version. The latest versioncl
of this license is in the file
https://www.latex-project.org/lppl.txt
@@ -26,8 +26,10 @@
\fi
-\documentclass{l3doc}
+\DocumentMetadata{lang = en, pdfversion = 2.0}
+\documentclass[a4paper]{l3doc}
+
% The next line is needed so that \GetFileInfo will be able to pick up
% version data (quite apart from making the demos work).
\usepackage{siunitx}
@@ -57,6 +59,10 @@
\NewDocumentCommand\ext{m}{\texttt{.#1}}
\NewDocumentCommand\foreign{m}{\textit{#1}}
\NewDocumentCommand\opt{m}{\texttt{#1}}
+\NewDocumentCommand\version{m}{\ensuremath{#1}}
+\ExpandArgs{c}\NewDocumentCommand{version (pdfstring context)}{m}{#1}
+\pdfstringdefDisableCommands{%
+ \ExpandArgs{Nc}\DeclareCommandCopy\version{version (pdfstring context)}}
% Tidy up the above in bookmarks
\makeatletter
\pdfstringdefDisableCommands{%
@@ -79,12 +85,13 @@
}
% For demos
-\usepackage[portuguese,brazilian,catalan,french,german,polish,spanish,UKenglish]{babel}
-\AtBeginDocument{\shorthandoff{:<>}}
+\usepackage[portuguese,brazilian,catalan,french,german,italian,polish,spanish,UKenglish]{babel}
+\AtBeginDocument{\shorthandoff{<>}}
\usepackage{translations}
\usepackage{cancel}
\usepackage{collcell}
\usepackage{sansmath}
+\usepackage{steinmetz}
\newlength{\mylength}
% For creating code demonstrations
@@ -165,8 +172,7 @@
\usepackage[table]{xcolor}
% Has to come after xcolor
\usepackage{pgfplots}
-\pgfplotsset{compat = 1.16, compat/show suggested version = false}
-\usepackage{xfp}
+\pgfplotsset{compat = 1.18, compat/show suggested version = false}
% For the extra-long tables
\usepackage{xtab}
@@ -182,7 +188,11 @@
\noexpand\centering
}
\makeatother
-\usepackage[osf]{mathpazo}
+%\usepackage[osf]{mathpazo}
+\usepackage{fontspec}
+\setmainfont[Numbers = OldStyle]{TeX Gyre Pagella}
+\usepackage{unicode-math}
+\setmathfont{TeX Gyre Pagella Math}
\hypersetup{hidelinks}
@@ -453,9 +463,9 @@
\end{LaTeXdemo}
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{day} is a \TeX{} primitive
-and several packages define \cs{degree}). Full details of using \enquote{stand
+\cs{qty} and \cs{unit} functions. This is not the standard behavior as there 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}.
\begin{function}{\qtylist}
@@ -464,7 +474,7 @@
\end{syntax}
\end{function}
Lists of numbers with units can be handled using the \cs{qtylist} function. The
-behaviour of this function is similar to \cs{numlist}, but with the addition of
+behavior of this function is similar to \cs{numlist}, but with the addition of
the unit to each number.
\begin{LaTeXdemo}
\qtylist{10;30;45}{\metre}
@@ -475,9 +485,9 @@
\cs{qtyproduct}\oarg{options}\marg{numbers}\marg{unit}
\end{syntax}
\end{function}
-Runs of products of numbers with units can be handled using the
-\cs{qtyproduct} function. The behaviour of this function is similar to
-\cs{numproduct}, but with the addition of a unit to each number.
+Runs of products of numbers with units can be handled using the \cs{qtyproduct}
+function. The behavior of this function is similar to \cs{numproduct}, but with
+the addition of a unit to each number.
\begin{LaTeXdemo}
\qtyproduct{10 x 30 x 45}{\metre}
\end{LaTeXdemo}
@@ -487,9 +497,9 @@
\cs{qtyrange}\oarg{options}\marg{number1}\marg{number2}\marg{unit}
\end{syntax}
\end{function}
-Ranges of numbers with units can be handled using the \cs{qtyrange}
-function. The behaviour of this function is similar to \cs{numrange}, but
-with the addition of a unit to each number.
+Ranges of numbers with units can be handled using the \cs{qtyrange} function.
+The behavior of this function is similar to \cs{numrange}, but with the
+addition of a unit to each number.
\begin{LaTeXdemo}
\qtyrange{10}{30}{\metre}
\end{LaTeXdemo}
@@ -601,7 +611,7 @@
\toprule
Unit & Command & Symbol \\
\midrule
- \DescribeUnit{astronomicalunit} \\
+ \DescribeUnit[astronomical unit]{astronomicalunit} \\
\DescribeUnit{bel} \\
\DescribeUnit{dalton} \\
\DescribeUnit{day} \\
@@ -1014,11 +1024,11 @@
\texttt{S} column. This new column type can align material using a number of
different strategies, with the aim of flexibility of output without needing to
alter the input. The method used as standard is to place the decimal marker in
-the number at the centre of the cell and to align the material appropriately
+the number at the center of the cell and to align the material appropriately
(Table~\ref{tab:S:standard}).
\begin{LaTeXdemo}[code and float]
\begin{table}
- \caption{Standard behaviour of the \texttt{S} column type.%
+ \caption{Standard behavior of the \texttt{S} column type.%
\label{tab:S:standard}}
\begin{tabular}{@{}S@{}}
\toprule
@@ -1304,7 +1314,7 @@
input-close-uncertainty & Literal & ) \\
input-comparators & Literal &
<=>\cs{approx}\cs{ge}\cs{geq} \\
- & & \cs{gg}\cs{le}\cs{leq}\cs{ll} \cs{sim} \\
+ & & \cs{gg}\cs{le}\cs{leq}\cs{ll}\cs{sim} \\
input-decimal-markers & Literal & ., \\
input-digits & Literal & 0123456789 \\
input-exponent-markers & Literal & dDeE \\
@@ -1340,8 +1350,8 @@
\DescribeOption{input-comparators}
In addition to signs, \pkg{siunitx} can recognise comparators, such as |<|. The
-package will automatically carry out conversions for |<<|, |>>|, |<=| and |>=|
-to |\ll|, |\gg|, |\le| and |\ge|, respectively.
+package will automatically carry out conversions for |<<|, |>>|, |<=|, |>=| and
+|~| to |\ll|, |\gg|, |\le|, |\ge| and |\sim|, respectively.
\begin{LaTeXdemo}
\num{< 10} \\
\qty{>> 5}{\metre} \\
@@ -1442,7 +1452,7 @@
using the \opt{retain-explicit-decimal-marker} option. The inclusion of a
leading plus sign is usually unnecessary for positive numbers, and so they are
not retained as-standard when parsing. The \opt{retain-explicit-plus} option is
-available to control this behaviour. Similarly, an uncertainty of zero is
+available to control this behavior. Similarly, an uncertainty of zero is
normally not meaningful, and so is ignored by the parser. This can be
controlled using the \opt{retain-zero-uncertainty} option. Finally, a negative
sign for an entirely zero value may or may not have significance: this is
@@ -1687,7 +1697,7 @@
\DescribeOption{round-zero-positive}
When rounding negative numbers to a fixed number of places, a zero value may
result. Usually this is expressed as an unsigned value, but in some cases
-retaining the negative sign may be desirable. This behaviour can be controlled
+retaining the negative sign may be desirable. This behavior can be controlled
using the \opt{round-zero-positive} switch.
\begin{LaTeXdemo}
\sisetup{round-mode = places}%
@@ -1756,6 +1766,7 @@
print-unity-mantissa & Switch & true \\
print-zero-exponent & Switch & false \\
print-zero-integer & Switch & true \\
+ simplify-uncertainty & Switch & false \\
tight-spacing & Switch & false \\
uncertainty-descriptor-mode & Choice & bracket-separator \\
uncertainty-descriptor-separator & Literal & \cs{ } \\
@@ -1772,9 +1783,9 @@
\DescribeOption{group-separator}
Grouping digits into blocks of three is a common method to increase the ease of
reading of numbers. The \opt{group-digits} choice controls whether this
-behaviour applies, and takes the values \opt{all}, \opt{none}, \opt{decimal}
-and \opt{integer}. Grouping can be activated separately for the integer and
-decimal parts of a number using the appropriately-named values.
+behavior applies, and takes the values \opt{all}, \opt{none}, \opt{decimal} and
+\opt{integer}. Grouping can be activated separately for the integer and decimal
+parts of a number using the appropriately-named values.
\begin{LaTeXdemo}
\num{12345.67890} \\
\num[group-digits = none]{12345.67890} \\
@@ -1851,8 +1862,9 @@
\DescribeOption{output-open-uncertainty}
\DescribeOption{output-close-uncertainty}
\DescribeOption{uncertainty-separator}
+\DescribeOption{allow-uncertainty-breaks}
When input is given including a single uncertainty, it can be printed either
-with the uncertainty in brackets or as a separate number. This behaviour is
+with the uncertainty in brackets or as a separate number. This behavior is
controlled by the \opt{uncertainty-mode} choice. When this is set to
\opt{separate}, the uncertainty is printed as an entirely separate number
preceded by \cs{pm}. Other settings all place the uncertainty in brackets
@@ -1867,7 +1879,9 @@
\opt{uncertainty-separator} option. The opening and closing brackets used are
stored in \opt{output-open-uncertainty} and \opt{output-close-uncertainty},
respectively. Tokens may be inserted before the opening bracket using
-\opt{uncertainty-separator}.
+\opt{uncertainty-separator}. As standard, a break is allowed before a separated
+uncertainty: this can be suppressed by setting \opt{allow-uncertainty-breaks}
+to \opt{false}.
\begin{LaTeXdemo}
\num{123.45(120)} \\
\num{0.035(14)} \\
@@ -1904,6 +1918,15 @@
\num[uncertainty-descriptor-mode = subscript]{1.2(3)(4)}
\end{LaTeXdemo}
+\DescribeOption{simplify-uncertainty}
+Where the upper and lower parts of an asymmetrical uncertainty are identical,
+it may be desirable to print as in symmetrical format. This can be enabled
+using the \opt{simplify-uncertainty} option.
+\begin{LaTeXdemo}
+ \num{10.56(2:2)} \\
+ \num[simplify-uncertainty]{10.56(2:2)}
+\end{LaTeXdemo}
+
\DescribeOption{bracket-ambiguous-numbers}
There are certain combinations of numerical input which can be ambiguous. This
can be corrected by adding brackets in the appropriate place, and is controlled
@@ -1947,7 +1970,7 @@
\DescribeOption{print-implicit-plus}
\DescribeOption{print-mantissa-implicit-plus}
\DescribeOption{print-exponent-implicit-plus}
-It may be useful to force all numbers to have a sign. This behaviour is
+It may be useful to force all numbers to have a sign. This behavior is
controlled by the \opt{print-implicit-plus} option: this is used if given and
if no sign was present in the input. It is possible to set this behavior for
the exponent and mantissa independently.
@@ -2211,8 +2234,8 @@
\midrule
complex-angle-unit & Choice & degrees \\
complex-mode & Choice & input \\
+ complex-phase-command & Literal & \cs{angle} \\
complex-root-position & Choice & after-number \\
- complex-symbol-angle & Literal & \cs{angle} \\
complex-symbol-degree & Literal & \cs{degree} \\
input-complex-root & Literal & ij \\
output-complex-root & Literal & \verb=\mathrm{i}= \\
@@ -2269,18 +2292,19 @@
\end{LaTeXdemo}
\DescribeOption{complex-angle-unit}
-\DescribeOption{complex-symbol-angle}
\DescribeOption{complex-symbol-degree}
+\DescribeOption{complex-phase-command}
When printing or converting to polar form, the angle may be interpreted in
units set by \opt{complex-angle-unit}: one of \opt{degrees} or \opt{radians}.
-The symbol used to denote the angle, and that used for units of degrees,
-are controlled by the options \opt{complex-symbol-angle} and
-\opt{complex-symbol-degree}, respectively.
+The unit symbol used for degrees is controlled by \opt{complex-symbol-degree}.
+To allow control of the surrounding of the entire phase part, the option
+\opt{complex-phase-command} is available. This can be used for example to
+print using Steinmetz notation (which requires the \pkg{steinmetz} package).
\begin{LaTeXdemo}
\complexqty{1:1}{\ohm} \\
\complexqty[complex-angle-unit = radians]{1:1}{\ohm} \\
- \complexqty[complex-symbol-angle = \mathrm{A}]{1:1}{\ohm} \\
- \complexqty[complex-symbol-degree = d]{1:1}{\ohm}
+ \complexqty[complex-symbol-degree = d]{1:1}{\ohm} \\
+ \complexqty[complex-phase-command = \phase]{1:1}{\ohm}
\end{LaTeXdemo}
\DescribeOption{print-complex-unity}
@@ -2314,7 +2338,6 @@
fill-angle-degrees & Switch & false \\
fill-angle-minutes & Switch & false \\
fill-angle-seconds & Switch & false \\
- number-angle-product & Literal & \meta{empty} \\
\bottomrule
\end{tabular}
\end{table}
@@ -2333,16 +2356,10 @@
\ang[angle-mode = decimal]{2.67} \\
\ang[angle-mode = decimal]{2;3;4} \\
\end{LaTeXdemo}
+When integer angles are converted to arc format, the presence of minute and
+second components is controlled by the options \opt{fill-angle-minutes} and
+\opt{fill-angle-seconds} (see below)
-\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{quantity-product} option used by the \cs{qty} command.
-\begin{LaTeXdemo}
- \ang{2.67} \\
- \ang[number-angle-product = \,]{2.67}
-\end{LaTeXdemo}
-
\DescribeOption{angle-separator}
When angles are printed in arc format, the separation of the different parts is
set up using the \opt{arc-separator} option.
@@ -2402,7 +2419,7 @@
\DescribeOption{angle-symbol-over-decimal}
In some subject areas, most notably astronomy, the angle symbols are given over
-the decimal marker, rather than at the end of the number. This behaviour is
+the decimal marker, rather than at the end of the number. This behavior is
available using the \opt{angle-symbol-over-decimal} option.
\begin{LaTeXdemo}
\ang{45.697} \\
@@ -2440,11 +2457,15 @@
\DescribeOption{free-standing-units}
\DescribeOption{overwrite-functions}
-The \opt{free-standing-units} option controls whether the unit macros exist
-outside of the \cs{unit} and \cs{qty} arguments. When this option is
+The \opt{free-standing-units} option controls whether the unit macros are
+usable outside of the \cs{unit} and \cs{qty} arguments. When this option is
\opt{true}, \pkg{siunitx} creates the macros for general use. The standard
-method to achieve this does not overwrite any existing macros: this behaviour
-can be altered using the \opt{overwrite-commands} switch.
+method to achieve this does not overwrite any existing macros: this behavior
+can be altered using the \opt{overwrite-commands} switch. For technical
+reasons, when \opt{free-standing-units} is set \opt{false}, the names of unit
+macros still have to be defined: as such, they will be created if they do not
+exist, but will raise an error if used outside of the \cs{unit} and \cs{qty}
+arguments.
When using the approach of \enquote{free-standing} unit commands, only macros
created using \cs{DeclareSIUnit} are defined generally. Thus prefixes and
@@ -2457,10 +2478,10 @@
\DescribeOption{space-before-unit}
\DescribeOption{unit-optional-argument}
\DescribeOption{use-xspace}
-When \enquote{free standing} unit macros are created, their behaviour can be
+When \enquote{free standing} unit macros are created, their behavior can be
adjusted by a number of options. These are mainly intended for emulating the
input syntax of older packages. The option \opt{unit-optional-argument} gives
-the same behaviour for the inputs
+the same behavior for the inputs
\begin{LaTeXdemo}[code only]
\qty{10}{\metre}
\end{LaTeXdemo}
@@ -2468,7 +2489,7 @@
\begin{LaTeXdemo}[code only]
\metre[10].
\end{LaTeXdemo}
-The \opt{space-before-unit} and \opt{use-xspace} options control the behaviour
+The \opt{space-before-unit} and \opt{use-xspace} options control the behavior
at the \enquote{ends} of the unit macros. Activating \opt{space-before-unit}
inserts the number--unit space before the unit is printed. This is suitable for
the input syntax
@@ -2485,7 +2506,7 @@
\subsection{Using units}
Part of the power of \pkg{siunitx} is the ability to alter the output format
-for units without changing the input. The behaviour of units is therefore
+for units without changing the input. The behavior of units is therefore
controlled by a number of options which alter either the processing of units or
the output directly (Table~\ref{tab:opt:units:out}).
\begin{table}
@@ -2518,7 +2539,7 @@
\DescribeOption{inter-unit-product}
The separator between each unit is stored using the \opt{inter-unit-product}
option. The standard setting is a thin space: another common choice is a
-centred dot. To get the correct spacing it is necessary to use
+centered dot. To get the correct spacing it is necessary to use
|\ensuremath{{}\cdot{}}| in the latter case.
\begin{LaTeXdemo}
\unit{\farad\squared\lumen\candela} \\
@@ -2578,7 +2599,7 @@
\qty{20}{\metre\per\second} \\
\qty{30}{\joule\per\mole\per\kelvin}
\end{LaTeXdemo}
-It is possible for the behaviour of the \cs{per} function to depend on the
+It is possible for the behavior of the \cs{per} function to depend on the
prevailing math style. Setting either \opt{display-per-mode} or
\opt{inline-per-mode} independently can be used to achieve this. For example,
the following example will will use the \opt{symbol} setting for in line math,
@@ -2616,7 +2637,7 @@
By default, \cs{per} applies only to the next unit given.\footnote{This is the
standard method of reading units in English: for example,
\unit{\joule\per\mole\per\kelvin} is pronounced \enquote{joules per mole per
-kelvin}.} By setting the \opt{sticky-per} flag, this behaviour is changed so
+kelvin}.} By setting the \opt{sticky-per} flag, this behavior is changed so
that \cs{per} applies to all subsequent units.
\begin{LaTeXdemo}
\unit{\pascal\per\gray\henry} \\
@@ -2709,11 +2730,11 @@
cases (very long units, narrow columns, \foreign{etc}.) where breaks may be
needed. This can be turned on using the \opt{allow-quantity-breaks} option.
\begin{LaTeXdemo}
- \begin{minipage}{2.55cm}
+ \begin{minipage}{3cm}
% Gives an underfull hbox
- Some filler text \qty{10}{\metre} \\
+ X\hspace{2.4cm}\qty{10}{\metre} \\
\sisetup{allow-quantity-breaks}
- Some filler text \qty{10}{\metre}
+ X\hspace{2.4cm}\qty{10}{\metre}
\end{minipage}
\end{LaTeXdemo}
@@ -2855,8 +2876,8 @@
S[table-alignment-mode = none]
@{}}
\toprule
- {Decimal-centred} &
- {Simple centring} \\
+ {Decimal-centered} &
+ {Simple centering} \\
\midrule
12.345 & 12.345 \\
6,78 & 6,78 \\
@@ -3237,9 +3258,9 @@
\pkg{siunitx} allows the user to switch between the typographic conventions of
different (geographical) areas by using locales. Currently, the package is
supplied with configurations for locales \opt{UK}, \opt{US}, \opt{DE}
-(Germany), \opt{PL} (Poland), \opt{FR} (French), \opt{SI} (Slovene) and \opt{ZA} (South Africa).
-The \opt{locale}
-option is used to switch to a particular locale.
+(Germany), \opt{IT} (Italian) \opt{PL} (Poland), \opt{FR} (French), \opt{SI}
+(Slovene) and \opt{ZA} (South Africa). The \opt{locale} option is used to
+switch to a particular locale.
\begin{LaTeXdemo}
\qty{1.234}{\metre}\\
\qty[locale = DE]{6.789}{\metre}
@@ -3263,17 +3284,81 @@
\pkg{numprint} package has not been loaded, the letter |n| could be used as
this would suggest a numerical column.
-\section{Upgrading from version~\texorpdfstring{$2$}{2}%
+\section{Significant new features updates}
+
+Here, a short reminder for users of new features added since the release of
+version~\version{3} of the package is given.
+
+\subsection{Version~\version{3.1}}
+
+\begin{itemize}
+ \item Extend support for complex numbers to cover polar form including
+ new options to control output
+ \item Parse and format multiple uncertainties; new options added
+ to allow descriptions of each uncertainty
+ \item Customisation of text sub/superscript output
+ \item Selectable group size when dividing digits
+ \item Finer controls for \enquote{per mode} output
+ \item Support for negative zero values and controlled output for zero
+ values
+ \item Allow negative values to round to zero
+ \item Addition unit abbreviations for capacitance, power and magnetic
+ flux
+ \item Portuguese locale
+\end{itemize}
+
+\subsection{Version~\version{3.2}}
+
+\begin{itemize}
+ \item \enquote{Threshold} approach to producing exponent notation:
+ similar to a calculator
+ \item Finer control of printing plus signs using new options to split
+ mantissa and exponent
+ \item Support for updated prefixes introduced by \acro{bipm}
+ \item Revised alignment of uncertainties in tabulars
+\end{itemize}
+
+\subsection{Version~\version{3.3}}
+
+\begin{itemize}
+ \item Support for languages which need a begin as well as end phrase in
+ ranges, \foreign{e.g.}~Italian, was added; this includes appropriate
+ supporting options
+ \item Support for asymmetric uncertainties (tolerances)
+ \item Rounding extended to allow truncation (rounding down) for both
+ main values and when using the uncertainty part
+ \item Finer control of the appearance of brackets in ambiguous
+ output introduced by adding options for different contexts
+ \item Control of list and product input and output extended
+ \item Finer control of table alignment setup for bold values
+ \item New unit abbreviations for magnetic fields
+\end{itemize}
+
+\subsection{Version~\version{3.4}}
+
+\begin{itemize}
+ \item Support uncertainties in seconds part of arc angles
+ \item Control creation of minute and second components on conversion of
+ integer angles to arc format
+ \item Ability to simplify \enquote{asymmetric} uncertainties with
+ equal components in both directions
+ \item Combination of all control for angle unit formatting into
+ \cs{degree}, \cs{arcminute} and \cs{arcsecond} unit macros,
+ with \opt{number-angle-product} deprecated
+ \item Support for more varied printing of complex numbers phases
+\end{itemize}
+
+\section{Upgrading from version~\version{2}%
\label{sec:upgrading}}
-The package has been largely re-written internally between versions $2$ and
-$3$. A significant number of key--value settings have new, more descriptive,
-names. Where possible, older names are mapped to newer ones internally: you
-will be warned in the log if this is the case.
+The package has been largely re-written internally between versions \version{2}
+and \version{3}. A significant number of key--value settings have new, more
+descriptive, names. Where possible, older names are mapped to newer ones
+internally: you will be warned in the log if this is the case.
It is possible to use the \LaTeXe{} kernel mechanism to load the last
-version~$2$ release for documents that cannot be successfully processed using
-version~$3$. This can be achieved using
+version~\version{2} release for documents that cannot be successfully processed
+using version~\version{3}. This can be achieved using
\begin{LaTeXdemo}[code only]
\usepackage{siunitx}[=2021-04-09]
\end{LaTeXdemo}
@@ -3281,16 +3366,16 @@
\begin{LaTeXdemo}[code only]
\usepackage{siunitx}[=v2]
\end{LaTeXdemo}
-This approach will work with older systems which still have version~$2$
-installed, meaning that you can reliably use it to work between systems
-with different versions of \pkg{siunitx}.
+This approach will work with older systems which still have version~\version{2}
+installed, meaning that you can reliably use it to work between systems with
+different versions of \pkg{siunitx}.
\begin{function}{\SI, \SIlist, \SIrange, \si}
- In version~$3$, the document commands have been revised to be more
- descriptive. As such, the commands \cs{SI}, \cs{SIlist}, \cs{SIrange}
- and \cs{si} remain available but are not recommended for use in new
- documents. Use the new \cs{qty\ldots} commands instead: they are clearer
- and in some cases very slightly faster.
+ In version~\version{3}, the document commands have been revised to be more
+ descriptive. As such, the commands \cs{SI}, \cs{SIlist}, \cs{SIrange} and
+ \cs{si} remain available but are not recommended for use in new documents.
+ Use the new \cs{qty\ldots} commands instead: they are clearer and in some
+ cases very slightly faster.
\end{function}
Some changes have been made to the semantics of commands or options. Most
@@ -3303,15 +3388,15 @@
See Section~\ref{sec:hint:prefixes} for how to work with the new approach
if you want to print prefix information.
-The font control system has been completely re-written for version~$3$. The
-method used is entirely different from version~$2$. Emulation is therefore not
-provided for all outcomes: if you need non-standard font settings, you will
-need to adjust your source. See Section~\ref{sec:print} for more details on the
-options available in this area.
+The font control system has been completely re-written for version~\version{3}.
+The method used is entirely different from version~\version{2}. Emulation is
+therefore not provided for all outcomes: if you need non-standard font
+settings, you will need to adjust your source. See Section~\ref{sec:print} for
+more details on the options available in this area.
-The input approach for version~$3$ is slightly more structured and restricted
-than for version~$2$. As well as the updated names for document commands,
-this means that
+The input approach for version~\version{3} is slightly more structured and
+restricted than for version~\version{2}. As well as the updated names for
+document commands, this means that
\begin{itemize}
\item Products of numbers must now be given using the dedicated
\cs{numproduct} and \cs{qtyproduct} commands;
@@ -3328,7 +3413,7 @@
definition of the \cs{micro} prefix.
Translation of fixed strings is now carried out using the \pkg{translations}
-package. If you have manually set up translations in version~$2$ using
+package. If you have manually set up translations in version~\version{2} using
\pkg{translator}, you will need to load it manually.
The letter used for a numerical tabular column can now be selected by the
@@ -3416,10 +3501,14 @@
range-phrase = { \GetTranslation{to (numerical range)} },
}
\end{LaTeXdemo}
+The setting for \opt{range-open-phrase} is also adjusted to support a setting
+for \opt{range-open-phrase}: this requires some conditionals so is more
+complex.
+
If the current language is known to the \pkg{translations} package then the
result will be localised text. The preamble for this manual loads English,
-French, German, Polish, Spanish, Catalan, Portuguese and Brazilian as options,
-and also loads the \pkg{babel} package:
+French, German, Italian, Polish, Spanish, Catalan, Portuguese and Brazilian as
+options, and also loads the \pkg{babel} package:
\begin{LaTeXdemo}
% In English by default
\numlist{1;2;3} \\
@@ -3430,6 +3519,9 @@
\selectlanguage{german}%
\numlist{1;2;3} \\
\numrange{1}{10} \\
+ \selectlanguage{italian}%
+ \numlist{1;2;3} \\
+ \numrange{1}{10} \\
\selectlanguage{polish}%
\numlist{1;2;3} \\
\numrange{1}{10} \\
@@ -3453,9 +3545,9 @@
interference.
When the \pkg{physics} package is loaded before \pkg{siunitx}, the command
-\cs{qty} is not defined. Users may use the version~$2$ command \cs{SI},
-which can be used as a drop-in replacement for \cs{qty}. Alternatively,
-if the \pkg{siunitx} definition is preferred, you may use
+\cs{qty} is not defined. Users may use the version~\version{2} command \cs{SI},
+which can be used as a drop-in replacement for \cs{qty}. Alternatively, if the
+\pkg{siunitx} definition is preferred, you may use
\begin{LaTeXdemo}[code only]
\AtBeginDocument{\RenewCommandCopy\qty\SI}
\end{LaTeXdemo}
@@ -3656,7 +3748,7 @@
The \pkg{siunitx} code is designed to work correctly with functions in
headings. They will print correctly in headings and in the table of contents.
-As illustrated here, the standard behaviour is to ignore font changes. When the
+As illustrated here, the standard behavior is to ignore font changes. When the
\pkg{hyperref} package is loaded, the functions automatically \enquote{degrade
gracefully} to produce useful information in \acro{pdf} bookmarks. If you want
more control over the bookmark text, use the \cs{texorpdfstring} function from
@@ -3673,11 +3765,11 @@
as this will allow \unit{\ohm} to appear in bookmarks. Without the option,
the encoding used by \pkg{hyperref} does not support this symbol.
-\subsection{A left-aligned column visually centred under a heading%
+\subsection{A left-aligned column visually centered under a heading%
\label{sec:hint:left-column}}
When you have a column of non-related numbers, the usual advice is to make
-these left-aligned and then centre the resulting column under the heading. With
+these left-aligned and then center the resulting column under the heading. With
the \pkg{dcolumn} package, that would be done with something like
|D{x}{}{5.0}|. This is something of an abuse of the nature of a number, but can
also be done using \pkg{siunitx} (Table~\ref{tbl:xmpl:unrel}).
@@ -4139,7 +4231,7 @@
Firstly, the two parts should not be separated: a quantity is a product of the
number and the unit. With the exception of the symbols for plane angles
(\unit{\degree}, \unit{\arcminute} and \unit{\arcsecond}), the \acro{BIPM}
-specifies either a space or half-height (centred) dot should be
+specifies either a space or half-height (centered) dot should be
used~\cite{BIPM}.
\begin{LaTeXdemo}
A space for \qty{10}{\percent}\\
@@ -4153,9 +4245,9 @@
meanings. (In an all sanserif document, using sans serif for units is
reasonable.) The \pkg{siunitx} package defaults again follow this convention:
any local settings are ignored, and uses the current upright math font.
-However, there are occasions where this may not be the most desirable
-behaviour. A classic example would be in an all-bold section heading. As the
-surrounding text is bold, some people feel that any units should follow this.
+However, there are occasions where this may not be the most desirable behavior.
+A classic example would be in an all-bold section heading. As the surrounding
+text is bold, some people feel that any units should follow this.
\begin{LaTeXdemo}
Units should \textbf{not be bold: \qty{54}{\farad}}\\
\textbf{But perhaps in a running block,\\
@@ -4164,7 +4256,7 @@
\end{LaTeXdemo}
Symbols for units formed from other units by multiplication are indicated by
-means of either a half-height (that is, centred) dot or a (thin) space.
+means of either a half-height (that is, centered) dot or a (thin) space.
\begin{LaTeXdemo}
$\unit{\metre\second} = \text{metre second}$ \\
$\unit{\milli\second} = \text{millisecond}$ \\
@@ -4314,9 +4406,9 @@
\file{siunitx.tds.zip}. The later is most convenient for most users: simply
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}.
+The package requires \pkg{expl3} support as provided in the \pkg{l3kernel} and
+bundle, which is required by the \LaTeX{} kernel. As such, you are very
+unlikely to need to update this manually.
\section{Thanks}
Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty 2024-12-06 22:32:18 UTC (rev 73052)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty 2024-12-06 22:32:28 UTC (rev 73053)
@@ -23,14 +23,20 @@
%% siunitx.dtx (with options: `package,interfaces')
%% siunitx-emulation.dtx (with options: `package,interfaces')
%%
-\providecommand\DeclareRelease[3]{}
-\providecommand\DeclareCurrentRelease[2]{}
+\providecommand \IfFormatAtLeastTF { \@ifl at t@r \fmtversion }
+\IfFormatAtLeastTF { 2022-11-01 }
+ { }
+ {%
+ \PackageError{siunitx}{LaTeX kernel too old}
+ {%
+ You need a newer LaTeX to use this release of siunitx.\MessageBreak
+ Loading~siunitx~will~abort!%
+ }%
+ \endinput
+ }
\DeclareRelease{2}{2010-05-23}{siunitx-v2.sty}
\DeclareRelease{v2}{2010-05-23}{siunitx-v2.sty}
\DeclareCurrentRelease{}{2021-05-17}
-\@ifundefined{ExplLoaderFileDate}
- {\RequirePackage{expl3}}
- {}
\@ifl at t@r\ExplLoaderFileDate{2022-11-09}
{}
{%
@@ -41,7 +47,7 @@
}%
\endinput
}%
-\ProvidesExplPackage {siunitx} {2024-11-19} {3.3.24}
+\ProvidesExplPackage {siunitx} {2024-12-06} {3.4.0}
{A comprehensive (SI) units package}
\msg_new:nnnn { siunitx } { incompatible-package }
{ Package~'#1'~incompatible. }
@@ -60,7 +66,6 @@
\clist_map_function:nN { SIunits , sistyle , units }
\__siunitx_load_check:n
}
-\providecommand \IfFormatAtLeastTF { \@ifl at t@r \fmtversion }
\tl_new:N \l__siunitx_tmp_tl
\cs_generate_variant:Nn \keys_set:nn { nx }
\cs_generate_variant:Nn \tl_if_blank:nTF { e }
@@ -165,19 +170,24 @@
\tl_replace_all:Nnn #1 {#2} {#3}
\__siunitx_number_normalize_aux:NnN #1
}
-\tl_const:Nn \c__siunitx_number_normalize_tl
- {
- { -+ } \mp
- { +- } \pm
- { << } \ll
- { <= } \le
- { >> } \gg
- { >= } \ge
- }
\group_begin:
+ \char_set_catcode_other:N \~
+ \tl_const:Nn \c__siunitx_number_normalize_tl
+ {
+ { -+ } \mp
+ { +- } \pm
+ { << } \ll
+ { <= } \le
+ { >> } \gg
+ { >= } \ge
+ { ~ } \sim
+ }
+\group_end:
+\group_begin:
\char_set_catcode_active:N \-
\char_set_catcode_active:N \<
\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
@@ -186,6 +196,8 @@
{ \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
@@ -216,6 +228,8 @@
\siunitx_number_normalize_symbols:N \l__siunitx_number_arg_tl
\tl_map_inline:Nn \l__siunitx_number_input_ignore_tl
{ \tl_remove_all:Nn \l__siunitx_number_arg_tl {##1} }
+ \protected at edef \l__siunitx_number_input_digit_tl
+ { \l__siunitx_number_input_digit_tl }
\tl_if_empty:NF \l__siunitx_number_arg_tl
{
\__siunitx_number_parse_comparator:
@@ -2088,6 +2102,8 @@
\tl_new:N \l_siunitx_number_output_decimal_tl
\keys_define:nn { siunitx }
{
+ allow-uncertainty-breaks .bool_set:N =
+ \l__siunitx_number_uncert_break_bool ,
bracket-ambiguous-numbers .bool_set:N =
\l_siunitx_number_bracket_ambiguous_bool ,
bracket-negative-numbers .bool_set:N =
@@ -2157,6 +2173,8 @@
\l__siunitx_number_zero_exponent_bool ,
print-zero-integer .bool_set:N =
\l__siunitx_number_zero_integer_bool ,
+ simplify-uncertainty .bool_set:N =
+ \l__siunitx_number_uncert_simplify_bool ,
tight-spacing .bool_set:N =
\l__siunitx_number_tight_bool ,
uncertainty-descriptor-mode .choices:nn =
@@ -2586,20 +2604,28 @@
{ \__siunitx_number_output_uncert_A:nnnnn {#1} {#2} {#3} #4 }
\cs_new_eq:NN \__siunitx_number_output_uncert_A_multi:nnnn
\__siunitx_number_output_uncert_A:nnnn
-\cs_new:Npx \__siunitx_number_output_uncert_A:nnnnn #1#2#3#4#5
+\cs_new:Npn \__siunitx_number_output_uncert_A:nnnnn #1#2#3#4#5
{
+ \bool_lazy_and:nnTF
+ { \l__siunitx_number_uncert_simplify_bool }
+ { \str_if_eq_p:nn {#4} {#5} }
+ { \__siunitx_number_output_uncert_S_sep:nnnn {#1} {#2} { } {#4} }
+ { \__siunitx_number_output_uncert_A_aux:nnnn {#1} {#2} {#4} {#5} }
+ }
+\cs_new:Npx \__siunitx_number_output_uncert_A_aux:nnnn #1#2#3#4
+ {
{ }
^
{
+
\exp_not:N \__siunitx_number_output_uncert_augment:nnnn
- {#4} {#1} {#4} { }
+ {#3} {#1} {#3} { }
}
\char_generate:nn { `\_ } { 8 }
{
-
\exp_not:N \__siunitx_number_output_uncert_augment:nnnn
- {#5} {#1} {#5} { }
+ {#4} {#1} {#4} { }
}
\exp_not:N \__siunitx_number_output_uncertainty_unaligned:n {#2}
}
@@ -2621,7 +2647,8 @@
\bool_if:NTF \l__siunitx_number_tight_bool
{ \exp_not:N \mathord }
{ \use:n }
- { \exp_not:n { \pm } }
+ { \pm }
+ \bool_if:NF \l__siunitx_number_uncert_break_bool { \exp_not:N \nobreak }
\exp_not:n {#2}
\__siunitx_number_output_uncert_augment:nnnn {#4} {#1} {#4} {#2}
}
@@ -2829,6 +2856,7 @@
}
\keys_set:nn { siunitx }
{
+ allow-uncertainty-breaks = true ,
bracket-ambiguous-numbers = true ,
bracket-negative-numbers = false ,
drop-exponent = false ,
@@ -2879,6 +2907,7 @@
round-pad = true ,
round-precision = 2 ,
round-zero-positive = true ,
+ simplify-uncertainty = false ,
tight-spacing = false ,
uncertainty-descriptor-mode = bracket-separator ,
uncertainty-descriptor-separator = \ ,
@@ -2931,8 +2960,6 @@
\l__siunitx_angle_fill_minutes_bool ,
fill-angle-seconds .bool_set:N =
\l__siunitx_angle_fill_seconds_bool ,
- number-angle-product .tl_set:N =
- \l__siunitx_angle_product_tl
}
\bool_new:N \l__siunitx_angle_force_arc_bool
\bool_new:N \l__siunitx_angle_force_decimal_bool
@@ -2974,7 +3001,7 @@
\bool_if:NTF \l__siunitx_angle_force_decimal_bool
{
\siunitx_angle:e
- { \fp_eval:n { #1 + (#2) / 60 + (#3) / 3600 } }
+ { \fp_eval:n { #1 + ( 0 #2 ) / 60 + ( 0 #3 ) / 3600 } }
}
{ \__siunitx_angle_arc_sign:nnn {#1} {#2} {#3} }
}
@@ -2994,22 +3021,35 @@
\cs_generate_variant:Nn \siunitx_angle:nnn { eee , xxx }
\cs_new_protected:Npn \__siunitx_angle_arc_convert:n #1
{
- \siunitx_angle:eee
- { \fp_eval:n { trunc(#1,0) } }
- { \fp_eval:n { abs(trunc((#1 - trunc(#1,0)) * 60,0)) } }
+ \__siunitx_angle_arc_convert:w #1 . \q_nil . \q_stop
+ }
+\cs_generate_variant:Nn \__siunitx_angle_arc_convert:n { e }
+\cs_new_protected:Npn \__siunitx_angle_arc_convert:w #1 . #2 . #3 \q_stop
+ {
+ \quark_if_nil:nTF {#2}
{
- \fp_eval:n
+ \siunitx_angle:eee
+ { \fp_eval:n { trunc(#1,0) } }
+ { \bool_if:NT \l__siunitx_angle_fill_minutes_bool { 0 } }
+ { \bool_if:NT \l__siunitx_angle_fill_seconds_bool { 0 } }
+ }
+ {
+ \siunitx_angle:eee
+ { \fp_eval:n { trunc(#1.#2,0) } }
+ { \fp_eval:n { abs(trunc((#1.#2 - trunc(#1,0)) * 60,0)) } }
{
- abs
- (
- (#1 - trunc(#1,0)) * 60
- - trunc((#1 - trunc(#1,0)) * 60,0)
- )
- * 60
+ \fp_eval:n
+ {
+ abs
+ (
+ (#1.#2 - trunc(#1.#2,0)) * 60
+ - trunc((#1.#2 - trunc(#1.#2,0)) * 60,0)
+ )
+ * 60
+ }
}
}
}
-\cs_generate_variant:Nn \__siunitx_angle_arc_convert:n { e }
\clist_const:Nn \c__siunitx_angle_parts_tl { degrees , minutes , seconds }
\tl_new:N \l__siunitx_angle_degrees_tl
\tl_new:N \l__siunitx_angle_minutes_tl
@@ -3018,36 +3058,62 @@
\tl_new:N \l__siunitx_angle_signed_bool
\keys_precompile:nnN
{ siunitx }
+ { input-comparators = }
+ \l__siunitx_angle_tmp_tl
+\cs_set_protected:Npx \__siunitx_angle_suppress_comp:
+ { \exp_not:V \l__siunitx_angle_tmp_tl }
+\keys_precompile:nnN
+ { siunitx }
+ { input-exponent-markers = }
+ \l__siunitx_angle_tmp_tl
+\cs_set_protected:Npx \__siunitx_angle_suppress_exp:
+ { \exp_not:V \l__siunitx_angle_tmp_tl }
+\keys_precompile:nnN
+ { siunitx }
{
input-close-uncertainty = ,
- input-exponent-markers = ,
input-open-uncertainty = ,
input-uncertainty-signs =
}
\l__siunitx_angle_tmp_tl
-\cs_set_protected:Npx \__siunitx_angle_suppress_exp_uncert:
+\cs_set_protected:Npx \__siunitx_angle_suppress_uncert:
{ \exp_not:V \l__siunitx_angle_tmp_tl }
-\keys_precompile:nnN
- { siunitx }
- { input-comparators = }
- \l__siunitx_angle_tmp_tl
-\cs_set_protected:Npx \__siunitx_angle_suppress_comp:
- { \exp_not:V \l__siunitx_angle_tmp_tl }
\cs_new_protected:Npn \__siunitx_angle_arc_sign:nnn #1#2#3
{
\group_begin:
- \__siunitx_angle_suppress_exp_uncert:
+ \__siunitx_angle_suppress_exp:
\tl_clear:N \l__siunitx_angle_sign_tl
\bool_set_false:N \l__siunitx_angle_signed_bool
- \str_if_eq:nnTF {#1} { -0 }
- {
- \__siunitx_angle_arc_sign:nn { } { degrees }
- \__siunitx_angle_suppress_comp:
- \tl_set:Nn \l__siunitx_angle_sign_tl { - }
- \bool_set_true:N \l__siunitx_angle_signed_bool
- }
- { \__siunitx_angle_arc_sign:nn {#1} { degrees } }
- \__siunitx_angle_arc_sign:nn {#2} { minutes }
+ \group_begin:
+ \__siunitx_angle_suppress_uncert:
+ \str_if_eq:nnTF {#1} { -0 }
+ {
+ \__siunitx_angle_arc_sign:nn { } { degrees }
+ \__siunitx_angle_suppress_comp:
+ \tl_set:Nn \l__siunitx_angle_sign_tl { - }
+ \bool_set_true:N \l__siunitx_angle_signed_bool
+ }
+ { \__siunitx_angle_arc_sign:nn {#1} { degrees } }
+ \__siunitx_angle_arc_sign:nn {#2} { minutes }
+ \tl_set:Nx \l__siunitx_angle_tmp_tl
+ {
+ \tl_set:Nn \exp_not:N \l__siunitx_angle_sign_tl
+ { \exp_not:V \l__siunitx_angle_sign_tl }
+ \tl_set:Nn \exp_not:N \l__siunitx_angle_degrees_tl
+ { \exp_not:V \l__siunitx_angle_degrees_tl }
+ \tl_set:Nn \exp_not:N \l__siunitx_angle_minutes_tl
+ { \exp_not:V \l__siunitx_angle_minutes_tl }
+ \exp_not:c
+ {
+ bool_set_
+ \bool_if:NTF \l__siunitx_angle_signed_bool
+ { true }
+ { false }
+ :N
+ }
+ \exp_not:N \l__siunitx_angle_signed_bool
+ }
+ \exp_after:wN \group_end: \l__siunitx_angle_tmp_tl
\__siunitx_angle_arc_sign:nn {#3} { seconds }
\tl_if_empty:NF \l__siunitx_angle_sign_tl
{
@@ -3074,8 +3140,11 @@
}
{
\siunitx_number_parse:nN {#1} \l__siunitx_angle_tmp_tl
- \exp_after:wN \__siunitx_angle_extract_sign:nnnnnnnn \l__siunitx_angle_tmp_tl {#2}
- \bool_set_true:N \l__siunitx_angle_signed_bool
+ \tl_if_empty:NF \l__siunitx_angle_tmp_tl
+ {
+ \exp_after:wN \__siunitx_angle_extract_sign:nnnnnnnn \l__siunitx_angle_tmp_tl {#2}
+ \bool_set_true:N \l__siunitx_angle_signed_bool
+ }
}
}
\cs_new_protected:Npn \__siunitx_angle_arc_sign_auxi:n #1
@@ -3236,10 +3305,11 @@
{ \siunitx_print_number:n {#1#2#3#4#5} }
\cs_new_protected:Npn \__siunitx_angle_arc_print_auxvi:n #1
{
- \nobreak
- \l__siunitx_angle_product_tl
- \siunitx_unit_format:nN {#1} \l__siunitx_angle_tmp_tl
- \siunitx_print_unit:V \l__siunitx_angle_tmp_tl
+ \group_begin:
+ \siunitx_unit_options_apply:n {#1}
+ \siunitx_unit_format:nN {#1} \l__siunitx_angle_tmp_tl
+ \siunitx_quantity_print:nV { } \l__siunitx_angle_tmp_tl
+ \group_end:
}
\msg_new:nnnn { siunitx } { arc-multi-sign }
{ Multiple~signs~given~for~arc~angle! }
@@ -3247,6 +3317,26 @@
An~angle~given~as~an~arc~should~have~at~most~one~sign:~
only~the~first~sign~will~be~used.
}
+\msg_new:nnn { siunitx } { angle-option-deprecated }
+ {
+ Option~"#1"~has~been~deprecated~in~this~release.\\ \\
+ Set~the~"quantity-product"~option~for~the~units~
+ \token_to_str:N \arcminute,~\arcsecond\ and~\degree\ instead.
+ }
+\keys_define:nn { siunitx }
+ {
+ number-angle-product .code:n =
+ {
+ \msg_info:nnn { siunitx } { angle-option-deprecated }
+ { number-angle-product }
+ \siunitx_unit_options_declare:Nn \arcminute
+ { quantity-product = {#1} }
+ \siunitx_unit_options_declare:Nn \arcsecond
+ { quantity-product = {#1} }
+ \siunitx_unit_options_declare:Nn \degree
+ { quantity-product = {#1} }
+ }
+ }
\keys_set:nn { siunitx }
{
angle-mode = input ,
@@ -3257,8 +3347,7 @@
angle-separator = ,
fill-angle-degrees = false ,
fill-angle-minutes = false ,
- fill-angle-seconds = false ,
- number-angle-product =
+ fill-angle-seconds = false
}
\fp_new:N \l__siunitx_complex_tmp_fp
\tl_new:N \l__siunitx_complex_tmp_tl
@@ -3298,13 +3387,13 @@
{ \bool_set_true:N \l__siunitx_complex_polar_degree_bool } ,
complex-angle-unit / radians .code:n =
{ \bool_set_false:N \l__siunitx_complex_polar_degree_bool } ,
+ complex-phase-command .tl_set:N =
+ \l__siunitx_complex_phase_tl ,
complex-root-position .choice: ,
complex-root-position / after-number .code:n =
{ \bool_set_true:N \l__siunitx_complex_root_after_bool } ,
complex-root-position / before-number .code:n =
{ \bool_set_false:N \l__siunitx_complex_root_after_bool } ,
- complex-symbol-angle .tl_set:N =
- \l__siunitx_complex_symbol_angle_tl ,
complex-symbol-degree .tl_set:N =
\l__siunitx_complex_symbol_degree_tl ,
input-complex-root .tl_set:N =
@@ -3838,17 +3927,9 @@
\bool_if:NTF \l_siunitx_number_parse_bool
{ \siunitx_number_output:N \l__siunitx_complex_mag_tl }
{ \exp_not:V \l__siunitx_complex_mag_tl }
- \exp_not:V \l__siunitx_complex_symbol_angle_tl
- \mathord % TEMP
- \exp_not:V \l__siunitx_complex_angle_tl
}
\siunitx_print_number:V \l__siunitx_complex_tmp_tl
- \bool_if:NT \l__siunitx_complex_polar_degree_bool
- {
- \siunitx_unit_format:VN \l__siunitx_complex_symbol_degree_tl \l__siunitx_complex_tmp_tl
- \nobreak
- \siunitx_print_unit:V \l__siunitx_complex_tmp_tl
- }
+ \l__siunitx_complex_phase_tl { \__siunitx_complex_format_phase: }
\siunitx_quantity_print:nV { } \l__siunitx_complex_unit_tl
}
\cs_new_protected:cpn { __siunitx_complex_format_polar_combine-exponent:n } #1
@@ -3873,6 +3954,18 @@
{ \siunitx_number_process:NN \l__siunitx_complex_mag_tl \l__siunitx_complex_mag_tl }
\siunitx_unit_format:nN {#1} \l__siunitx_complex_unit_tl
}
+\cs_new_protected:Npn \__siunitx_complex_format_phase:
+ {
+ \group_begin:
+ \bool_if:NTF \l__siunitx_complex_polar_degree_bool
+ {
+ \exp_args:NV \siunitx_unit_options_apply:n \l__siunitx_complex_symbol_degree_tl
+ \siunitx_unit_format:VN \l__siunitx_complex_symbol_degree_tl \l__siunitx_complex_tmp_tl
+ }
+ { \tl_clear:N \l__siunitx_complex_tmp_tl }
+ \siunitx_quantity_print:VV \l__siunitx_complex_angle_tl \l__siunitx_complex_tmp_tl
+ \group_end:
+ }
\cs_new:Npn \__siunitx_complex_convert_cartesian:nn #1#2
{
\__siunitx_complex_convert_cartesian_aux:ee
@@ -3924,7 +4017,7 @@
\tl_if_blank:nTF {#4}
{ \__siunitx_complex_convert_polar_auxiv:nnw {#1} {#2} #3 - - \q_stop }
{
- \str_if_eq:nnTF {#4} { i }
+ \str_if_eq:eeTF { \use:n #4 } { i }
{ \__siunitx_complex_convert_polar_auxvii:nnn {#2#3} { 1 } {#1} }
{ \__siunitx_complex_convert_polar_auxv:nnw {#2#3} {#1} #4 i \q_nil i \q_stop }
}
@@ -3934,7 +4027,7 @@
\tl_if_blank:nTF {#4}
{ \__siunitx_complex_convert_polar_auxv:nnw { } {#1} #2#3 i \q_nil i \q_stop }
{
- \str_if_eq:nnTF {#4} { i }
+ \str_if_eq:eeTF { \use:n #4 } { i }
{ \__siunitx_complex_convert_polar_auxvii:nnn { } { -1 } {#1} }
{ \__siunitx_complex_convert_polar_auxv:nnw {#2#3} {#1} -#4 i \q_nil i \q_stop }
}
@@ -3980,15 +4073,25 @@
Complex~numbers~in~polar~form~must~have~both~a~magnitude~and~and~
angle.
}
+\keys_define:nn { siunitx }
+ {
+ complex-symbol-angle .code:n =
+ {
+ \msg_info:nnnn { siunitx } { option-deprecated }
+ { number-angle-product }
+ { complex-phase-command }
+ complex-phase-command = {#1}
+ }
+ }
\keys_set:nn { siunitx }
{
- complex-angle-unit = degrees ,
- complex-mode = input ,
- complex-root-position = after-number ,
- complex-symbol-angle = \angle ,
- complex-symbol-degree = \degree ,
- input-complex-root = ij ,
- output-complex-root = \mathrm { i } ,
+ complex-angle-unit = degrees ,
+ complex-mode = input ,
+ complex-root-position = after-number ,
+ complex-phase-command = \ensuremath { \angle } ,
+ complex-symbol-degree = \degree ,
+ input-complex-root = ij ,
+ output-complex-root = \mathrm { i } ,
print-complex-unity = false
}
\cs_generate_variant:Nn \seq_use:Nnnn { NVVV }
@@ -4653,9 +4756,9 @@
compound-exponents = individual ,
compound-final-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
compound-independent-prefix = false ,
compound-open-boundary = ,
@@ -4662,12 +4765,12 @@
compound-open-bracket = ( , % )
compound-pair-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
compound-separator =
- { , \ifmmode \ \else \space \fi } ,
+ { , \TextOrMath { \space } { \ } } ,
compound-separator-mode = text ,
compound-units = repeat , % (
list-close-bracket = ) ,
@@ -4674,20 +4777,20 @@
list-exponents = individual ,
list-final-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
list-independent-prefix = false ,
list-open-bracket = ( , % )
list-pair-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { and }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
list-separator =
- { , \ifmmode \ \else \space \fi } ,
+ { , \TextOrMath { \space } { \ } } ,
list-units = repeat , % (
product-close-bracket = ) ,
product-exponents = individual ,
@@ -4696,9 +4799,9 @@
product-open-bracket = ( , % )
product-phrase =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { by }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
product-symbol = \times ,
product-units = repeat , % (
@@ -4709,9 +4812,9 @@
range-open-phrase = ,
range-phrase =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { to }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
range-units = repeat
}
@@ -4774,6 +4877,7 @@
\DeclareTranslation { Italian } { and } { e }
\DeclareTranslation { Portuguese } { and } { e }
\DeclareTranslation { Slovene } { and } { in }
+ \DeclareTranslation { Italian } { from~(numerical~range) } { da }
\DeclareTranslation { Brazilian } { to~(numerical~range) } { a }
\DeclareTranslation { Catalan } { to~(numerical~range) } { a }
\DeclareTranslation { English } { to~(numerical~range) } { to }
@@ -4788,21 +4892,39 @@
{
list-final-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { \GetTranslation { and } }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
- list-pair-separator =
+ list-pair-separator =
{
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
\text { \GetTranslation { and } }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
} ,
- range-phrase =
+ range-open-phrase =
{
- \ifmmode \ \else \space \fi
+ \bool_lazy_or:nnF
+ {
+ \tl_if_blank_p:e
+ { \GetTranslation { from~(numerical~range) } }
+ }
+ {
+ \str_if_eq_p:ee
+ { \GetTranslation { from~(numerical~range) } }
+ { from~(numerical~range) }
+ }
+ {
+ \TextOrMath { \space } { \ }
+ \text { \GetTranslation { from~(numerical~range) } }
+ \TextOrMath { \space } { \ }
+ }
+ } ,
+ range-phrase =
+ {
+ \TextOrMath { \space } { \ }
\text { \GetTranslation { to~(numerical~range) } }
- \ifmmode \ \else \space \fi
+ \TextOrMath { \space } { \ }
}
}
}
@@ -6409,26 +6531,24 @@
{#2}
{ \__siunitx_unit_parse_unit:Nn #1 {#2} }
}
+ \siunitx_unit_options_declare:Nn #1 {#3}
+ }
+\cs_generate_variant:Nn \siunitx_declare_unit:Nnn { Ne , Nx }
+\cs_new_protected:Npn \siunitx_unit_options_declare:Nn #1#2
+ {
\tl_clear_new:c { l__siunitx_unit_options_ \token_to_str:N #1 _tl }
- \tl_if_empty:nF {#3}
- { \tl_set:cn { l__siunitx_unit_options_ \token_to_str:N #1 _tl } {#3} }
+ \tl_set:cn { l__siunitx_unit_options_ \token_to_str:N #1 _tl } {#2}
}
-\cs_generate_variant:Nn \siunitx_declare_unit:Nnn { Ne , Nx }
-\bool_new:N \l__siunitx_unit_options_bool
\cs_new_protected:Npn \siunitx_unit_options_apply:n #1
{
- \bool_if:NF \l__siunitx_unit_options_bool
+ \tl_if_single_token:nT {#1}
{
- \tl_if_single_token:nT {#1}
+ \tl_if_exist:cT { l__siunitx_unit_options_ \token_to_str:N #1 _tl }
{
- \tl_if_exist:cT { l__siunitx_unit_options_ \token_to_str:N #1 _tl }
- {
- \keys_set:nv { siunitx }
- { l__siunitx_unit_options_ \token_to_str:N #1 _tl }
- }
+ \keys_set:nv { siunitx }
+ { l__siunitx_unit_options_ \token_to_str:N #1 _tl }
}
}
- \bool_set_true:N \l__siunitx_unit_options_bool
}
\__siunitx_unit_set_symbolic:Nnn \per
{ / }
@@ -7748,16 +7868,11 @@
quantity-product = \, ,
separate-uncertainty-units = bracket
}
-\cs_new:Npn \__siunitx_quantity_non_latin:n #1
- { \codepoint_generate:nn {#1} { \char_value_catcode:n {#1} } }
-\siunitx_declare_unit:Nen \arcminute
- { \__siunitx_quantity_non_latin:n { "02B9 } }
+\siunitx_unit_options_declare:Nn \arcminute
{ quantity-product = { } }
-\siunitx_declare_unit:Nen \arcsecond
- { \__siunitx_quantity_non_latin:n { "02BA } }
+\siunitx_unit_options_declare:Nn \arcsecond
{ quantity-product = { } }
-\siunitx_declare_unit:Nen \degree
- { \__siunitx_quantity_non_latin:n { "00B0 } }
+\siunitx_unit_options_declare:Nn \degree
{ quantity-product = { } }
\tl_new:N \l__siunitx_symbol_tmpa_tl
\tl_new:N \l__siunitx_symbol_tmpb_tl
@@ -7918,6 +8033,10 @@
}
}
}
+\DeclareHookRule { begindocument } { siunitx } { after }
+ { unicode-math-luatex }
+\DeclareHookRule { begindocument } { siunitx } { after }
+ { unicode-math-xetex }
\AtBeginDocument
{
\@ifpackageloaded { hyperref }
@@ -8818,19 +8937,7 @@
{ \msg_info:nnnn { siunitx } { option-deprecated } {#1} {#2} }
\seq_gput_right:Nn \g__siunitx_deprecated_seq {#1}
}
-\IfFormatAtLeastTF { 2022-06-01 }
- { \ProcessKeyOptions [ siunitx ] }
- {
- \RequirePackage { l3keys2e }
- \ProcessKeysOptions { siunitx }
- }
-\IfFormatAtLeastTF { 2020-10-01 }
- { }
- {
- \RequirePackage { xparse }
- \providecommand \ExpandArgs [1]
- { \cs_if_exist_use:c { exp_args:N #1 } }
- }
+\ProcessKeyOptions
\NewDocumentCommand \DeclareSIPower { +m +m m }
{
\siunitx_declare_power:NNn #1 #2 {#3}
@@ -9145,7 +9252,7 @@
{
\seq_map_inline:Nn \c__siunitx_bookmark_seq
{
- \cs_set_eq:Nc #1
+ \ExpandArgs { Nc } \DeclareCommandCopy #1
{ \cs_to_str:N #1 \c_space_tl ( pdfstring ~ context ) }
}
}
@@ -9331,20 +9438,22 @@
}
\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
+ \exp_not:N \TextOrMath
+ {
+ \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 }
+ }
+ }
+ {
+ \cs_if_exist:NTF \upOmega
+ { \exp_not:N \upOmega }
+ { \exp_not:N \Omega }
+ }
}
}
\siunitx_declare_unit:Nn \celsius { \degreeCelsius }
More information about the tex-live-commits
mailing list.