summaryrefslogtreecommitdiff
path: root/macros/latex/base/ltmath.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-03 03:01:09 +0000
committerNorbert Preining <norbert@preining.info>2020-10-03 03:01:09 +0000
commit0e644e6805342838052f46e6af93f81644d0390b (patch)
tree26169230ce62dc353013ad08fb824f46d9511980 /macros/latex/base/ltmath.dtx
parent37f9a57b2f39142fbccb20b758af8e0502499671 (diff)
CTAN sync 202010030301
Diffstat (limited to 'macros/latex/base/ltmath.dtx')
-rw-r--r--macros/latex/base/ltmath.dtx152
1 files changed, 134 insertions, 18 deletions
diff --git a/macros/latex/base/ltmath.dtx b/macros/latex/base/ltmath.dtx
index 18688068b0..36b8bb7ec4 100644
--- a/macros/latex/base/ltmath.dtx
+++ b/macros/latex/base/ltmath.dtx
@@ -38,7 +38,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmath.dtx}
- [2019/08/27 v1.2c LaTeX Kernel (Math Setup)]
+ [2020/07/27 v1.2g LaTeX Kernel (Math Setup)]
% \iffalse
%</driver>
%
@@ -407,15 +407,17 @@
% \begin{macro}{\cases}
% \changes{LaTeX2.09}{1991/08/14}
% {(RmS) inserted extra braces around entry for NFSS}
+% \changes{v1.2g}{2020/07/27}{Don't make the command \cs{long} (gh/354)}
% \begin{macrocode}
-\DeclareRobustCommand\cases[1]{\left\{\,\vcenter{\normalbaselines\m@th
+\DeclareRobustCommand*\cases[1]{\left\{\,\vcenter{\normalbaselines\m@th
\ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\right.}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\matrix}
+% \changes{v1.2g}{2020/07/27}{Don't make the command \cs{long} (gh/354)}
% \begin{macrocode}
-\DeclareRobustCommand\matrix[1]{\null\,\vcenter{\normalbaselines\m@th
+\DeclareRobustCommand*\matrix[1]{\null\,\vcenter{\normalbaselines\m@th
\ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
\mathstrut\crcr\noalign{\kern-\baselineskip}
#1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}
@@ -423,8 +425,9 @@
% \end{macro}
%
% \begin{macro}{\pmatrix}
+% \changes{v1.2g}{2020/07/27}{Don't make the command \cs{long} (gh/354)}
% \begin{macrocode}
-\DeclareRobustCommand\pmatrix[1]{\left(\matrix{#1}\right)}
+\DeclareRobustCommand*\pmatrix[1]{\left(\matrix{#1}\right)}
% \end{macrocode}
% \end{macro}
%
@@ -509,18 +512,103 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\>}
-% \begin{macro}{\;}
-% \begin{macro}{\!}
+
+
+%
+% \begin{macro}{\tmspace}
+% \begin{macro}{\,}
+% \begin{macro}{\thinspace}
+% \begin{macro}{\!}
+% \begin{macro}{\negthinspace}
+% \begin{macro}{\:}
+% \begin{macro}{\medspace}
+% \begin{macro}{\negmedspace}
+% \begin{macro}{\;}
+% \begin{macro}{\thickspace}
+% \begin{macro}{\negthickspace}
+%
+% Originally \LaTeX{} only provided a small set of spacing commands
+% for use in text and math, some of the commands like \cs{;} were
+% only supported in manth mode. \texttt{amsmath} normalized and
+% provided all of them in text and math. This code has now been
+% moved to the kernel so that it is generally available.
+%
+%
% \begin{macrocode}
-%\def\,{\mskip\thinmuskip} % already defined in ltspace
-\def\>{\mskip\medmuskip}
-\def\;{\mskip\thickmuskip}
-\def\!{\mskip-\thinmuskip}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease> {\tmspace}{amsmath spacing commands}%
+% \end{macrocode}
+% \cs{tmspace} is really meant to be an internal command so it
+% doesn't necessarily has to be robust but it was robust in
+% \texttt{amsmath} so we leave it like that.
+% \changes{v1.2e}{2020/03/07}{Add \texttt{amsmath} math/text spacing
+% commands to the kernel (gh/303)}
+% \begin{macrocode}
+\DeclareRobustCommand\tmspace[3]{%
+ \ifmmode\mskip#1#2\else\leavevmode@ifvmode\kern#1#3\fi\relax}
+% \end{macrocode}
+% In \texttt{amsmath} the text kern is \texttt{.1667em}. For
+% compatibility reasons we keep the longer one.
+% \begin{macrocode}
+\DeclareRobustCommand\,{\tmspace+\thinmuskip{.16667em}}
+\let\thinspace\,
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
+%
+% \begin{macrocode}
+\DeclareRobustCommand\!{\tmspace-\thinmuskip{.16667em}}
+\let\negthinspace\!
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareRobustCommand\:{\tmspace+\medmuskip{.2222em}}
+\let\medspace\:
+% \end{macrocode}
+% \LaTeX{} has a second name for this in its manual:
+% \begin{macrocode}
+\let\>=\:
+\DeclareRobustCommand\negmedspace{\tmspace-\medmuskip{.2222em}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareRobustCommand\;{\tmspace+\thickmuskip{.2777em}}
+\let\thickspace\;
+\DeclareRobustCommand\negthickspace{\tmspace-\thickmuskip{.2777em}}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\tmspace}{amsmath spacing commands}%
+%<latexrelease>
+%<latexrelease>\let\tmspace\@undefined
+%<latexrelease>\DeclareRobustCommand{\,}{%
+%<latexrelease> \relax\ifmmode\mskip\thinmuskip\else\thinspace\fi}
+%<latexrelease>\DeclareRobustCommand\thinspace{\leavevmode@ifvmode\kern .16667em }
+%<latexrelease>\DeclareRobustCommand\negthinspace{\leavevmode@ifvmode\kern-.16667em }
+%<latexrelease>\def\>{\mskip\medmuskip}
+%<latexrelease>\let\:=\>
+%<latexrelease>\def\;{\mskip\thickmuskip}
+%<latexrelease>\def\!{\mskip-\thinmuskip}
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
%
% \begin{macro}{\*}
% \begin{macrocode}
@@ -532,7 +620,7 @@
% Nickname for the medium space since |\>| is not available inside
% \texttt{tabbing}.
% \begin{macrocode}
-\let\:=\>
+%\let\:=\>
% \end{macrocode}
% \end{macro}
%
@@ -884,12 +972,32 @@
\def\@yeqncr{\@testopt\@xeqncr\z@skip}
% \end{macrocode}
%
+% \changes{v1.2f}{2020/04/21}{Support calc syntax (gh/152)}
% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease> {\@xeqncr}{eqnarray support calc syntax}%
\def\@xeqncr[#1]{%
\ifnum0=`{\fi}%
\@@eqncr
- \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}%
+ \noalign{\penalty\@eqpen\vskip\jot\@vspace@calcify{#1}}%
}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\@xeqncr}{eqnarray support calc syntax}%
+%<latexrelease>
+%<latexrelease>\def\@xeqncr[#1]{%
+%<latexrelease> \ifnum0=`{\fi}%
+%<latexrelease> \@@eqncr
+%<latexrelease> \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}%
+%<latexrelease>}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
% \end{macrocode}
%
% \end{macro}
@@ -1009,9 +1117,11 @@
%
% \begin{macro}{\mathindent}
% The amount of indentation of the equations is stored in a register.
+% \changes{v1.2d}{2020/02/18}{Make \cs{mathindent} a skip register to match
+% amsmath (gh/252)}
% \begin{macrocode}
%<*fleqn>
-\newdimen\mathindent
+\newskip\mathindent
% \end{macrocode}
% The setting of |\mathindent| has to be deferred until the class
% file has been processed, because |\leftmargini| is still 0pt
@@ -1097,7 +1207,13 @@
\hb@xt@\linewidth\bgroup $\m@th% $
\displaystyle
\hskip\mathindent}%
- {$\hfil % $
+% \end{macrocode}
+% Ensure that there is at least a space between formula and
+% equation number so that they don't bump in each other.
+% \changes{v1.2d}{2020/02/18}{Separate formula and eqn number by at
+% least a space in fleqn option}
+% \begin{macrocode}
+ {$\hskip .3em minus.3em\hfil % $
\displaywidth\linewidth\hbox{\@eqnnum}%
\egroup
\endtrivlist}