texlive[59410] Master/texmf-dist: siunitx (31may21)

commits+karl at tug.org commits+karl at tug.org
Mon May 31 22:24:44 CEST 2021


Revision: 59410
          http://tug.org/svn/texlive?view=revision&revision=59410
Author:   karl
Date:     2021-05-31 22:24:44 +0200 (Mon, 31 May 2021)
Log Message:
-----------
siunitx (31may21)

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.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
    trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2021-05-31 20:24:24 UTC (rev 59409)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2021-05-31 20:24:44 UTC (rev 59410)
@@ -7,6 +7,18 @@
 
 ## [Unreleased]
 
+## [v3.0.8]
+
+### Changed
+- Documentation improvements
+- Add `\barn`, `\knot`, `\mmHg`, `\nauticalmile` to list of
+  deprecated units
+- Provide a fallback route for deprecated units
+
+### Fixed
+- Correct printing of `10^{0}` (issue #459)
+- Emulation of `group-four-digits` (issue #461)
+
 ## [v3.0.7]
 
 ### Fixed
@@ -1322,7 +1334,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.7...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.8...HEAD
+[v3.0.8]: https://github.com/josephwright/siunitx/compare/v3.0.7...v3.0.8
 [v3.0.7]: https://github.com/josephwright/siunitx/compare/v3.0.6...v3.0.7
 [v3.0.6]: https://github.com/josephwright/siunitx/compare/v3.0.5...v3.0.6
 [v3.0.5]: https://github.com/josephwright/siunitx/compare/v3.0.4...v3.0.5

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.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-31 20:24:24 UTC (rev 59409)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx	2021-05-31 20:24:44 UTC (rev 59410)
@@ -446,6 +446,20 @@
           }
           { \@@_option_removed:V \l_keys_key_tl }
       } ,
