summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-06-01 03:00:58 +0000
committerNorbert Preining <norbert@preining.info>2021-06-01 03:00:58 +0000
commit0f69e2fd4a9928663f0cc64b8cac1f0d8baee9d6 (patch)
treec9ab8a25ba9f5a5dcfb4bef6a51aa35fe07834cb /macros/latex/contrib/siunitx
parent098258765e1921f3e57f38e424272587103189dd (diff)
CTAN sync 202106010300
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.pdfbin1442135 -> 1447215 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-emulation.dtx85
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx18
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin598863 -> 603229 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex82
7 files changed, 164 insertions, 38 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index f91a3e17e4..2e71ec3eca 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,18 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [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 @@ 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.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
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index 09c3c9538d..6ba4bd131f 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 dc2e9f9035..0878c37d74 100644
--- a/macros/latex/contrib/siunitx/siunitx-emulation.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-emulation.dtx
@@ -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}
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index cfbff37d9c..070b9c5e9d 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -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} }
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index e553abc6b0..33b6776591 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-28} {3.0.7}
+\ProvidesExplPackage {siunitx} {2021-05-31} {3.0.8}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 5e0b6c269d..4388753d2f 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 3cb5f25ed5..76afc34861 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -1593,7 +1593,6 @@ conveys. The options are summarised in Table~\ref{tab:opt:num:out}.
\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,19 +2848,14 @@ letters may be used: these must be single tokens. For example, provided the
\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,
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 @@ or
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 @@ output mode is known. It may be necessary to make some tokens robust using
\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 @@ This may be conveniently wrapped up inside a document command, for example
}
\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