summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-21 03:01:23 +0000
committerNorbert Preining <norbert@preining.info>2021-05-21 03:01:23 +0000
commit6a52d8839d334ac56f36195aa404fac667862830 (patch)
tree826593c6af503aaaf2691f8e96912485428ef595 /macros/latex/contrib/siunitx
parent6d6c3b4ee419b9f485a213d2ece28b06e9ca2f7c (diff)
CTAN sync 202105210301
Diffstat (limited to 'macros/latex/contrib/siunitx')
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md15
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin1437526 -> 1441368 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-emulation.dtx31
-rw-r--r--macros/latex/contrib/siunitx/siunitx-emulation.pdfbin484705 -> 0 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx-table.dtx23
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin600972 -> 605429 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex83
9 files changed, 136 insertions, 20 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index dc30ec5d79..3215c8926b 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -1,4 +1,4 @@
-# Changelog
+Standard# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a
@@ -7,6 +7,16 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.0.3]
+
+### Changed
+- Documentation improvements
+
+### Fixed
+- Emulation of `input-symbols` (fixes #431)
+- Standard setting for `group-minimum-digits` (issue #436)
+- Application of negative color in table cells (issue #439)
+
## [v3.0.2]
### Changed
@@ -1270,7 +1280,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.2...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.3...HEAD
+[v3.0.3]: https://github.com/josephwright/siunitx/compare/v3.0.2...v3.0.3
[v3.0.2]: https://github.com/josephwright/siunitx/compare/v3.0.1...v3.0.2
[v3.0.1]: https://github.com/josephwright/siunitx/compare/v3.0.0...v3.0.1
[v3.0.0]: https://github.com/josephwright/siunitx/compare/v2.8e...v3.0.0
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index ca24d4d13e..16510233a4 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-emulation.dtx b/macros/latex/contrib/siunitx/siunitx-emulation.dtx
index 5287f2c8cf..4ae6cd1590 100644
--- a/macros/latex/contrib/siunitx/siunitx-emulation.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-emulation.dtx
@@ -358,6 +358,12 @@
{ group-digits ~ = ~ true }
{ group-digits ~ = ~ all }
} ,
+ input-symbols .code:n =
+ {
+ \msg_info:nnnn { siunitx } { option-deprecated }
+ { input-symbols } { input-digits }
+ \tl_put_right:Nn \l_@@_number_input_digit_tl {#1}
+ } ,
separate-uncertainty .choice: ,
separate-uncertainty / false .code:n =
{
@@ -984,6 +990,31 @@
% \end{macrocode}
% \end{macro}
%
+% Units that have been removed.
+% \begin{macrocode}
+\msg_new:nnnn { siunitx } { unit-removed }
+ { Unit~macro~#1~has~been~removed~in~this~release. }
+ {
+ The~BIPM~have~removed~this~unit~from~the~SI~Brochure.~
+ You~will~need~to~define~it~yourself~using~\token_to_str:N \DeclareSIUnit.
+ }
+\clist_map_inline:nn
+ {
+ \angstrom ,
+ \atomicmassunit ,
+ \bohr ,
+ \clight ,
+ \electronmass ,
+ \elementarycharge ,
+ \hartree ,
+ \plackbar
+ }
+ {
+ \siunitx_declare_unit:Nx #1
+ { \msg_error:nnn { siunitx } { unit-removed } { \token_to_str:N #1 } }
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
%</interfaces>
% \end{macrocode}
diff --git a/macros/latex/contrib/siunitx/siunitx-emulation.pdf b/macros/latex/contrib/siunitx/siunitx-emulation.pdf
deleted file mode 100644
index b439f74a67..0000000000
--- a/macros/latex/contrib/siunitx/siunitx-emulation.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index 45f8ad2562..3bedf3794c 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -3515,7 +3515,7 @@
expression = #1 ,
fixed-exponent = 0 ,
group-digits = all ,
- group-minimum-digits = 4 ,
+ group-minimum-digits = 5 ,
group-separator = \, , % (
input-close-uncertainty = ) ,
input-comparators = { <=>\approx\ge\geq\gg\le\leq\ll\sim } ,
diff --git a/macros/latex/contrib/siunitx/siunitx-table.dtx b/macros/latex/contrib/siunitx/siunitx-table.dtx
index 430a715710..f4ca1ec529 100644
--- a/macros/latex/contrib/siunitx/siunitx-table.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-table.dtx
@@ -687,6 +687,26 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_color_check:N}
+% \begin{macro}{\@@_color_check:w}
+% \begin{macro}{\@@_color_check:Nnw}
+% Handle the fact that splitting a number can leave a negative color
+% dangling.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_color_check:N #1
+ { \exp_after:wN \@@_color_check:w #1 \q_stop }
+\cs_new_protected:Npn \@@_color_check:w #1 \q_nil #2 \q_nil #3 \q_stop
+ {
+ \tl_if_head_eq_meaning:nNT {#2} \color
+ { \@@_color_check:Nnw #2 \q_stop }
+ }
+\cs_new_protected:Npn \@@_color_check:Nnw #1#2#3 \q_stop
+ { \keys_set:nn { siunitx } { number-color = #2 } }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\@@_center_marker:}
% When centering on the decimal marker, the easiest approach is to simply
% re-box the two parts. That is needed whether or not we are parsing numbers,
@@ -938,6 +958,7 @@
{
\tl_set:Nx \l_@@_tmp_tl
{ \siunitx_number_output:NN \l_@@_model_tl \q_nil }
+ \@@_color_check:N \l_@@_tmp_tl
\exp_after:wN \@@_direct_format_aux:w
\l_@@_tmp_tl \q_stop
}
@@ -1102,6 +1123,7 @@
\siunitx_number_process:NN \l_@@_tmp_tl \l_@@_tmp_tl
\tl_set:Nx \l_@@_tmp_tl
{ \siunitx_number_output:NN \l_@@_tmp_tl \q_nil }
+ \@@_color_check:N \l_@@_tmp_tl
\exp_after:wN \@@_print_marker:w
\l_@@_tmp_tl \q_stop
\box_use_drop:N \l_@@_after_box
@@ -1174,6 +1196,7 @@
\exp_not:N \q_mark
\siunitx_number_output:NN \l_@@_tmp_tl \q_nil
}
+ \@@_color_check:N \l_@@_tmp_tl
\exp_after:wN \@@_print_format_auxi:w
\l_@@_tmp_tl \q_stop
\hbox_set:Nn \l_@@_tmp_box { \l_@@_after_model_tl }
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 9e4705dd4d..b8b6b79b02 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2021-05-19} {3.0.2}
+\ProvidesExplPackage {siunitx} {2021-05-20} {3.0.3}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 9a362bf17c..2c3c742c94 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 e7035ee5c8..191e619490 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -706,6 +706,7 @@ standard \pkg{siunitx} settings only create these abbreviations within the
scope of the \cs{unit} and \cs{qty} functions, meaning that no clashes should
occur (for example with the standard \cs{pm} symbol).
\begin{center}
+ \tablecaption{Unit abbreviations}
\label{tab:unit:abbr}
\tablefirsthead{%
\toprule
@@ -2397,25 +2398,26 @@ to the layout of tabular material (Table~\ref{tab:opt:tables}).
\end{tabular}
\end{table}
-\DescribeOption{table-mode}
+\DescribeOption{table-alignment-mode}
The method used by \pkg{siunitx} to align numbers is selected using the
-\opt{table-mode} option, which may be one of \opt{marker}, \opt{format} or
-\meta{none}. With the standard setting, \meta{marker}, the package centers the
-decimal marker in a tabular column, potentially leaving white space at the
-shorter end of a number. The \meta{format} mode uses information from the
-\meta{table-format} key to construct a model: this is then used to define the
-space available to a number. For asymmetrical numbers, this method is strongly
-preferable. Finally, \opt{none} disables alignment entirely: numbers are simply
-parsed.
+\opt{table-alignment-mode} option, which may be one of \opt{marker},
+\opt{format} or \meta{none}. With the standard setting, \meta{marker}, the
+package centers the decimal marker in a tabular column, potentially leaving
+white space at the shorter end of a number. The \meta{format} mode uses
+information from the \meta{table-format} key to construct a model: this is then
+used to define the space available to a number. For asymmetrical numbers, this
+method is strongly preferable. Finally, \opt{none} disables alignment entirely:
+numbers are simply parsed.
\DescribeOption{table-number-alignment}
-When \opt{table-mode} is set to \meta{format} or \meta{none}, the placement of
-the number \enquote{block} within the cell as a whole is set by the
-\meta{table-number-alignment} option, which may be one of \meta{left},
-\meta{center} or \meta{right}. (When \opt{table-mode} is set to \meta{marker},
-the decimal marker is always centered in the cell.) The different alignment
-choices are illustrated in Table~\ref{tab:S:align}, which uses somewhat
-exaggerated column headings to show the relative position of the cell contents.
+When \opt{table-alignment-mode} is set to \meta{format} or \meta{none}, the
+placement of the number \enquote{block} within the cell as a whole is set by
+the \meta{table-number-alignment} option, which may be one of \meta{left},
+\meta{center} or \meta{right}. (When \opt{table-alignment-mode} is set to
+\meta{marker}, the decimal marker is always centered in the cell.) The
+different alignment choices are illustrated in Table~\ref{tab:S:align}, which
+uses somewhat exaggerated column headings to show the relative position of the
+cell contents.
\begin{LaTeXdemo}[code and float]
\begin{table}
\caption{Aligning the \texttt{S} column.%
@@ -2846,6 +2848,12 @@ $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.
+Updating to the latest edition of the \acro{SI} Brochure means that a small
+number of unit macros have been removed: of those accepted for use,
+\cs{angstrom} is no longer present, whilst the units determined experimentally
+are all no longer listed (\cs{atomicmassunit}, \cs{bohr}, \cs{clight},
+\cs{electronmass}, \cs{elementarycharge}, \cs{hartree}, \cs{plackbar}).
+
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
@@ -2875,6 +2883,8 @@ notably
\item prefixes can only be interconverted with numbers as part
of a quantity, not as stand-alone units.
\end{itemize}
+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
@@ -3304,6 +3314,47 @@ appropriate code would be
\addto\extrasgerman{\sisetup{locale = DE}}
\end{LaTeXdemo}
+\subsection{Symbolic \enquote{digits}%
+ \label{sec:hint:symbols}}
+
+In some cases you may want to use \enquote{digits} which do not fall within the
+usual set |0123456789|. This can be done by setting the \opt{input-digits}
+option, but bearing in mind that this will affect (prevent) for example
+rounding.
+\begin{LaTeXdemo}
+ \sisetup{input-digits = 0123456789\pi}%
+ \num{4\pi e-7}
+\end{LaTeXdemo}
+Each extra entry should be a single token, and should either have a definition
+which is safe in both math and text mode, or should only be used when the
+output mode is known.
+
+\subsection{Demonstrating prefixes
+ \label{sec:hint:prefixes}}
+
+As \pkg{siunitx} contains data about the numerical values of unit prefixes,
+you may wish to print this in an automated way. Prefixes cannot be given
+on their own, but it is possible to create a \enquote{do nothing} unit.
+\begin{LaTeXdemo}[code only]
+ \DeclareSIUnit\noop{\relax}
+\end{LaTeXdemo}
+which can then be used to show just the prefix symbol.
+\begin{LaTeXdemo}
+ \unit{\yotta\noop}
+\end{LaTeXdemo}
+To show just the numerical value of a prefix, you will need to use \cs{qty}
+and appropriate settings.
+\begin{LaTeXdemo}
+ \qty[prefix-mode = extract-exponent, print-unity-mantissa = false]%
+ {1}{\yotta\noop}
+\end{LaTeXdemo}
+This may be conveniently wrapped up inside a document command, for example
+\begin{LaTeXdemo}[code only]
+ \NewDocumentCommand\prefixvalue{m}{%
+ \qty[prefix-mode=extract-exponent,print-unity-mantissa=false]{1}{#1\noop}
+ }
+\end{LaTeXdemo}
+
\section{Using (\acro{SI}) units}
Consistent and logical units are a necessity for scientific work, and have