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.dtx179
1 files changed, 114 insertions, 65 deletions
diff --git a/macros/latex-dev/base/ltmath.dtx b/macros/latex-dev/base/ltmath.dtx
index d7c283f9ef..c38f42b4f9 100644
--- a/macros/latex-dev/base/ltmath.dtx
+++ b/macros/latex-dev/base/ltmath.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright 1993-2018
+% Copyright (C) 1993-2019
% The LaTeX3 Project and any individual authors listed elsewhere
% in this file.
%
@@ -13,7 +13,7 @@
% The latest version of this license is in
% https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
+% version 2008 or later.
%
% This file has the LPPL maintenance status "maintained".
%
@@ -38,7 +38,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmath.dtx}
- [2018/09/24 v1.2b LaTeX Kernel (Math Setup)]
+ [2019/08/27 v1.2c LaTeX Kernel (Math Setup)]
% \iffalse
%</driver>
%
@@ -95,49 +95,50 @@
% \changes{v1.0r}{1995/05/07}{Use \cs{hb@xt@}}
% \changes{v1.0r}{1995/05/21}{Update some plain macros}
% \changes{v1.0t}{1995/06/28}{minor doc edits}
+% \changes{v1.2c}{2019/08/27}{Make various commands robust}
%
% \begin{macro}{\log}
% The standard operators:
% \begin{macrocode}
-\def\log{\mathop{\operator@font log}\nolimits}
-\def\lg{\mathop{\operator@font lg}\nolimits}
-\def\ln{\mathop{\operator@font ln}\nolimits}
-\def\lim{\mathop{\operator@font lim}}
-\def\limsup{\mathop{\operator@font lim\,sup}}
-\def\liminf{\mathop{\operator@font lim\,inf}}
-\def\sin{\mathop{\operator@font sin}\nolimits}
-\def\arcsin{\mathop{\operator@font arcsin}\nolimits}
-\def\sinh{\mathop{\operator@font sinh}\nolimits}
-\def\cos{\mathop{\operator@font cos}\nolimits}
-\def\arccos{\mathop{\operator@font arccos}\nolimits}
-\def\cosh{\mathop{\operator@font cosh}\nolimits}
-\def\tan{\mathop{\operator@font tan}\nolimits}
-\def\arctan{\mathop{\operator@font arctan}\nolimits}
-\def\tanh{\mathop{\operator@font tanh}\nolimits}
-\def\cot{\mathop{\operator@font cot}\nolimits}
-\def\coth{\mathop{\operator@font coth}\nolimits}
-\def\sec{\mathop{\operator@font sec}\nolimits}
-\def\csc{\mathop{\operator@font csc}\nolimits}
-\def\max{\mathop{\operator@font max}}
-\def\min{\mathop{\operator@font min}}
-\def\sup{\mathop{\operator@font sup}}
-\def\inf{\mathop{\operator@font inf}}
-\def\arg{\mathop{\operator@font arg}\nolimits}
-\def\ker{\mathop{\operator@font ker}\nolimits}
-\def\dim{\mathop{\operator@font dim}\nolimits}
-\def\hom{\mathop{\operator@font hom}\nolimits}
-\def\det{\mathop{\operator@font det}}
-\def\exp{\mathop{\operator@font exp}\nolimits}
-\def\Pr{\mathop{\operator@font Pr}}
-\def\gcd{\mathop{\operator@font gcd}}
-\def\deg{\mathop{\operator@font deg}\nolimits}
+\DeclareRobustCommand\log{\mathop{\operator@font log}\nolimits}
+\DeclareRobustCommand\lg{\mathop{\operator@font lg}\nolimits}
+\DeclareRobustCommand\ln{\mathop{\operator@font ln}\nolimits}
+\DeclareRobustCommand\lim{\mathop{\operator@font lim}}
+\DeclareRobustCommand\limsup{\mathop{\operator@font lim\,sup}}
+\DeclareRobustCommand\liminf{\mathop{\operator@font lim\,inf}}
+\DeclareRobustCommand\sin{\mathop{\operator@font sin}\nolimits}
+\DeclareRobustCommand\arcsin{\mathop{\operator@font arcsin}\nolimits}
+\DeclareRobustCommand\sinh{\mathop{\operator@font sinh}\nolimits}
+\DeclareRobustCommand\cos{\mathop{\operator@font cos}\nolimits}
+\DeclareRobustCommand\arccos{\mathop{\operator@font arccos}\nolimits}
+\DeclareRobustCommand\cosh{\mathop{\operator@font cosh}\nolimits}
+\DeclareRobustCommand\tan{\mathop{\operator@font tan}\nolimits}
+\DeclareRobustCommand\arctan{\mathop{\operator@font arctan}\nolimits}
+\DeclareRobustCommand\tanh{\mathop{\operator@font tanh}\nolimits}
+\DeclareRobustCommand\cot{\mathop{\operator@font cot}\nolimits}
+\DeclareRobustCommand\coth{\mathop{\operator@font coth}\nolimits}
+\DeclareRobustCommand\sec{\mathop{\operator@font sec}\nolimits}
+\DeclareRobustCommand\csc{\mathop{\operator@font csc}\nolimits}
+\DeclareRobustCommand\max{\mathop{\operator@font max}}
+\DeclareRobustCommand\min{\mathop{\operator@font min}}
+\DeclareRobustCommand\sup{\mathop{\operator@font sup}}
+\DeclareRobustCommand\inf{\mathop{\operator@font inf}}
+\DeclareRobustCommand\arg{\mathop{\operator@font arg}\nolimits}
+\DeclareRobustCommand\ker{\mathop{\operator@font ker}\nolimits}
+\DeclareRobustCommand\dim{\mathop{\operator@font dim}\nolimits}
+\DeclareRobustCommand\hom{\mathop{\operator@font hom}\nolimits}
+\DeclareRobustCommand\det{\mathop{\operator@font det}}
+\DeclareRobustCommand\exp{\mathop{\operator@font exp}\nolimits}
+\DeclareRobustCommand\Pr{\mathop{\operator@font Pr}}
+\DeclareRobustCommand\gcd{\mathop{\operator@font gcd}}
+\DeclareRobustCommand\deg{\mathop{\operator@font deg}\nolimits}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bmod}
% And some operators have to be done by hand:
% \begin{macrocode}
-\def\bmod{%
+\DeclareRobustCommand\bmod{%
\nonscript\mskip-\medmuskip\mkern5mu%
\mathbin{\operator@font mod}\penalty900\mkern5mu%
\nonscript\mskip-\medmuskip}
@@ -146,7 +147,7 @@
%
% \begin{macro}{\pmod}
% \begin{macrocode}
-\def\pmod#1{%
+\DeclareRobustCommand\pmod[1]{%
\allowbreak\mkern18mu({\operator@font mod}\,\,#1)}
% \end{macrocode}
% \end{macro}
@@ -156,18 +157,18 @@
% \begin{macro}{\big}
% Variants on |\big| and friends for use with delimiters:
% \begin{macrocode}
-\def\bigl{\mathopen\big}
-\def\bigm{\mathrel\big}
-\def\bigr{\mathclose\big}
-\def\Bigl{\mathopen\Big}
-\def\Bigm{\mathrel\Big}
-\def\Bigr{\mathclose\Big}
-\def\biggl{\mathopen\bigg}
-\def\biggm{\mathrel\bigg}
-\def\biggr{\mathclose\bigg}
-\def\Biggl{\mathopen\Bigg}
-\def\Biggm{\mathrel\Bigg}
-\def\Biggr{\mathclose\Bigg}
+\DeclareRobustCommand\bigl{\mathopen\big}
+\DeclareRobustCommand\bigm{\mathrel\big}
+\DeclareRobustCommand\bigr{\mathclose\big}
+\DeclareRobustCommand\Bigl{\mathopen\Big}
+\DeclareRobustCommand\Bigm{\mathrel\Big}
+\DeclareRobustCommand\Bigr{\mathclose\Big}
+\DeclareRobustCommand\biggl{\mathopen\bigg}
+\DeclareRobustCommand\biggm{\mathrel\bigg}
+\DeclareRobustCommand\biggr{\mathclose\bigg}
+\DeclareRobustCommand\Biggl{\mathopen\Bigg}
+\DeclareRobustCommand\Biggm{\mathrel\Bigg}
+\DeclareRobustCommand\Biggr{\mathclose\Bigg}
% \end{macrocode}
% \end{macro}
%
@@ -252,23 +253,55 @@
% {(DPC) use \cs{expandafter} instead of \cs{next}}
% \changes{v1.0p}{1994/11/18}
% {(DPC) colour support}
+
% \begin{macro}{\hphantom}
% \begin{macro}{\vphantom}
% \begin{macrocode}
\newif\ifv@
\newif\ifh@
% \end{macrocode}
+%
+%
+%
+%
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease> {\vphantom}{Make commands robust}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareRobustCommand\vphantom{\v@true\h@false\ph@nt}
+% \end{macrocode}
%
% \begin{macrocode}
-\def\vphantom{\v@true\h@false\ph@nt}
+\DeclareRobustCommand\hphantom{\v@false\h@true\ph@nt}
% \end{macrocode}
%
% \begin{macrocode}
-\def\hphantom{\v@false\h@true\ph@nt}
+\DeclareRobustCommand\phantom{\v@true\h@true\ph@nt}
% \end{macrocode}
%
+% \begin{macro}{\mathstrut}
+% \begin{macrocode}
+\DeclareRobustCommand\mathstrut{\vphantom(}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
-\def\phantom{\v@true\h@true\ph@nt}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\vphantom}{Make commands robust}%
+%<latexrelease>
+%<latexrelease>\kernel@make@fragile\vphantom
+%<latexrelease>\kernel@make@fragile\hphantom
+%<latexrelease>\kernel@make@fragile\phantom
+%<latexrelease>\kernel@make@fragile\mathstrut
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
% \end{macrocode}
%
% \begin{macrocode}
@@ -318,11 +351,6 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\mathstrut}
-% \begin{macrocode}
-\def\mathstrut{\vphantom(}
-% \end{macrocode}
-% \end{macro}
%
% \begin{macro}{\smash}
% \changes{v1.0p}{1994/11/18}
@@ -330,7 +358,7 @@
% \changes{v1.0p}{1994/11/18}
% {(DPC) colour support}
% \begin{macrocode}
-\def\smash{%
+\DeclareRobustCommand\smash{%
\relax % \relax, in case this comes first in \halign
\ifmmode
\expandafter\mathpalette\expandafter\mathsm@sh
@@ -368,19 +396,26 @@
% \end{macrocode}
% \end{macro}
%
-%
+%
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease> {\cases}{Make commands robust}%
+% \end{macrocode}
+%
% \begin{macro}{\cases}
% \changes{LaTeX2.09}{1991/08/14}
% {(RmS) inserted extra braces around entry for NFSS}
% \begin{macrocode}
-\def\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}
% \begin{macrocode}
-\def\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}}}\,}
@@ -389,10 +424,24 @@
%
% \begin{macro}{\pmatrix}
% \begin{macrocode}
-\def\pmatrix#1{\left(\matrix{#1}\right)}
+\DeclareRobustCommand\pmatrix[1]{\left(\matrix{#1}\right)}
% \end{macrocode}
% \end{macro}
%
+% \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\cases}{Make commands robust}%
+%<latexrelease>
+%<latexrelease>\kernel@make@fragile\cases
+%<latexrelease>\kernel@make@fragile\matrix
+%<latexrelease>\kernel@make@fragile\pmatrix
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+%
%
% \begin{macro}{\bordermatrix}
% \changes{LaTeX2e}{1994/01/25}{Removed \cs{p@renwd}.}
@@ -475,7 +524,7 @@
%
% \begin{macro}{\*}
% \begin{macrocode}
-\def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}}
+\DeclareRobustCommand\*{\discretionary{\thinspace\the\textfont2\char2}{}{}}
% \end{macrocode}
% \end{macro}
%
@@ -712,7 +761,7 @@
% \begin{macro}{\stackrel}
% A disguise for plain \TeX's buildrel.
% \begin{macrocode}
-\def\stackrel#1#2{\mathrel{\mathop{#2}\limits^{#1}}}
+\DeclareRobustCommand\stackrel[2]{\mathrel{\mathop{#2}\limits^{#1}}}
% \end{macrocode}
% \end{macro}
%
@@ -724,7 +773,7 @@
% \begin{macro}{\frac}
% A disguise for plain \TeX's |\over|.
% \begin{macrocode}
-\def\frac#1#2{{\begingroup#1\endgroup\over#2}}
+\DeclareRobustCommand\frac[2]{{\begingroup#1\endgroup\over#2}}
% \end{macrocode}
% \end{macro}
%