texlive[64791] Master/texmf-dist: siunitx (23oct22)
commits+karl at tug.org
commits+karl at tug.org
Sun Oct 23 22:37:23 CEST 2022
Revision: 64791
http://tug.org/svn/texlive?view=revision&revision=64791
Author: karl
Date: 2022-10-23 22:37:22 +0200 (Sun, 23 Oct 2022)
Log Message:
-----------
siunitx (23oct22)
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-complex.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 2022-10-23 20:36:54 UTC (rev 64790)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md 2022-10-23 20:37:22 UTC (rev 64791)
@@ -7,6 +7,15 @@
## [Unreleased]
+## [v3.1.9] - 2022-10-23
+
+### Added
+- Option `print-complex-unity`
+
+## Fixed
+- Printing of complex values of exactly one (see issue
+ [\#625](https://github.com/josephwright/siunitx/issues/625))
+
## [v3.1.8] - 2022-10-04
### Fixed
@@ -1817,7 +1826,8 @@
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.8...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.9...HEAD
+[v3.1.9]: https://github.com/josephwright/siunitx/compare/v3.1.8...v3.1.9
[v3.1.8]: https://github.com/josephwright/siunitx/compare/v3.1.7...v3.1.8
[v3.1.7]: https://github.com/josephwright/siunitx/compare/v3.1.6...v3.1.7
[v3.1.6]: https://github.com/josephwright/siunitx/compare/v3.1.5...v3.1.6
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-complex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx 2022-10-23 20:36:54 UTC (rev 64790)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx 2022-10-23 20:37:22 UTC (rev 64791)
@@ -164,6 +164,14 @@
% is |\mathrm{i}|.
% \end{function}
%
+% \begin{function}{print-complex-unity}
+% \begin{syntax}
+% |print-complex-unity| = |true|\verb"|"|false|
+% \end{syntax}
+% Switch to determine if the number \num{1} is printed for a complex
+% part which is exactly unity.
+% \end{function}
+%
% \end{documentation}
%
% \begin{implementation}
@@ -286,7 +294,9 @@
input-complex-root .tl_set:N =
\l_@@_input_root_tl ,
output-complex-root .tl_set:N =
- \l_@@_output_root_tl
+ \l_@@_output_root_tl ,
+ print-complex-unity .bool_set:N =
+ \l_@@_print_unity_bool
}
% \end{macrocode}
% \end{variable}
@@ -860,8 +870,7 @@
\cs_new_protected:Npn \@@_drop_exponent:nnnnnnn #1#2#3#4#5#6#7
{ \tl_set:Nn \l_@@_real_tl { {#1} {#2} {#3} {#4} {#5} { } { 0 } } }
% \end{macrocode}
-% Ensure the imaginary part has a sign, and also deal with the case
-% where there is no mantissa to print (as it is $1$).
+% Ensure the imaginary part has a sign.
% \begin{macrocode}
\cs_new_protected:Npn \@@_format_sign:nnnnnnn #1#2#3#4#5#6#7
{
@@ -873,14 +882,7 @@
{ \tl_if_empty:NF \l_@@_real_tl { + } }
{ \exp_not:n {#2} }
}
- \tl_if_blank:nTF {#4}
- {
- \str_if_eq:nnTF {#3} { 1 }
- { { } { } }
- { \exp_not:n { {#3} {#4} } }
- }
- { \exp_not:n { {#3} {#4} } }
- \exp_not:n { {#5} {#6} {#7} }
+ \exp_not:n { {#3} {#4} {#5} {#6} {#7} }
}
}
% \end{macrocode}
@@ -893,9 +895,12 @@
\q_nil #9 \q_stop
{
\tl_set:Nn \l_@@_sign_tl {#1#2}
- \bool_lazy_and:nnTF
- { \str_if_eq_p:nn {#3} { 1 } }
- { \tl_if_blank_p:n {#5} }
+ \bool_lazy_all:nTF
+ {
+ { ! \l_@@_print_unity_bool }
+ { \str_if_eq_p:nn {#3} { 1 } }
+ { \tl_if_blank_p:n {#5} }
+ }
{ \@@_extract_exponent_aux:nw {#6#7#8} }
{ \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} }
#9 \q_stop
@@ -1200,13 +1205,14 @@
% \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-symbol-angle = \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.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx 2022-10-23 20:36:54 UTC (rev 64790)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx 2022-10-23 20:37:22 UTC (rev 64791)
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-10-04} {3.1.8}
+\ProvidesExplPackage {siunitx} {2022-10-23} {3.1.9}
{A comprehensive (SI) units package}
% \end{macrocode}
%
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex 2022-10-23 20:36:54 UTC (rev 64790)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex 2022-10-23 20:37:22 UTC (rev 64791)
@@ -2055,6 +2055,7 @@
complex-symbol-degree & Literal & \cs{degree} \\
input-complex-root & Literal & ij \\
output-complex-root & Literal & \verb=\mathrm{i}= \\
+ print-complex-unity & Switch & false \\
\bottomrule
\end{tabular}
\end{table}
@@ -2121,6 +2122,15 @@
\complexqty[complex-symbol-degree = d]{1:1}{\ohm}
\end{LaTeXdemo}
+\DescribeOption{print-complex-unity}
+When the complex part of a number is exactly \num{1}, it is possible to either
+print or suppress the value. This is controlled by the switch
+\opt{print-complex-unity}.
+\begin{LaTeXdemo}
+ \complexqty{1i}{\ohm} \\
+ \complexqty[print-complex-unity]{1i}{\ohm}
+\end{LaTeXdemo}
+
\subsection{Angles}
Angle processing provided by the \cs{ang} function has a set of options which
Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty 2022-10-23 20:36:54 UTC (rev 64790)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty 2022-10-23 20:37:22 UTC (rev 64791)
@@ -42,7 +42,7 @@
}%
\endinput
}%
-\ProvidesExplPackage {siunitx} {2022-10-04} {3.1.8}
+\ProvidesExplPackage {siunitx} {2022-10-23} {3.1.9}
{A comprehensive (SI) units package}
\msg_new:nnnn { siunitx } { incompatible-package }
{ Package~'#1'~incompatible. }
@@ -404,7 +404,9 @@
input-complex-root .tl_set:N =
\l__siunitx_complex_input_root_tl ,
output-complex-root .tl_set:N =
- \l__siunitx_complex_output_root_tl
+ \l__siunitx_complex_output_root_tl ,
+ print-complex-unity .bool_set:N =
+ \l__siunitx_complex_print_unity_bool
}
\cs_new_protected:Npn \__siunitx_complex_parse:nNN #1#2#3
{
@@ -815,14 +817,7 @@
{ \tl_if_empty:NF \l__siunitx_complex_real_tl { + } }
{ \exp_not:n {#2} }
}
- \tl_if_blank:nTF {#4}
- {
- \str_if_eq:nnTF {#3} { 1 }
- { { } { } }
- { \exp_not:n { {#3} {#4} } }
- }
- { \exp_not:n { {#3} {#4} } }
- \exp_not:n { {#5} {#6} {#7} }
+ \exp_not:n { {#3} {#4} {#5} {#6} {#7} }
}
}
\cs_new_protected:Npn \__siunitx_complex_extract_exponent:w
@@ -830,9 +825,12 @@
\q_nil #9 \q_stop
{
\tl_set:Nn \l__siunitx_complex_sign_tl {#1#2}
- \bool_lazy_and:nnTF
- { \str_if_eq_p:nn {#3} { 1 } }
- { \tl_if_blank_p:n {#5} }
+ \bool_lazy_all:nTF
+ {
+ { ! \l__siunitx_complex_print_unity_bool }
+ { \str_if_eq_p:nn {#3} { 1 } }
+ { \tl_if_blank_p:n {#5} }
+ }
{ \__siunitx_complex_extract_exponent_aux:nw {#6#7#8} }
{ \__siunitx_complex_extract_exponent_aux:nw {#3#4#5#6#7#8} }
#9 \q_stop
@@ -1043,13 +1041,14 @@
}
\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-symbol-angle = \angle ,
+ complex-symbol-degree = \degree ,
+ input-complex-root = ij ,
+ output-complex-root = \mathrm { i } ,
+ print-complex-unity = false
}
\cs_generate_variant:Nn \keys_set:nn { nx }
\fp_new:N \l__siunitx_compound_tmp_fp
More information about the tex-live-commits
mailing list.