+    group-four-digits .choice: ,
+    group-four-digits / false .code:n =
+      {
+        \@@_option_deprecated:nn
+          { group-four-digits~=~false }
+          { group-minimum-digits~=~5 }
+      } ,
+    group-four-digits / true .code:n =
+      {
+        \@@_option_deprecated:nn
+          { group-four-digits~=~false }
+          { group-minimum-digits~=~4 }
+      } ,
+    bracket-numbers .default:n = true ,
     omit-uncertainty .code:n =
       {
         \@@_option_deprecated:nnV
@@ -996,30 +1010,69 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% Units that have been removed.
+% Units that have been removed: to avoid issues, we mark them as deprecated.
 %    \begin{macrocode}
-\msg_new:nnnn { siunitx } { unit-removed }
-  { Unit~macro~#1~has~been~removed~in~this~release. }
+\msg_new:nnnn { siunitx } { unit-deprecated }
+  { Unit~macro~#1~has~been~deprecated~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.
+    You~should~define~it~yourself~using~\token_to_str:N \DeclareSIUnit
+    in~your~source.
   }
-\clist_map_inline:nn
+\cs_gset_protected:Npn \@@_tmp:w #1#2
   {
-    \angstrom         ,
-    \atomicmassunit   ,
-    \bar              ,
-    \bohr             ,
-    \clight           ,
-    \electronmass     ,
-    \elementarycharge ,
-    \hartree          ,
-    \planckbar
+    \quark_if_recursion_tail_stop:N #1
+    \bool_new:c { g_@@_unit_warning_ \token_to_str:N #1 _bool }
+    \siunitx_declare_unit:Nx #1
+      {
+        \exp_not:N \bool_if:NF
+          \exp_not:c { g_@@_unit_warning_ \token_to_str:N #1 _bool  }
+          {
+            \exp_not:N \bool_gset_true:N 
+              \exp_not:c { g_@@_unit_warning_ \token_to_str:N #1 _bool  }
+            \msg_warning:nnn { siunitx } { unit-deprecated }
+              { \token_to_str:N #1 }
+          }
+        #2
+      }
+    \@@_tmp:w
   }
+\@@_tmp:w
+  \atomicmassunit   { u }
+  \bar              { bar }
+  \barn             { b }
+  \bohr
+    { \text { \ensuremath { a } } \char_generate:nn { `\_ } { 8 } { 0 } }
+  \clight
+    { \text { \ensuremath { c } } \char_generate:nn { `\_ } { 8 } { 0 } }
+  \electronmass
+    {
+      \text { \ensuremath { m } }
+      \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { e } }
+    }
+  \elementarycharge { \text { \ensuremath { e } } }
+  \hartree
+    {
+      \text { \ensuremath { E } }
+      \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { h } }
+    }
+  \knot             { kn }
+  \mmHg             { mmHg }
+  \nauticalmile     { M }
+  \planckbar
+    { \text { \ensuremath { \exp_not:N \hbar } } }
+  \q_recursion_tail { }
+  \q_recursion_stop
+\@ifpackageloaded { fontspec }
   {
-    \siunitx_declare_unit:Nx #1
-      { \msg_error:nnn { siunitx } { unit-removed } { \token_to_str:N #1 } }
+    \@@_tmp:w \angstrom { \@@_non_latin:n { "00C5 } }
   }
+  {
+    \@@_tmp:w \angstrom
+      { \exp_not:N \text { \@@_non_latin:n { "00C5 } } }
+  }
+  \q_recursion_tail { }
+  \q_recursion_stop
 %    \end{macrocode}
 %
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2021-05-31 20:24:24 UTC (rev 59409)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2021-05-31 20:24:44 UTC (rev 59410)
@@ -3127,13 +3127,9 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_output_integer:nnn #1#2#3
   {
-    \bool_lazy_all:nF
-      {
-        { \str_if_eq_p:nn {#1} { 1 } }
-        { \tl_if_blank_p:n {#2} }
-        { ! \str_if_eq_p:nn {#3} { 0 } }
-        { ! \l_@@_unity_mantissa_bool }
-      }
+    \bool_lazy_or:nnT
+      { \l_@@_unity_mantissa_bool }
+      { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
       { \@@_output_digits:nn { integer } {#1} }
   }
 \cs_new:Npn \@@_output_decimal:nn #1#2
@@ -3389,10 +3385,9 @@
   }
 \cs_new:Npn \@@_output_exponent_auxi:nnnn #1#2#3#4
   {
-    \bool_lazy_and:nnTF
-      { \str_if_eq_p:nn {#3} { 1. } }
-      { ! \l_@@_unity_mantissa_bool }
-      { \exp_not:n {#4} }
+    \bool_lazy_or:nnTF
+      { \l_@@_unity_mantissa_bool }
+      { ! \str_if_eq_p:nn {#3} { 1. } }
       {
         \bool_if:NTF \l_@@_tight_bool
           { \exp_not:N \mathord }
@@ -3400,6 +3395,7 @@
             { \exp_not:V \l_@@_exponent_product_tl }
         \exp_not:n {#4}
       }
+      { \exp_not:n {#4} }
     \exp_not:V \l_@@_exponent_base_tl
     ^
       { \@@_output_exponent_auxiii:nn {#1} {#2} }

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2021-05-31 20:24:24 UTC (rev 59409)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2021-05-31 20:24:44 UTC (rev 59410)
@@ -121,7 +121,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2021-05-28} {3.0.7}
+\ProvidesExplPackage {siunitx} {2021-05-31} {3.0.8}
   {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-31 20:24:24 UTC (rev 59409)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex	2021-05-31 20:24:44 UTC (rev 59410)
@@ -1593,7 +1593,6 @@
 \end{table}
 
 \DescribeOption{group-digits}
-\DescribeOption{group-four-digits}
 \DescribeOption{group-separator}
 Grouping digits into blocks of three is a common method to increase the ease of
 reading of numbers. The \opt{group-digits} choice controls whether this
@@ -2849,7 +2848,8 @@
 \pkg{numprint} package has not been loaded, the letter |n| could be used as
 this would suggest a numerical column.
 
-\section{Upgrading from version~\texorpdfstring{$2$}{2}}
+\section{Upgrading from version~\texorpdfstring{$2$}{2}%
+  \label{sec:upgrading}}
 
 The package has been largely re-written internally between versions $2$ and
 $3$. A significant number of key--value settings have new, more descriptive,
@@ -2856,12 +2856,6 @@
 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{planckbar}).
-
 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
@@ -2936,6 +2930,54 @@
 If you are using \opt{table-column-width} to have fixed-width columns, you
 also now need \opt{table-fixed-width} to set this option active.
 
+Direct support for loading a local configuration file, \texttt{siunitx.cfg},
+has been removed. However, the approach described in
+Section~\ref{sec:hint:config} may be used to achieve the same effect with the
+additions more clearly shown in document sources.
+
+\section{Unit changes made by \acro{BIPM}%
+  \label{sec:BIPM8}}
+
+In addition to the changes in the \pkg{siunitx} package described in
+Section~\ref{sec:upgrading}, there are changes in the units defined by the
+\acro{BIPM} in the 9th Edition of the \acro{SI} Brochure which are reflected
+here. There are two major areas of change.
+
+The first is in respect of units accepted for use with \acro{SI} units. In the
+8th Edition of the \acro{SI} Brochure, the following units were listed as
+accepted for use in specialist fields
+\begin{itemize}
+  \item ångström (\cs{angstrom})
+  \item bar (\cs{bar})
+  \item barn (\cs{barn})
+  \item knot (\cs{knot})
+  \item millimetre of mercury (\cs{mmHg})
+  \item nautical mile (\cs{nauticalmile})
+\end{itemize}
+These are no longer listed in the 9th Edition, and so are deprecated as
+pre-defined units by \pkg{siunitx}. These units will issue a warning on first
+use, and users should add their own definitions to the start of their sources
+to avoid this.
+
+Secondly, the move to a new definition of base units means that the table of
+units determined experimentally has been removed from the \acro{SI} Brochure.
+This covers the following units defined by \pkg{siunitx} in previous releases
+\begin{itemize}
+  \item \cs{bohr}
+  \item \cs{clight}
+  \item \cs{electronmass}
+  \item \cs{elementarycharge}
+  \item 	\cs{hartree}
+  \item \cs{planckbar}
+\end{itemize}
+These are also deprecated in \pkg{siunitx} and users should provide their own
+definitions.
+
+In addition to these two major blocks, the unit \cs{atomicmassunit} has similar
+deprecated status: this was listed as with experimentally-determined units in
+the 8th Edition of the \acro{SI} Brochure but is equivalent to the dalton, a
+unit which remains accepted.
+
 \section{Localisation}
 
 The \pkg{translations} package provides a structured framework for localisation
@@ -3346,7 +3388,7 @@
   \qty{0,4066\dots}{\metre\squared}
 \end{LaTeXdemo}
 
-\subsection{Demonstrating prefixes
+\subsection{Demonstrating prefixes%
   \label{sec:hint:prefixes}}
 
 As \pkg{siunitx} contains data about the numerical values of unit prefixes,
@@ -3372,6 +3414,28 @@
   }
 \end{LaTeXdemo}
 
+\subsection{Creating a set of pre-defined units%
+  \label{sec:hint:config}}
+
+There are many units which sit outside of those defined in the (current)
+\acro{SI} Brochure which are of use to many people. Most obvious are those
+which have been detailed in previous editions of the Brochure, as described
+in Section~\ref{sec:BIPM8}, but there are many others.
+
+It is often convenient to have a pre-defined set of useful units available
+without needing to copy the full set of definitions into each source file. At
+the same time, it is important that such sources do show that they are using
+units not defined by the core part of \pkg{siunitx}. The most straight-forward
+way to acheive this is to create a separate file, for example
+\texttt{siunitx-local-units.tex}, and place it in your local \TeX{} tree
+(usually \verb|~/texmf/tex/latex/| on Linux, \verb|~/Library/texmf/tex/latex/|
+on macOS or \verb|C:\Users\<name>\texmf\tex\latex| on Windows). This can then
+be loaded in the preamble using
+\begin{LaTeXdemo}[code only]
+  % Load useful 'local' units
+  \input{siunitx-local-units}
+\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-31 20:24:24 UTC (rev 59409)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2021-05-31 20:24:44 UTC (rev 59410)
@@ -42,7 +42,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2021-05-28} {3.0.7}
+\ProvidesExplPackage {siunitx} {2021-05-31} {3.0.8}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -3112,13 +3112,9 @@
   }
 \cs_new:Npn \__siunitx_number_output_integer:nnn #1#2#3
   {
-    \bool_lazy_all:nF
-      {
-        { \str_if_eq_p:nn {#1} { 1 } }
-        { \tl_if_blank_p:n {#2} }
-        { ! \str_if_eq_p:nn {#3} { 0 } }
-        { ! \l__siunitx_number_unity_mantissa_bool }
-      }
+    \bool_lazy_or:nnT
+      { \l__siunitx_number_unity_mantissa_bool }
+      { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
       { \__siunitx_number_output_digits:nn { integer } {#1} }
   }
 \cs_new:Npn \__siunitx_number_output_decimal:nn #1#2
@@ -3334,10 +3330,9 @@
   }
 \cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnn #1#2#3#4
   {
-    \bool_lazy_and:nnTF
-      { \str_if_eq_p:nn {#3} { 1. } }
-      { ! \l__siunitx_number_unity_mantissa_bool }
-      { \exp_not:n {#4} }
+    \bool_lazy_or:nnTF
+      { \l__siunitx_number_unity_mantissa_bool }
+      { ! \str_if_eq_p:nn {#3} { 1. } }
       {
         \bool_if:NTF \l__siunitx_number_tight_bool
           { \exp_not:N \mathord }
@@ -3345,6 +3340,7 @@
             { \exp_not:V \l__siunitx_number_exponent_product_tl }
         \exp_not:n {#4}
       }
+      { \exp_not:n {#4} }
     \exp_not:V \l__siunitx_number_exponent_base_tl
     ^
       { \__siunitx_number_output_exponent_auxiii:nn {#1} {#2} }
@@ -6663,6 +6659,20 @@
           }
           { \__siunitx_option_removed:V \l_keys_key_tl }
       } ,
+    group-four-digits .choice: ,
+    group-four-digits / false .code:n =
+      {
+        \__siunitx_option_deprecated:nn
+          { group-four-digits~=~false }
+          { group-minimum-digits~=~5 }
+      } ,
+    group-four-digits / true .code:n =
+      {
+        \__siunitx_option_deprecated:nn
+          { group-four-digits~=~false }
+          { group-minimum-digits~=~4 }
+      } ,
+    bracket-numbers .default:n = true ,
     omit-uncertainty .code:n =
       {
         \__siunitx_option_deprecated:nnV
@@ -7107,28 +7117,67 @@
        }
   }
 \siunitx_declare_unit:Nn \celsius { \degreeCelsius }
-\msg_new:nnnn { siunitx } { unit-removed }
-  { Unit~macro~#1~has~been~removed~in~this~release. }
+\msg_new:nnnn { siunitx } { unit-deprecated }
+  { Unit~macro~#1~has~been~deprecated~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.
+    You~should~define~it~yourself~using~\token_to_str:N \DeclareSIUnit
+    in~your~source.
   }
-\clist_map_inline:nn
+\cs_gset_protected:Npn \__siunitx_emulation_tmp:w #1#2
   {
-    \angstrom         ,
-    \atomicmassunit   ,
-    \bar              ,
-    \bohr             ,
-    \clight           ,
-    \electronmass     ,
-    \elementarycharge ,
-    \hartree          ,
-    \planckbar
+    \quark_if_recursion_tail_stop:N #1
+    \bool_new:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool }
+    \siunitx_declare_unit:Nx #1
+      {
+        \exp_not:N \bool_if:NF
+          \exp_not:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool  }
+          {
+            \exp_not:N \bool_gset_true:N
+              \exp_not:c { g__siunitx_emulation_unit_warning_ \token_to_str:N #1 _bool  }
+            \msg_warning:nnn { siunitx } { unit-deprecated }
+              { \token_to_str:N #1 }
+          }
+        #2
+      }
+    \__siunitx_emulation_tmp:w
   }
+\__siunitx_emulation_tmp:w
+  \atomicmassunit   { u }
+  \bar              { bar }
+  \barn             { b }
+  \bohr
+    { \text { \ensuremath { a } } \char_generate:nn { `\_ } { 8 } { 0 } }
+  \clight
+    { \text { \ensuremath { c } } \char_generate:nn { `\_ } { 8 } { 0 } }
+  \electronmass
+    {
+      \text { \ensuremath { m } }
+      \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { e } }
+    }
+  \elementarycharge { \text { \ensuremath { e } } }
+  \hartree
+    {
+      \text { \ensuremath { E } }
+      \char_generate:nn { `\_ } { 8 } { \exp_not:N \mathrm { h } }
+    }
+  \knot             { kn }
+  \mmHg             { mmHg }
+  \nauticalmile     { M }
+  \planckbar
+    { \text { \ensuremath { \exp_not:N \hbar } } }
+  \q_recursion_tail { }
+  \q_recursion_stop
+\@ifpackageloaded { fontspec }
   {
-    \siunitx_declare_unit:Nx #1
-      { \msg_error:nnn { siunitx } { unit-removed } { \token_to_str:N #1 } }
+    \__siunitx_emulation_tmp:w \angstrom { \__siunitx_emulation_non_latin:n { "00C5 } }
   }
+  {
+    \__siunitx_emulation_tmp:w \angstrom
+      { \exp_not:N \text { \__siunitx_emulation_non_latin:n { "00C5 } } }
+  }
+  \q_recursion_tail { }
+  \q_recursion_stop
 \IfFormatAtLeastTF { 2020-10-01 }
   { }
   { \RequirePackage { xparse } }



More information about the tex-live-commits mailing list.