summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/mathalpha/README4
-rw-r--r--macros/latex/contrib/mathalpha/tex/mathalpha.sty32
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md13
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin1516492 -> 1517332 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-print.dtx30
-rw-r--r--macros/latex/contrib/siunitx/siunitx-table.dtx42
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin638362 -> 638365 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex2
9 files changed, 89 insertions, 36 deletions
diff --git a/macros/latex/contrib/mathalpha/README b/macros/latex/contrib/mathalpha/README
index 5eaefbe63f..c20ee09b24 100644
--- a/macros/latex/contrib/mathalpha/README
+++ b/macros/latex/contrib/mathalpha/README
@@ -11,7 +11,9 @@ It mostly bypasses the usual fd and sty files used to load these
alphabets in order to allow each to be scaled independently and
without silently quantizing the sizes.
-Current version: 1.142 2021-11-01
+Current version: 1.143 2021-11-18
+
+Version 1.143 fixes a problem where mathalpha would erase a prior choice of Blackboard Bold font, due to a code duplication that made a test false on the first round but true on the second.
Version 1.142 corrects for missing \fi in a number of \mathfrak definitions due, I think, to an erroneous mass copy and paste in 1.14.
diff --git a/macros/latex/contrib/mathalpha/tex/mathalpha.sty b/macros/latex/contrib/mathalpha/tex/mathalpha.sty
index 16d2a5e83d..c32088ce65 100644
--- a/macros/latex/contrib/mathalpha/tex/mathalpha.sty
+++ b/macros/latex/contrib/mathalpha/tex/mathalpha.sty
@@ -1,6 +1,6 @@
\NeedsTeXFormat{LaTeX2e}
-\def\mathalphaVersion{1.142}
-\def\mathalphaDate{2021/11/01}
+\def\mathalphaVersion{1.143}
+\def\mathalphaDate{2021/11/18}
\ProvidesPackage{mathalpha}[\mathalphaDate\space-\space\mathalphaVersion
mathalpha (License LPPL) Michael Sharpe]
\message{`mathalpha' v\mathalphaVersion, \mathalphaDate, a renaming of mathalfa (msharpe)}
@@ -24,6 +24,9 @@
\def\bb@lst{ams, lucida, mathpi, mma, mt, mth, pazo, fourier, esstix, boondox, px, tx, txof, libus, dsserif, bboldxLight, bboldx, dsfontserif, dsfontsans, stixtwo, stix}
\def\cal@lst{cm, euler, rsfso, rsfs, lucida, mathpi, mma, mt, mtc, zapfc, esstix, boondox, boondoxo, dutchcal, pxtx, bickham, bickhams, stix, txupr, boondoxupr, kp, stixplain, stixfancy, stixtwoplain, stixtwofancy}
\def\frak@lst{euler, lucida, mathpi, mma, mt, esstix, boondox, pxtx, stixtwo}
+\def\mathalfa@bbnr{-1}\def\mathalfa@calnr{-1}
+\def\mathalfa@fraknr{-1}\def\mathalfa@scrnr{-1}
+\def\minusone{-1}
% aliases
\newif\ifmathalfa@oldbold
\define@boolkey{mathalfa}{oldbold}[true]{\@nameuse{mathalfa@oldbold#1}}
@@ -32,8 +35,8 @@
\define@boolkey{mathalfa}{calsymbols}[true]{\@nameuse{mathalfa@calsym#1}}
\define@boolkey{mathalfa}{scrsymbols}[true]{\@nameuse{mathalfa@scrsym#1}}
-\edef\mathalfa@bbnr{\m@ne}\edef\mathalfa@calnr{\m@ne}
-\edef\mathalfa@fraknr{\m@ne}\edef\mathalfa@scrnr{\m@ne}
+%\edef\mathalfa@bbnr{\m@ne}\edef\mathalfa@calnr{\m@ne}
+%\edef\mathalfa@fraknr{\m@ne}\edef\mathalfa@scrnr{\m@ne}
% scaled
\define@key{mathalfa}{scaled}[1.0]{%
\def\mathalfa@bbscaled{s*[#1]}\def\mathalfa@bbrawscaled{#1} \def\mathalfa@calscaled{s*[#1]}\def\mathalfa@calrawscaled{#1} \def\mathalfa@frakscaled{s*[#1]}\def\mathalfa@frakrawscaled{#1} \def\mathalfa@scrscaled{s*[#1]}\def\mathalfa@scrrawscaled{#1}}% all at once
@@ -74,11 +77,17 @@ frak: lucida, esstix, mathpi^^J
\x}
\ProcessOptions* % run \DeclareOption* on each option specified, in order
% Convert scaled choices to macros
-\expandafter\ifx\csname mathalfa@bbscaled\endcsname\relax \let\mathalfa@bbscaled\@empty
-\fi
-\expandafter\ifx\csname mathalfa@calscaled\endcsname\relax \let\mathalfa@calscaled\@empty\fi
-\expandafter\ifx\csname mathalfa@frakscaled\endcsname\relax \let\mathalfa@frakscaled\@empty\fi
-\expandafter\ifx\csname mathalfa@scrscaled\endcsname\relax \let\mathalfa@scrscaled\@empty\fi
+%\expandafter\ifx\csname mathalfa@bbscaled\endcsname\relax \let\mathalfa@bbscaled\@empty
+%\fi
+%\expandafter\ifx\csname mathalfa@calscaled\endcsname\relax \let\mathalfa@calscaled\@empty\fi
+%\expandafter\ifx\csname mathalfa@frakscaled\endcsname\relax \let\mathalfa@frakscaled\@empty\fi
+%\expandafter\ifx\csname mathalfa@scrscaled\endcsname\relax \let\mathalfa@scrscaled\@empty\fi
+\ifx\mathalfa@bbnr\minusone\else\let\mathbb\relax\let\mathbbb\relax\fi
+%\ifnum \mathalfa@bbnr<0
+%\else\let\mathbb\relax\let\mathbbb\relax\fi
+%\ifx\mathalfa@calnr\minusone\else\let\mathcal\relax\fi
+\ifx\mathalfa@fraknr\minusone\else\let\mathfrak\relax\let\mathbfrak\relax\fi
+\ifx\mathalfa@scrnr\minusone\else\let\mathscr\relax\fi
% Check for lucida loaded
\newif\iflucid@loaded \lucid@loadedfalse
\expandafter\ifx\csname DeclareLucidaFontShape\endcsname\relax\else\lucid@loadedtrue\fi%
@@ -90,11 +99,6 @@ frak: lucida, esstix, mathpi^^J
\@ifpackageloaded{amsfonts}{%
\let\amsloaded=Y%
}{}%
-% Undefine some previous settings
-\ifx\mathalfa@bbnr\m@ne\else\let\mathbb\relax\let\mathbfbb\relax\fi
-%\ifx\mathalfa@calnr\m@ne\else\let\mathcal\relax\fi
-\ifx\mathalfa@fraknr\m@ne\else\let\mathfrak\relax\let\mathbffrak\relax\fi
-\ifx\mathalfa@scrnr\m@ne\else\let\mathscr\relax\fi
% Some error messages
\newcommand*\mathalpha@boldError[2]{%#1=item specified, #2 from bb,cal,scr,frak
\PackageError{mathalpha}{You specified `#2=#1,b#2', but `#1' has no bold\space#2}{}}
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index 3aebf9976f..c69dbaa4d8 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,16 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.0.36]
+
+### Changed
+- Internal changes to tabular code to improve visual output when integer part
+ is overfull (in preparation for _The LaTeX Companion_, 3rd Edition)
+
+### Fixed
+- Printing fractional units using `\sfrac` (see issue
+ [#558](https://github.com/josephwright/siunitx/issues/558))
+
## [v3.0.35]
### Changed
@@ -1622,7 +1632,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.35...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.36...HEAD
+[v3.0.36]: https://github.com/josephwright/siunitx/compare/v3.0.35...v3.0.36
[v3.0.35]: https://github.com/josephwright/siunitx/compare/v3.0.34...v3.0.35
[v3.0.34]: https://github.com/josephwright/siunitx/compare/v3.0.33...v3.0.34
[v3.0.33]: https://github.com/josephwright/siunitx/compare/v3.0.32...v3.0.33
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index 64dae8774b..840c9f384c 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-print.dtx b/macros/latex/contrib/siunitx/siunitx-print.dtx
index 5bcc08f65b..337901d47f 100644
--- a/macros/latex/contrib/siunitx/siunitx-print.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-print.dtx
@@ -532,6 +532,7 @@
% \@@_math_auxi:n,
% \@@_math_auxii:n,
% }
+% \begin{macro}{\@@_math_text_setup:}
% \begin{macro}{\@@_math_replace:Nn}
% \begin{macro}
% {
@@ -622,11 +623,16 @@
\cs_new_protected:Npn \@@_math_auxii:n #1
{
\group_begin:
- \cs_set_protected:Npn \text ##1
+ \tl_if_head_eq_meaning:nNTF {#1} \sfrac
{
- \cs_set_eq:NN \text \@@_ams_text:n
- \siunitx_print_text:n {##1}
+ \cs_set_protected:Npn \text ##1
+ {
+ \cs_set_eq:NN \text \@@_ams_text:n
+ \@@_math_text_setup:
+ ##1
+ }
}
+ { \@@_math_text_setup: }
\tl_set:Nn \l_@@_tmp_tl {#1}
\exp_after:wN \@@_math_replace:Nn
\l_@@_math_html_tl
@@ -634,6 +640,23 @@
\exp_args:NV \@@_math_auxiii:n \l_@@_tmp_tl
\group_end:
}
+% \end{macrocode}
+% Within the math mode argument, there might be a nested \cs{text}, at which
+% point we need to apply the text-mode support. Within \emph{that}, we need
+% to reset \cs{text} to normal. There is one wrinkle, which is covered in the
+% function above: the \cs{sfrac} command from \pkg{xfrac}. In the latter,
+% there is a \cs{text} applied to the two arguments, and the material that is
+% passed contains a lot of code: we cannot apply search-and-replace there.
+% Instead, we delay things by one expansion.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_math_text_setup:
+ {
+ \cs_set_protected:Npn \text ##1
+ {
+ \cs_set_eq:NN \text \@@_ams_text:n
+ \siunitx_print_text:n {##1}
+ }
+ }
\cs_new_protected:Npn \@@_math_replace:Nn #1#2
{
\quark_if_recursion_tail_stop:N #1
@@ -764,6 +787,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\siunitx_print_text:n}
% \begin{macro}{\@@_text_replace:n, \@@_text_replace_aux:n}
diff --git a/macros/latex/contrib/siunitx/siunitx-table.dtx b/macros/latex/contrib/siunitx/siunitx-table.dtx
index 75a5a7f011..386e497052 100644
--- a/macros/latex/contrib/siunitx/siunitx-table.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-table.dtx
@@ -1114,8 +1114,6 @@
% \l_@@_align_before_bool ,
% \l_@@_align_uncertainty_bool
% }
-% Alignment is handled using a |tl| as this allows a fast lookup at the
-% point of use.
% \begin{macrocode}
\keys_define:nn { siunitx }
{
@@ -1323,10 +1321,15 @@
% \end{macrocode}
% The integer part follows much the same pattern, except now it is control
% of the comparator alignment that determines where the white space goes.
+% We want to make sure that \emph{if} the integer is too long, it pokes out
+% to the left, and at the same time we want to issue exactly one overfull
+% box warning. That is achieved using an explicit test, such that if there
+% is an issue we force the size of the content appropriately. That process
+% will lead to a hit but only for \enquote{defective} input.
+%
% As we already have content in the |integer| box, we need to measure how
-% much \emph{extra} material has been added. To avoid using more boxes
-% or re-setting, we do that by recording sizes before and after the change.
-% (In effect, \cs{l_@@_tmp_dim} is here \enquote{l_@@_comparator_dim}.)
+% much \emph{extra} material has been added.
+%
% As the integer part is completed here, we are able to finalise the width
% of the pre-numeral part, reboxing it to have the correct width and possibly
% to force a single overfull warning if appropriate.
@@ -1335,6 +1338,18 @@
#1 \q_nil #2 \q_nil #3 \q_mark #4 \q_nil #5 \q_nil #6 \q_stop
{
\@@_print_format_box:Nn \l_@@_tmp_box {#1#2}
+ \dim_set:Nn \l_@@_tmp_dim { \box_wd:N \l_@@_tmp_box }
+ \@@_print_format_box:Nn \l_@@_tmp_box {#4#5}
+ \dim_compare:nNnT { \box_wd:N \l_@@_tmp_box } > \l_@@_tmp_dim
+ {
+ \hbox_set_to_wd:Nnn \l_@@_tmp_box \l_@@_tmp_dim
+ { \hbox_unpack:N \l_@@_tmp_box }
+ \hbox_set_to_wd:Nnn \l_@@_tmp_box \l_@@_tmp_dim
+ {
+ \tex_hss:D
+ \hbox_unpack:N \l_@@_tmp_box
+ }
+ }
\bool_lazy_and:nnTF
{ \l_@@_align_comparator_bool }
{ \dim_compare_p:nNn { \box_wd:N \l_@@_integer_box } > { 0pt } }
@@ -1342,12 +1357,12 @@
\hbox_set_to_wd:Nnn \l_@@_integer_box
{
\box_wd:N \l_@@_integer_box
- + \box_wd:N \l_@@_tmp_box
+ + \l_@@_tmp_dim
}
{
\hbox_unpack:N \l_@@_integer_box
\@@_fil:
- \siunitx_print_number:n {#4#5}
+ \hbox_unpack:N \l_@@_tmp_box
}
}
{
@@ -1356,27 +1371,24 @@
\hbox_set_to_wd:Nnn \l_@@_integer_box
{
\box_wd:N \l_@@_integer_box
- + \box_wd:N \l_@@_tmp_box
+ + \l_@@_tmp_dim
}
{
\@@_fil:
\hbox_unpack:N \l_@@_integer_box
- \siunitx_print_number:n {#4#5}
+ \hbox_unpack:N \l_@@_tmp_box
}
}
{
- \dim_set:Nn \l_@@_tmp_dim
- { \box_wd:N \l_@@_integer_box }
\hbox_set:Nn \l_@@_integer_box
{
\hbox_unpack:N \l_@@_integer_box
- \siunitx_print_number:n {#4#5}
+ \hbox_unpack:N \l_@@_tmp_box
}
\dim_add:Nn \l_@@_before_dim
{
- + \box_wd:N \l_@@_tmp_box
- + \l_@@_tmp_dim
- - \box_wd:N \l_@@_integer_box
+ \l_@@_tmp_dim
+ - \box_wd:N \l_@@_tmp_box
}
}
}
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 6fd0040427..e48aaa37ae 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-11-03} {3.0.35}
+\ProvidesExplPackage {siunitx} {2021-11-18} {3.0.36}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index bb59f34127..89231df355 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 3ef382d722..0cde5ebbd3 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -590,7 +590,7 @@ In addition to the official \acro{SI} units, \pkg{siunitx} also provides macros
for a number of units which are accepted for use in the \acro{SI} although they
are not \acro{SI} units. Table~\ref{tab:unit:accepted} lists the
\enquote{accepted} units. The command \cs{percent} is also provided for use in
-units: this is accepted with the \acro{SI} as detailed in Section~5.3.7 of the
+units: this is accepted with the \acro{SI} as detailed in Section~5.4.7 of the
Brochure.
\begin{table}
\caption{Non-\acro{SI} units accepted for use with the International System of