summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/siunitx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-21 21:04:16 +0000
committerKarl Berry <karl@freefriends.org>2021-05-21 21:04:16 +0000
commitb1faafa7a3280da5554864dc3b75351f780b7c74 (patch)
tree0f962862960d0afe503d2d5f2d069f052a7ffaf3 /Master/texmf-dist/source/latex/siunitx
parent239a4ff802c59efea422120c00ffc23a00840396 (diff)
siunitx (21may21)
git-svn-id: svn://tug.org/texlive/trunk@59292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx')
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx31
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx2
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx23
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx2
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.tex83
5 files changed, 123 insertions, 18 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx
index 5287f2c8cf8..4ae6cd15905 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx
+++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
index 45f8ad25627..3bedf3794ce 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
+++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
index 430a7157104..f4ca1ec5296 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
+++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index 9e4705dd4d8..b8b6b79b026 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/source/latex/siunitx/siunitx.tex b/Master/texmf-dist/source/latex/siunitx/siunitx.tex
index e7035ee5c8c..191e6194909 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.tex
+++ b/Master/texmf-dist/source/latex/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