texlive[59292] Master/texmf-dist: siunitx (21may21)
commits+karl at tug.org
commits+karl at tug.org
Fri May 21 23:04:16 CEST 2021
Revision: 59292
http://tug.org/svn/texlive?view=revision&revision=59292
Author: karl
Date: 2021-05-21 23:04:16 +0200 (Fri, 21 May 2021)
Log Message:
-----------
siunitx (21may21)
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-emulation.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.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
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-emulation.pdf
Modified: trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md 2021-05-21 03:14:40 UTC (rev 59291)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md 2021-05-21 21:04:16 UTC (rev 59292)
@@ -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 @@
## [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 @@
### 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
Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
===================================================================
(Binary files differ)
Deleted: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-emulation.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-emulation.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx 2021-05-21 03:14:40 UTC (rev 59291)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx 2021-05-21 21:04:16 UTC (rev 59292)
@@ -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,7 +990,32 @@
% \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}
%
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx 2021-05-21 03:14:40 UTC (rev 59291)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx 2021-05-21 21:04:16 UTC (rev 59292)
@@ -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 } ,
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx 2021-05-21 03:14:40 UTC (rev 59291)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx 2021-05-21 21:04:16 UTC (rev 59292)
@@ -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 }
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx 2021-05-21 03:14:40 UTC (rev 59291)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx 2021-05-21 21:04:16 UTC (rev 59292)
@@ -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}
%
Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex 2021-05-21 03:14:40 UTC (rev 59291)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex 2021-05-21 21:04:16 UTC (rev 59292)
@@ -706,6 +706,7 @@
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 @@
\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 @@
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 @@
\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 @@
\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
Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty 2021-05-21 03:14:40 UTC (rev 59291)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty 2021-05-21 21:04:16 UTC (rev 59292)
@@ -42,7 +42,7 @@
}%
\endinput
}%
-\ProvidesExplPackage {siunitx} {2021-05-19} {3.0.2}
+\ProvidesExplPackage {siunitx} {2021-05-20} {3.0.3}
{A comprehensive (SI) units package}
\msg_new:nnnn { siunitx } { incompatible-package }
{ Package~'#1'~incompatible. }
@@ -3360,7 +3360,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 } ,
@@ -4063,6 +4063,15 @@
\cs_new:Npn \__siunitx_table_cleanup_decimal:w
#1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_nil #7 \q_nil
{ #1#2#3#4#5#6#7 }
+\cs_new_protected:Npn \__siunitx_table_color_check:N #1
+ { \exp_after:wN \__siunitx_table_color_check:w #1 \q_stop }
+\cs_new_protected:Npn \__siunitx_table_color_check:w #1 \q_nil #2 \q_nil #3 \q_stop
+ {
+ \tl_if_head_eq_meaning:nNT {#2} \color
+ { \__siunitx_table_color_check:Nnw #2 \q_stop }
+ }
+\cs_new_protected:Npn \__siunitx_table_color_check:Nnw #1#2#3 \q_stop
+ { \keys_set:nn { siunitx } { number-color = #2 } }
\cs_new_protected:Npn \__siunitx_table_center_marker:
{
\hbox_set:Nn \l__siunitx_table_tmp_box
@@ -4236,6 +4245,7 @@
{
\tl_set:Nx \l__siunitx_table_tmp_tl
{ \siunitx_number_output:NN \l__siunitx_table_model_tl \q_nil }
+ \__siunitx_table_color_check:N \l__siunitx_table_tmp_tl
\exp_after:wN \__siunitx_table_direct_format_aux:w
\l__siunitx_table_tmp_tl \q_stop
}
@@ -4332,6 +4342,7 @@
\siunitx_number_process:NN \l__siunitx_table_tmp_tl \l__siunitx_table_tmp_tl
\tl_set:Nx \l__siunitx_table_tmp_tl
{ \siunitx_number_output:NN \l__siunitx_table_tmp_tl \q_nil }
+ \__siunitx_table_color_check:N \l__siunitx_table_tmp_tl
\exp_after:wN \__siunitx_table_print_marker:w
\l__siunitx_table_tmp_tl \q_stop
\box_use_drop:N \l__siunitx_table_after_box
@@ -4397,6 +4408,7 @@
\exp_not:N \q_mark
\siunitx_number_output:NN \l__siunitx_table_tmp_tl \q_nil
}
+ \__siunitx_table_color_check:N \l__siunitx_table_tmp_tl
\exp_after:wN \__siunitx_table_print_format_auxi:w
\l__siunitx_table_tmp_tl \q_stop
\hbox_set:Nn \l__siunitx_table_tmp_box { \l__siunitx_table_after_model_tl }
@@ -6541,6 +6553,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__siunitx_number_input_digit_tl {#1}
+ } ,
separate-uncertainty .choice: ,
separate-uncertainty / false .code:n =
{
@@ -7053,6 +7071,27 @@
}
}
\siunitx_declare_unit:Nn \celsius { \degreeCelsius }
+\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 } }
+ }
\IfFormatAtLeastTF { 2020-10-01 }
{ }
{ \RequirePackage { xparse } }
More information about the tex-live-commits
mailing list.