summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltmath.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/ltmath.dtx')
-rw-r--r--macros/latex-dev/base/ltmath.dtx34
1 files changed, 32 insertions, 2 deletions
diff --git a/macros/latex-dev/base/ltmath.dtx b/macros/latex-dev/base/ltmath.dtx
index 1bd979f7de..60394460f5 100644
--- a/macros/latex-dev/base/ltmath.dtx
+++ b/macros/latex-dev/base/ltmath.dtx
@@ -38,7 +38,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmath.dtx}
- [2022/05/08 v1.2l LaTeX Kernel (Math Setup)]
+ [2022/09/07 v1.2m LaTeX Kernel (Math Setup)]
% \iffalse
%</driver>
%
@@ -370,9 +370,39 @@
% \begin{macrocode}
\def\makesm@sh#1{%
\setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finsm@sh}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2022/11/01}%
+%<latexrelease> {\mathsm@sh}{Guard against reboxing}%
\def\mathsm@sh#1#2{%
- \setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh}
+ \setbox\z@\hbox{$\m@th#1{#2}$}%
+% \end{macrocode}
+% The empty brace groups in front of the smashed box (which is
+% placed by \cs{finsm@sh}) ensures that a \cs{smash} in math is not
+% just producing a single box with its dimensions altered, but a
+% box plus this second ord atom. The reason is that \TeX{} sometimes reboxes a
+% box if its the only thing in a place like the denominator of a
+% fraction. This would then undo the smashing and the additional
+% ord atom prevents that. Two ord atoms in a row do not alter the
+% horizontal spacing in a formula so this is otherwise transparent.
+% \changes{v1.2m}{2022/09/03}{Guard against reboxing in fractions (gh/517)}
+% \begin{macrocode}
+ {}\finsm@sh}
% \end{macrocode}
+% \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\mathsm@sh}{Guard against reboxing}%
+%<latexrelease>\def\mathsm@sh#1#2{%
+%<latexrelease> \setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+%
% \changes{v1.2b}{2018/09/24}{Start LR-mode if necessary (git/49)}
% \begin{macrocode}
%</2ekernel>