Skip to content

Commit

Permalink
initial go at robustness ... more to do, no rollback yet
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Aug 20, 2019
1 parent 9cc1594 commit 96832b8
Show file tree
Hide file tree
Showing 38 changed files with 2,560 additions and 812 deletions.
55 changes: 30 additions & 25 deletions base/classes.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,11 @@
% \begin{macrocode}
\normalsize
% \end{macrocode}
% We use |\MakeRobust| instead of |\DeclareRobustCommand| above to avoid a log
% entry for the redefinition.
% \begin{macrocode}
\MakeRobust\normalsize
% \end{macrocode}
% \end{macro}
% \end{macro}
%
Expand All @@ -618,7 +623,7 @@
% \changes{v1.2e}{1994/04/14}{\cs{small} is no longer defined in the
% kernel; use \cs{newcommand}}
% \begin{macrocode}
\newcommand\small{%
\DeclareRobustCommand\small{%
%<*10pt>
\@setfontsize\small\@ixpt{11}%
\abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
Expand Down Expand Up @@ -660,7 +665,7 @@
% kernel, so use \cs{renewcommand}. ASAJ.}
% \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again}
% \begin{macrocode}
\newcommand\footnotesize{%
\DeclareRobustCommand\footnotesize{%
%<*10pt>
\@setfontsize\footnotesize\@viiipt{9.5}%
\abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
Expand Down Expand Up @@ -712,30 +717,30 @@
% \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again}
% \begin{macrocode}
%<*10pt>
\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
\newcommand\large{\@setfontsize\large\@xiipt{14}}
\newcommand\Large{\@setfontsize\Large\@xivpt{18}}
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
\DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
\DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
\DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
%</10pt>
%<*11pt>
\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
\newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
\newcommand\large{\@setfontsize\large\@xiipt{14}}
\newcommand\Large{\@setfontsize\Large\@xivpt{18}}
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
\DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
\DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
\DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
%</11pt>
%<*12pt>
\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
\newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
\newcommand\large{\@setfontsize\large\@xivpt{18}}
\newcommand\Large{\@setfontsize\Large\@xviipt{22}}
\newcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}}
\newcommand\huge{\@setfontsize\huge\@xxvpt{30}}
\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
\DeclareRobustCommand\large{\@setfontsize\large\@xivpt{18}}
\DeclareRobustCommand\Large{\@setfontsize\Large\@xviipt{22}}
\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xxpt{25}}
\DeclareRobustCommand\huge{\@setfontsize\huge\@xxvpt{30}}
\let\Huge=\huge
%</12pt>
% \end{macrocode}
Expand Down Expand Up @@ -1766,9 +1771,9 @@
% information provided. The definitions of these macros are shown
% here for information.
% \begin{macrocode}
% \newcommand*{\title}[1]{\gdef\@title{#1}}
% \newcommand*{\author}[1]{\gdef\@author{#1}}
% \newcommand*{\date}[1]{\gdef\@date{#1}}
% \DeclareRobustCommand*{\title}[1]{\gdef\@title{#1}}
% \DeclareRobustCommand*{\author}[1]{\gdef\@author{#1}}
% \DeclareRobustCommand*{\date}[1]{\gdef\@date{#1}}
% \end{macrocode}
% The |\date| macro gets today's date by default.
% \begin{macrocode}
Expand Down
52 changes: 27 additions & 25 deletions base/fontdef.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@
%
% \begin{macrocode}
\DeclareMathSymbol{\aleph}{\mathord}{symbols}{"40}
\def\hbar{{\mathchar'26\mkern-9muh}}
\DeclareRobustCommand\hbar{{\mathchar'26\mkern-9muh}}
\DeclareMathSymbol{\imath}{\mathord}{letters}{"7B}
\DeclareMathSymbol{\jmath}{\mathord}{letters}{"7C}
\DeclareMathSymbol{\ell}{\mathord}{letters}{"60}
Expand All @@ -849,10 +849,10 @@
\DeclareMathSymbol{\prime}{\mathord}{symbols}{"30}
\DeclareMathSymbol{\emptyset}{\mathord}{symbols}{"3B}
\DeclareMathSymbol{\nabla}{\mathord}{symbols}{"72}
\def\surd{{\mathchar"1270}}
\DeclareRobustCommand\surd{{\mathchar"1270}}
\DeclareMathSymbol{\top}{\mathord}{symbols}{"3E}
\DeclareMathSymbol{\bot}{\mathord}{symbols}{"3F}
\def\angle{{\vbox{\ialign{$\m@th\scriptstyle##$\crcr
\DeclareRobustCommand\angle{{\vbox{\ialign{$\m@th\scriptstyle##$\crcr
\not\mathrel{\mkern14mu}\crcr
\noalign{\nointerlineskip}
\mkern2.5mu\leaders\hrule \@height.34pt\hfill\mkern2.5mu\crcr}}}}
Expand Down Expand Up @@ -881,14 +881,14 @@
\DeclareMathSymbol{\bigcap}{\mathop}{largesymbols}{"54}
\DeclareMathSymbol{\bigcup}{\mathop}{largesymbols}{"53}
\DeclareMathSymbol{\intop}{\mathop}{largesymbols}{"52}
\def\int{\intop\nolimits}
\DeclareRobustCommand\int{\intop\nolimits}
\DeclareMathSymbol{\prod}{\mathop}{largesymbols}{"51}
\DeclareMathSymbol{\sum}{\mathop}{largesymbols}{"50}
\DeclareMathSymbol{\bigotimes}{\mathop}{largesymbols}{"4E}
\DeclareMathSymbol{\bigoplus}{\mathop}{largesymbols}{"4C}
\DeclareMathSymbol{\bigodot}{\mathop}{largesymbols}{"4A}
\DeclareMathSymbol{\ointop}{\mathop}{largesymbols}{"48}
\def\oint{\ointop\nolimits}
\DeclareRobustCommand\oint{\ointop\nolimits}
\DeclareMathSymbol{\bigsqcup}{\mathop}{largesymbols}{"46}
\DeclareMathSymbol{\smallint}{\mathop}{symbols}{"73}
% \end{macrocode}
Expand Down Expand Up @@ -961,7 +961,7 @@
\DeclareMathSymbol{\Leftrightarrow}{\mathrel}{symbols}{"2C}
\DeclareMathSymbol{\Leftarrow}{\mathrel}{symbols}{"28}
\DeclareMathSymbol{\Rightarrow}{\mathrel}{symbols}{"29}
\def\neq{\not=} \let\ne=\neq
\DeclareRobustCommand\neq{\not=} \let\ne=\neq
\DeclareMathSymbol{\leq}{\mathrel}{symbols}{"14}
\let\le=\leq
\DeclareMathSymbol{\geq}{\mathrel}{symbols}{"15}
Expand All @@ -987,7 +987,7 @@
\DeclareMathSymbol{\rightarrow}{\mathrel}{symbols}{"21}
\let\to=\rightarrow
\DeclareMathSymbol{\mapstochar}{\mathrel}{symbols}{"37}
\def\mapsto{\mapstochar\rightarrow}
\DeclareRobustCommand\mapsto{\mapstochar\rightarrow}
\DeclareMathSymbol{\sim}{\mathrel}{symbols}{"18}
\DeclareMathSymbol{\simeq}{\mathrel}{symbols}{"27}
\DeclareMathSymbol{\perp}{\mathrel}{symbols}{"3F}
Expand Down Expand Up @@ -1051,9 +1051,9 @@
\DeclareRobustCommand
\Relbar{\mathrel{=}}
\DeclareMathSymbol{\lhook}{\mathrel}{letters}{"2C}
\def\hookrightarrow{\lhook\joinrel\rightarrow}
\DeclareRobustCommand\hookrightarrow{\lhook\joinrel\rightarrow}
\DeclareMathSymbol{\rhook}{\mathrel}{letters}{"2D}
\def\hookleftarrow{\leftarrow\joinrel\rhook}
\DeclareRobustCommand\hookleftarrow{\leftarrow\joinrel\rhook}
\DeclareRobustCommand
\bowtie{\mathrel\triangleright\joinrel\mathrel\triangleleft}
% \end{macrocode}
Expand Down Expand Up @@ -1155,43 +1155,45 @@
% \subsubsection{Over and under something, etc}
%
% \begin{macrocode}
\def\overrightarrow#1{\vbox{\m@th\ialign{##\crcr
\DeclareRobustCommand\overrightarrow[1]{\vbox{\m@th\ialign{##\crcr
\rightarrowfill\crcr\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
\def\overleftarrow#1{\vbox{\m@th\ialign{##\crcr
\DeclareRobustCommand\overleftarrow[1]{\vbox{\m@th\ialign{##\crcr
\leftarrowfill\crcr\noalign{\kern-\p@\nointerlineskip}%
$\hfil\displaystyle{#1}\hfil$\crcr}}}
\def\overbrace#1{\mathop{\vbox{\m@th\ialign{##\crcr\noalign{\kern3\p@}%
\DeclareRobustCommand\overbrace[1]
{\mathop{\vbox{\m@th\ialign{##\crcr\noalign{\kern3\p@}%
\downbracefill\crcr\noalign{\kern3\p@\nointerlineskip}%
$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}
\def\underbrace#1{\mathop{\vtop{\m@th\ialign{##\crcr
\DeclareRobustCommand\underbrace[1]{\mathop{\vtop{\m@th\ialign{##\crcr
$\hfil\displaystyle{#1}\hfil$\crcr
\noalign{\kern3\p@\nointerlineskip}%
\upbracefill\crcr\noalign{\kern3\p@}}}}\limits}
% \end{macrocode}
% (quite a waste of tokens, IMHO --- Frank)
% \begin{macrocode}
\def\skew#1#2#3{{\muskip\z@#1mu\divide\muskip\z@\tw@ \mkern\muskip\z@
\DeclareRobustCommand\skew[3]
{{\muskip\z@#1mu\divide\muskip\z@\tw@ \mkern\muskip\z@
#2{\mkern-\muskip\z@{#3}\mkern\muskip\z@}\mkern-\muskip\z@}{}}
% \end{macrocode}
%
% \changes{v2.2n}{1995/11/21}{Incorporate changed figures,
% as in plain.tex}
% \begin{macrocode}
\def\rightarrowfill{$\m@th\smash-\mkern-7mu%
\DeclareRobustCommand\rightarrowfill{$\m@th\smash-\mkern-7mu%
\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
\mkern-7mu\mathord\rightarrow$}
\def\leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu%
\DeclareRobustCommand\leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu%
\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
\mkern-7mu\smash-$}
\DeclareMathSymbol{\braceld}{\mathord}{largesymbols}{"7A}
\DeclareMathSymbol{\bracerd}{\mathord}{largesymbols}{"7B}
\DeclareMathSymbol{\bracelu}{\mathord}{largesymbols}{"7C}
\DeclareMathSymbol{\braceru}{\mathord}{largesymbols}{"7D}
\def\downbracefill{$\m@th \setbox\z@\hbox{$\braceld$}%
\DeclareRobustCommand\downbracefill{$\m@th \setbox\z@\hbox{$\braceld$}%
\braceld\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\braceru
\bracelu\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\bracerd$}
\def\upbracefill{$\m@th \setbox\z@\hbox{$\braceld$}%
\DeclareRobustCommand\upbracefill{$\m@th \setbox\z@\hbox{$\braceld$}%
\bracelu\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\bracerd
\braceld\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\braceru$}
% \end{macrocode}
Expand Down Expand Up @@ -1295,8 +1297,8 @@
% \end{macrocode}
%
% \begin{macrocode}
\def\mathsterling{\mathit{\mathchar"7024}}
\def\mathunderscore{\kern.06em\vbox{\hrule\@width.3em}}
\DeclareRobustCommand\mathsterling{\mathit{\mathchar"7024}}
\DeclareRobustCommand\mathunderscore{\kern.06em\vbox{\hrule\@width.3em}}
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand All @@ -1307,7 +1309,7 @@
% \begin{macro}{\mathellipsis}
% This is plain \TeX's |\ldots|.
% \begin{macrocode}
\def\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}}%
\DeclareRobustCommand\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}}%
% \end{macrocode}
% \end{macro}
%
Expand All @@ -1321,13 +1323,13 @@
%<*math|latexrelease>
%<latexrelease>\IncludeInRelease{2018/12/01}%
%<latexrelease> {\Big}{Start LR-mode}%
\def\big#1{\leavevmode@ifvmode
\DeclareRobustCommand\big[1]{\leavevmode@ifvmode
{\hbox{$\left#1\vbox to8.5\p@{}\right.\n@space$}}}
\def\Big#1{\leavevmode@ifvmode
\DeclareRobustCommand\Big[1]{\leavevmode@ifvmode
{\hbox{$\left#1\vbox to11.5\p@{}\right.\n@space$}}}
\def\bigg#1{\leavevmode@ifvmode
\DeclareRobustCommand\bigg[1]{\leavevmode@ifvmode
{\hbox{$\left#1\vbox to14.5\p@{}\right.\n@space$}}}
\def\Bigg#1{\leavevmode@ifvmode
\DeclareRobustCommand\Bigg[1]{\leavevmode@ifvmode
{\hbox{$\left#1\vbox to17.5\p@{}\right.\n@space$}}}
%</math|latexrelease>
%<latexrelease>\EndIncludeInRelease
Expand Down
22 changes: 11 additions & 11 deletions base/ltboxes.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
% {\cs{long} added}
% The basic horizontal box command for \LaTeX.
% \begin{macrocode}
\long\def\mbox#1{\leavevmode\hbox{#1}}
\DeclareRobustCommand\mbox[1]{\leavevmode\hbox{#1}}
% \end{macrocode}
% \end{macro}
%
Expand Down Expand Up @@ -483,7 +483,7 @@
% {\cs{long} added}
% Save |#1| in a box register.
% \begin{macrocode}
\long\def\sbox#1#2{\setbox#1\hbox{%
\DeclareRobustCommand\sbox[2]{\setbox#1\hbox{%
\color@setgroup#2\color@endgroup}}
% \end{macrocode}
% \end{macro}
Expand Down Expand Up @@ -579,7 +579,7 @@
% \begin{macro}{\usebox}
% unchanged
% \begin{macrocode}
\def\usebox#1{\leavevmode\copy #1\relax}
\DeclareRobustCommand\usebox[1]{\leavevmode\copy #1\relax}
% \end{macrocode}
% \end{macro}
%
Expand All @@ -589,7 +589,7 @@
% (Extra space removed 14 Jan 88)
% RmS 92/08/24: Replaced occurrence of |\@halfwidth| by |\@wholewidth|
% \begin{macrocode}
\long\def\frame#1{%
\DeclareRobustCommand\frame[1]{%
\leavevmode
\hbox{%
\hskip-\@wholewidth
Expand Down Expand Up @@ -631,7 +631,7 @@
% \changes{v1.0s}{1995/04/27}
% {Move \cs{leavevmode} for graphics/1512}
% \begin{macrocode}
\long\def\fbox#1{%
\DeclareRobustCommand\fbox[1]{%
\leavevmode
\setbox\@tempboxa\hbox{%
\color@begingroup
Expand Down Expand Up @@ -1140,7 +1140,7 @@
% \LaTeX\ version works outside math.
% \task{???}{why the second `relax in `underline ?}
% \begin{macrocode}
\def\underline#1{%
\DeclareRobustCommand\underline[1]{%
\relax
\ifmmode\@@underline{#1}%
\else $\@@underline{\hbox{#1}}\m@th$\relax\fi}
Expand Down Expand Up @@ -1274,9 +1274,9 @@
% right adjusted.
% \begin{macrocode}
\def\@@line{\hb@xt@\hsize}
\def\leftline#1{\@@line{#1\hss}}
\def\rightline#1{\@@line{\hss#1}}
\def\centerline#1{\@@line{\hss#1\hss}}
\DeclareRobustCommand\leftline[1]{\@@line{#1\hss}}
\DeclareRobustCommand\rightline[1]{\@@line{\hss#1}}
\DeclareRobustCommand\centerline[1]{\@@line{\hss#1\hss}}
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand All @@ -1290,8 +1290,8 @@
% reference point without taking up space.
% \end{macro}
% \begin{macrocode}
\def\rlap#1{\hb@xt@\z@{#1\hss}}
\def\llap#1{\hb@xt@\z@{\hss#1}}
\DeclareRobustCommand\rlap[1]{\hb@xt@\z@{#1\hss}}
\DeclareRobustCommand\llap[1]{\hb@xt@\z@{\hss#1}}
% \end{macrocode}
% \end{macro}
%
Expand Down
6 changes: 3 additions & 3 deletions base/ltclass.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1580,8 +1580,8 @@
% \end{macrocode}
%
% \begin{macrocode}
\def\AtBeginDocument{\g@addto@macro\@begindocumenthook}
\def\AtEndDocument{\g@addto@macro\@enddocumenthook}
\DeclareRobustCommand\AtBeginDocument{\g@addto@macro\@begindocumenthook}
\DeclareRobustCommand\AtEndDocument{\g@addto@macro\@enddocumenthook}
\@onlypreamble\AtBeginDocument
% \end{macrocode}
% \end{macro}
Expand Down Expand Up @@ -2559,7 +2559,7 @@
%
% Most often the second argument (before-date-code) will be empty.
% \begin{macrocode}
\long\def\IfTargetDateBefore#1{%
\DeclareRobustCommand\IfTargetDateBefore[1]{%
\ifnum\pkgcls@innerdate <%
\expandafter\@parse@version\expandafter0#1//00\@nil
\typeout{Exclude code introduced on #1}%
Expand Down
Loading

0 comments on commit 96832b8

Please sign in to comment.