summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx/siunitx-emulation.dtx
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/siunitx-emulation.dtx
parent098258765e1921f3e57f38e424272587103189dd (diff)
CTAN sync 202106010300
Diffstat (limited to 'macros/latex/contrib/siunitx/siunitx-emulation.dtx')
-rw-r--r--macros/latex/contrib/siunitx/siunitx-emulation.dtx85
1 files changed, 69 insertions, 16 deletions
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}