diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-21 21:04:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-21 21:04:16 +0000 |
commit | b1faafa7a3280da5554864dc3b75351f780b7c74 (patch) | |
tree | 0f962862960d0afe503d2d5f2d069f052a7ffaf3 /Master | |
parent | 239a4ff802c59efea422120c00ffc23a00840396 (diff) |
siunitx (21may21)
git-svn-id: svn://tug.org/texlive/trunk@59292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf | bin | 1437526 -> 1441368 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx-emulation.pdf | bin | 484705 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | bin | 600972 -> 605429 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx | 31 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx | 23 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.tex | 83 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 43 |
10 files changed, 177 insertions, 22 deletions
diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index dc30ec5d795..3215c8926b3 100644 --- a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf Binary files differindex ca24d4d13e5..16510233a49 100644 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf +++ b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx-emulation.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-emulation.pdf Binary files differdeleted file mode 100644 index b439f74a671..00000000000 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx-emulation.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf Binary files differindex 9a362bf17c9..2c3c742c949 100644 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf +++ b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf 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 diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index f4640b447d5..0503d1dc192 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -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 } } |