summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-24 03:03:39 +0000
committerNorbert Preining <norbert@preining.info>2022-10-24 03:03:39 +0000
commit74697976d2ffe935077542593ccbb18a00603251 (patch)
treeca88ce389275df22be5c2c843de613d8003bf684 /macros/latex/contrib/siunitx
parent588d4f81788b3a24bd9bd480ec40bb55be4d1da1 (diff)
CTAN sync 202210240303
Diffstat (limited to 'macros/latex/contrib/siunitx')
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md12
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin617674 -> 617655 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-complex.dtx48
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin665420 -> 666267 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex10
6 files changed, 49 insertions, 23 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index 7cdde2cf78..d1d7b1c61f 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,15 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [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 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.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
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index cf6bc8c78c..7bfe53e8a8 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-complex.dtx b/macros/latex/contrib/siunitx/siunitx-complex.dtx
index 9cd595d28f..8303c9f302 100644
--- a/macros/latex/contrib/siunitx/siunitx-complex.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-complex.dtx
@@ -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}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 3e61bbb85c..b39fdd662e 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-10-04} {3.1.8}
+\ProvidesExplPackage {siunitx} {2022-10-23} {3.1.9}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 15032f9957..92efe61c67 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex
index 05c3e70ffa..1c4b9ab910 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -2055,6 +2055,7 @@ numbers; these are summarised in Table~\ref{tab:opt:num:complex}.
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 @@ are controlled by the options \opt{complex-symbol-angle} and
\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