summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/base/latex.ltx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/base/latex.ltx')
-rw-r--r--Master/texmf-dist/tex/latex/base/latex.ltx386
1 files changed, 369 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/base/latex.ltx b/Master/texmf-dist/tex/latex/base/latex.ltx
index 2d76c20aff3..95d8c046bcf 100644
--- a/Master/texmf-dist/tex/latex/base/latex.ltx
+++ b/Master/texmf-dist/tex/latex/base/latex.ltx
@@ -38,18 +38,18 @@
%% ltbibl.dtx (with options: `2ekernel')
%% ltpage.dtx (with options: `2ekernel')
%% ltoutput.dtx (with options: `2ekernel')
-%% ltclass.dtx (with options: `2ekernel')
+%% ltclass.dtx (with options: `2ekernel,tracerollback')
%% ltluatex.dtx (with options: `2ekernel')
%% ltfinal.dtx (with options: `2ekernel')
%%
%% This is a generated file.
%%
%% The source is maintained by the LaTeX Project team and bug
-%% reports for it can be opened at http://latex-project.org/bugs.html
+%% reports for it can be opened at https://latex-project.org/bugs.html
%% (but please observe conditions on bug reports sent to that address!)
%%
%%
-%% Copyright 1993-2016
+%% Copyright 1993-2018
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
%%
@@ -60,7 +60,7 @@
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
+%% 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.
%%
@@ -700,7 +700,7 @@
%%% From File: ltvers.dtx
\def\fmtname{LaTeX2e}
\edef\fmtversion
- {2017-04-15}
+ {2018-04-01}
\def\patch@level{0}
\iffalse
\def\reserved@a#1/#2/#3\@nil{%
@@ -744,7 +744,12 @@
\fi
\fi
\let\@currname\@empty
-\def\IncludeInRelease#1{\kernel@ifnextchar[%
+\def\IncludeInRelease#1{%
+ \if@includeinrelease
+ \PackageError{latexrelease}{mis-matched IncludeInRelease}{}%
+ \@includeinreleasefalse
+ \fi
+ \kernel@ifnextchar[%
{\@IncludeInRelease{#1}}
{\@IncludeInRelease{#1}[#1]}}
\def\@IncludeInRelease#1[#2]{\@IncludeInRele@se{#2}}
@@ -757,6 +762,7 @@
\expandafter\expandafter\expandafter\@gobble@IncludeInRelease
\else
\GenericInfo{}{Applying: \the\toks@}%
+ \@includeinreleasetrue
\expandafter\let\csname\string#2+\@currname+IIR\endcsname\@empty
\fi
\else
@@ -764,8 +770,21 @@
\expandafter\@gobble@IncludeInRelease
\fi
}
-\long\def\@gobble@IncludeInRelease#1\EndIncludeInRelease{}
-\let\EndIncludeInRelease\relax
+\def\EndIncludeInRelease{%
+\if@includeinrelease
+ \@includeinreleasefalse
+\else
+ \PackageError{latexrelease}{mis-matched EndIncludeInRelease}{}%
+\fi}
+\long\def\@gobble@IncludeInRelease#1\EndIncludeInRelease{%
+ \@includeinreleasefalse
+ \@check@IncludeInRelease#1\IncludeInRelease\@check@IncludeInRelease
+ \@end@check@IncludeInRelease}
+\long\def\@check@IncludeInRelease#1\IncludeInRelease
+ #2#3\@end@check@IncludeInRelease{%
+ \ifx\@check@IncludeInRelease#2\else
+ \PackageError{latexrelease}{skipped IncludeInRelease}{}%
+ \fi}
%%% From File: ltdefns.dtx
\def\two@digits#1{\ifnum#1<10 0\fi\number#1}
\def\typeout#1{\begingroup\set@display@protect
@@ -1034,11 +1053,30 @@
}%
}%
\def\@ifundefined#1{%
+ \ifcsname#1\endcsname\@ifundefin@d@i\else\@ifundefin@d@ii\fi{#1}}
+\long\def\@ifundefin@d@i#1\fi#2{\fi
+ \expandafter\ifx\csname #2\endcsname\relax
+ \@ifundefin@d@ii
+ \fi
+ \@secondoftwo}
+\long\def\@ifundefin@d@ii\fi#1#2#3{\fi #2}
+\ifx\numexpr\@undefined
+\def\@ifundefined#1{%
\expandafter\ifx\csname#1\endcsname\relax
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi}
+\else\ifx\directlua\@undefined
+\else
+\def\@ifundefined#1{%
+ \ifcsname#1\endcsname
+ \expandafter\ifx\lastnamedcs\relax\else\@ifundefin@d@i\fi
+ \fi
+ \@firstoftwo}
+\long\def\@ifundefin@d@i#1#2#3#4#5{#1#2#5}
+\fi
+\fi
\edef\@qend{\expandafter\@cdr\string\end\@nil}
\edef\@qrelax{\expandafter\@cdr\string\relax\@nil}
\long\def\@ifnextchar#1#2#3{%
@@ -1083,6 +1121,8 @@
}{}{}%
}
\let\@dischyph=\-
+\newif\if@includeinrelease
+\@includeinreleasefalse
%%% From File: ltalloc.dtx
\chardef\@xxxii=32
\mathchardef\@Mi=10001
@@ -2105,6 +2145,7 @@ Type H <return> for immediate help.}%
\egroup
}
%%% From File: ltcounts.dtx
+
\def\setcounter#1#2{%
\@ifundefined{c@#1}%
{\@nocounterr{#1}}%
@@ -2137,6 +2178,48 @@ Type H <return> for immediate help.}%
\gdef\csname the#1\expandafter\endcsname\expandafter
{\expandafter\@arabic\csname c@#1\endcsname}}
\def\@addtoreset#1#2{\expandafter\@cons\csname cl@#2\endcsname {{#1}}}
+\def\@removefromreset#1#2{%
+ \@ifundefined{c@#2}\relax
+ {\begingroup
+ \expandafter\let\csname c@#1\endcsname\@removefromreset
+ \def\@elt##1{%
+ \expandafter\ifx\csname c@##1\endcsname\@removefromreset
+ \else
+ \noexpand\@elt{##1}%
+ \fi}%
+ \expandafter\xdef\csname cl@#2\endcsname
+ {\csname cl@#2\endcsname}%
+ \endgroup}}
+
+\def\@ifbothcounters#1#2#3{%
+ \@ifundefined{c@#1}{\@nocounterr{#1}}%
+ {% else counter is defined
+ \@ifundefined{c@#2}{\@nocounterr{#2}}%
+ {% else both counter and within are defined
+ #3}}}
+
+\def\counterwithout {\@ifstar\counterwithout@s\counterwithout@x}
+\def\counterwithout@s#1#2{%
+ \@ifbothcounters{#1}{#2}{\@removefromreset{#1}{#2}}}
+\def\counterwithout@x#1#2{%
+ \@ifbothcounters{#1}{#2}%
+ {\@removefromreset{#1}{#2}%
+ \expandafter
+ \gdef\csname the#1\expandafter\endcsname\expandafter
+ {\expandafter
+ \@arabic\csname c@#1\endcsname}}}
+
+\def\counterwithin{\@ifstar\counterwithin@s\counterwithin@x}
+\def\counterwithin@s#1#2{%
+ \@ifbothcounters{#1}{#2}{\@addtoreset{#1}{#2}}}
+\def\counterwithin@x#1#2{%
+ \@ifbothcounters{#1}{#2}%
+ {\@addtoreset{#1}{#2}%
+ \expandafter
+ \gdef\csname the#1\expandafter\endcsname\expandafter
+ {\csname the#2\expandafter\endcsname\expandafter
+ \@arabic\csname c@#1\endcsname}}}
+
\def\arabic#1{\expandafter\@arabic\csname c@#1\endcsname}
\def\roman#1{\expandafter\@roman\csname c@#1\endcsname}
\def\Roman#1{\expandafter\@Roman\csname c@#1\endcsname}
@@ -6256,8 +6339,6 @@ Type H <return> for immediate help.}%
\DeclareRobustCommand*\textsubscript[1]{%
\@textsubscript{\selectfont#1}}%
\def\@textsubscript#1{%
- {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}%
-\def\@textsubscript#1{%
{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
\newdimen\footnotesep
\def\footnote{\@ifnextchar[\@xfootnote{\stepcounter\@mpfn
@@ -7580,8 +7661,8 @@ Type H <return> for immediate help.}%
\csname ver@#2.#1\endcsname}
\@onlypreamble\@ifl@ter
\def\@ifl@t@r#1#2{%
- \ifnum\expandafter\@parse@version#1//00\@nil<%
- \expandafter\@parse@version#2//00\@nil
+ \ifnum\expandafter\@parse@version\expandafter0#1//00\@nil<%
+ \expandafter\@parse@version\expandafter0#2//00\@nil
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
@@ -7872,7 +7953,7 @@ Type H <return> for immediate help.}%
\csname\@currname.\@currext-h@@k\endcsname
\expandafter\let\csname\@currname.\@currext-h@@k\endcsname
\@undefined
- \@unprocessedoptions}
+ \@unprocessedoptions}%
\@ifl@ter\@currext{#1}{#3}{}%
{\@latex@warning@no@line
{You have requested,\on@line,
@@ -7958,6 +8039,12 @@ Type H <return> for immediate help.}%
\@onlypreamble\@twoclasseserror
\def\two@digits#1{\ifnum#1<10 0\fi\number#1}
\begingroup%
+\@tempcnta=1
+\loop
+ \catcode\@tempcnta=12 %
+ \advance\@tempcnta\@ne %
+\ifnum\@tempcnta<32 %
+\repeat %
\catcode`\*=11 %
\catcode`\^^M\active%
\catcode`\^^L\active\let^^L\relax%
@@ -7991,6 +8078,12 @@ Type H <return> for immediate help.}%
\@percentchar\@percentchar}%
\fi%
\let\do\@makeother\dospecials%
+ \count@ 128\relax%
+ \loop%
+ \catcode\count@ 11\relax%
+ \advance\count@ \@ne%
+ \ifnum\count@<\@cclvi%
+ \repeat%
\edef\E{\@backslashchar end\string{\@currenvir\string}}%
\edef\reserved@b{%
\def\noexpand\reserved@b%
@@ -8044,6 +8137,198 @@ Type H <return> for immediate help.}%
\@onlypreamble\endfilecontents*
\endgroup
\@onlypreamble\filec@ntents
+\let\pkgcls@debug\@gobble
+\def\requestedLaTeXdate{0}
+\ifx\pkgcls@targetdate\@undefined
+ \newcount\pkgcls@targetdate
+\fi
+\let\pkgcls@targetlabel\@empty
+\def\pkgcls@innerdate{\maxdimen}
+
+\let\pkgcls@candidate\@empty
+\let\pkgcls@releasedate\@empty
+\ifx\load@onefilewithoptions\@undefined
+ \let\load@onefilewithoptions\@onefilewithoptions
+ \def\@onefilewithoptions#1[#2][#3]#4{%
+ \pkgcls@debug{--- File loaded request (\noexpand\usepackage or ...)}%
+ \pkgcls@debug{\@spaces 1: #1}%
+ \pkgcls@debug{\@spaces 2: #2}%
+ \pkgcls@debug{\@spaces 3: #3}%
+ \pkgcls@debug{\@spaces 4: #4}%
+ \def\pkgcls@name{#1}% % for info message
+ \def\pkgcls@arg {#3}% % for info message
+ \pkgcls@parse@date@arg{#3}%
+ \let\pkgcls@candidate\@empty
+ \load@onefilewithoptions#1[#2][\pkgcls@mindate]#4%
+ }
+\fi
+\def\pkgcls@parse@date@arg #1{%
+ \ifx\@nil#1\@nil
+ \pkgcls@targetdate\requestedLaTeXdate\relax
+ \let\pkgcls@targetlabel\@empty
+ \let\pkgcls@mindate\@empty
+ \else
+ \pkgcls@parse@date@arg@#1=\@nil\relax
+ \fi
+ }
+\def\pkgcls@parse@date@arg@#1=#2\@nil{%
+ \pkgcls@targetdate
+ \ifx\@nil#1\@nil
+ \@parse@version0#2//00\@nil\relax
+ \ifnum \pkgcls@targetdate=\z@
+ \pkgcls@targetdate\@ne
+ \def\pkgcls@innerdate{\maxdimen}%
+ \pkgcls@parse@date@arg@version#2%
+ \else
+ \edef\pkgcls@innerdate{\the\pkgcls@targetdate}%
+ \fi
+ \let\pkgcls@mindate\@empty
+ \else
+ \requestedLaTeXdate\relax
+ \let\pkgcls@targetlabel\@empty
+ \def\pkgcls@innerdate{\maxdimen}%
+ \def\pkgcls@mindate{#1}%
+ \ifnum \pkgcls@targetdate > \z@
+ \ifnum \@parse@version0#1//00\@nil > \pkgcls@targetdate
+ \@latex@error{Suspicious rollback/min-date date given}%
+ {There is a minimal date of #1 specified for
+ \@cls@pkg\space'\pkgcls@name'.\MessageBreak
+ But this is in conflict
+ with a rollback request to \requestedpatchdate,
+ so something\MessageBreak
+ is wrong here. Continue and I
+ ignore the minimal date request.}%
+ \fi
+ \fi
+ \fi
+}
+\def\pkgcls@parse@date@arg@version#1={%
+ \def\pkgcls@targetlabel{#1}}
+
+\def\DeclareRelease#1#2#3{%
+ \ifnum\pkgcls@targetdate>\z@ % some sort of rollback request
+ \pkgcls@debug{---\string\DeclareRelease:}%
+ \pkgcls@debug{\@spaces 1: #1}%
+ \pkgcls@debug{\@spaces 2: #2}%
+ \pkgcls@debug{\@spaces 3: #3}%
+ \ifx\@nil#2\@nil
+ \ifnum\pkgcls@targetdate=\@ne % named request
+ \def\reserved@a{#1}%
+ \ifx\pkgcls@targetlabel\reserved@a
+ \pkgcls@use@this@release{#3}{}%
+ \else
+ \pkgcls@debug{Label doesn't match}%
+ \fi
+ \else
+ \pkgcls@debug{Date request: ignored}%
+ \fi
+ \else
+ \ifnum\pkgcls@targetdate>\@ne % a real request
+ \ifnum\@parse@version#2//00\@nil
+ >\pkgcls@targetdate
+ \ifx\pkgcls@candidate\@empty
+ \pkgcls@rollbackdate@error{#2}%
+ \pkgcls@use@this@release{#3}{#2}%
+ \else
+ \pkgcls@use@this@release\pkgcls@candidate
+ \pkgcls@releasedate
+ \fi
+ \else
+ \def\pkgcls@candidate{#3}%
+ \def\pkgcls@releasedate{#2}%
+ \pkgcls@debug{New candidate: #3}%
+ \fi
+ \else
+ \def\reserved@a{#1}%
+ \ifx\pkgcls@targetlabel\reserved@a
+ \pkgcls@use@this@release{#3}{#2}%
+ \else
+ \pkgcls@debug{Label doesn't match}%
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+\def\pkgcls@use@this@release#1#2{%
+ \pkgcls@show@selection{#1}{#2}%
+ \pkgcls@targetdate\z@
+ \@@input #1\relax
+ \endinput
+}
+
+\def\pkgcls@show@selection#1#2{%
+ \pkgcls@debug{Result: use #1}%
+ \GenericInfo
+ {\@spaces\@spaces\space}{Rollback for
+ \@cls@pkg\space'\@currname' requested ->
+ \ifnum\pkgcls@targetdate>\@ne
+ date
+ \ifnum\requestedLaTeXdate=\pkgcls@targetdate
+ \requestedpatchdate
+ \else
+ \expandafter\@gobble\pkgcls@arg
+ \fi.\MessageBreak
+ Best approximation is
+ \else
+ version '\pkgcls@targetlabel'.\MessageBreak
+ This corresponds to
+ \fi
+ \ifx\@nil#2\@nil
+ a special release%
+ \else
+ the release introduced on #2%
+ \fi
+ \@gobble}%
+}
+
+\def\pkgcls@rollbackdate@error#1{%
+ \@latex@error{Suspicious rollback date given}%
+ {The \@cls@pkg\space'\@currname' claims that it
+ came into existence on #1 which\MessageBreak
+ is after your requested rollback date --- so
+ something is wrong here.\MessageBreak
+ Continue and we use the earliest known release.}}
+\def\DeclareCurrentRelease#1#2{%
+ \ifnum\pkgcls@targetdate>\z@ % some sort of rollback request
+ \pkgcls@debug{---DeclareCurrentRelease}%
+ \pkgcls@debug{ 1: #1}%
+ \pkgcls@debug{ 2: #2}%
+ \ifnum\pkgcls@targetdate>\@ne % a date request
+ \ifnum\@parse@version#2//00\@nil
+ >\pkgcls@targetdate
+
+ \ifx\pkgcls@candidate\@empty
+ \pkgcls@rollbackdate@error{#2}%
+ \else
+ \pkgcls@use@this@release\pkgcls@candidate
+ \pkgcls@releasedate
+ \fi
+ \else
+ \pkgcls@show@selection{current version}{#2}%
+ \fi
+ \else % a label request
+ \def\reserved@a{#1}%
+ \ifx\pkgcls@targetlabel\reserved@a
+ \pkgcls@show@selection{current version}{#2}%
+ \else
+ \@latex@error{Requested version '\pkgcls@targetlabel' for
+ \@cls@pkg\space'\@currname' is unknown}\@ehc
+ \fi
+ \fi
+ \fi
+}
+
+\long\def\IfTargetDateBefore#1{%
+ \ifnum\pkgcls@innerdate <%
+ \expandafter\@parse@version\expandafter0#1//00\@nil
+ \typeout{Exclude code introduced on #1}%
+ \expandafter\@firstoftwo
+ \else
+ \typeout{Include code introduced on #1}%
+ \expandafter\@secondoftwo
+ \fi
+}
%%% From File: ltluatex.dtx
\ifx\directlua\@undefined\else
\ifnum\luatexversion<60 %
@@ -8331,6 +8616,77 @@ Type H <return> for immediate help.}%
\errmessage{}
\def\font@submax{0pt}
\fi
+\ifnum0%
+ \ifx\Umathchar\@undefined\else 1\fi
+ \ifx\mubyte\@undefined\else 1\fi
+ \ifx\charsubdef\@undefined\else 1\fi
+ =\z@
+\def\saved@space@catcode{10}
+\let\@inpenc@test\relax
+\def\IeC{%
+ \ifx\protect\@typeset@protect
+ \expandafter\@firstofone
+ \else
+ \noexpand\IeC
+ \fi
+}
+\@tempcnta=1
+\loop
+ \catcode\@tempcnta=13 %
+ \advance\@tempcnta\@ne %
+\ifnum\@tempcnta<32 %
+\repeat %
+\catcode0=15 % null
+\catcode9=10 % tab
+\catcode10=12 % ctrl J
+\catcode12=13 % ctrl L
+\catcode13=5 % newline
+\@tempcnta=128
+\loop
+ \catcode\@tempcnta=13
+ \advance\@tempcnta\@ne
+\ifnum\@tempcnta<256
+\repeat
+\def\UseRawInputEncoding{%
+\let\DeclareFontEncoding@\DeclareFontEncoding@saved % revert
+\let\DeclareUnicodeCharacter\@undefined % revert
+\@tempcnta=1
+\loop
+ \catcode\@tempcnta=15 %
+ \advance\@tempcnta\@ne %
+\ifnum\@tempcnta<32 %
+\repeat %
+\catcode0=15 % null
+\catcode9=10 % tab
+\catcode10=12 % ctrl J
+\catcode12=13 % ctrl L
+\catcode13=5 % newline
+\@tempcnta=128
+\loop
+ \catcode\@tempcnta=12
+ \advance\@tempcnta\@ne
+\ifnum\@tempcnta<256
+\repeat
+}
+\let\DeclareFontEncoding@saved\DeclareFontEncoding@
+\edef\inputencodingname{utf8}%
+\input{utf8.def}
+\let\@inpenc@test\@undefined
+\let\saved@space@catcode\@undefined
+\else
+\@tempcnta=0
+\loop
+ \catcode\@tempcnta=15 %
+ \advance\@tempcnta\@ne %
+\ifnum\@tempcnta<32 %
+\repeat %
+\catcode0=15 % null
+\catcode9=10 % tab
+\catcode10=12 % ctrl J
+\catcode12=13 % ctrl L
+\catcode13=5 % newline
+\let\UseRawInputEncoding\relax
+\fi
\def\reserved@a#1#2{%
\@tempcnta#1\relax
\@tempcntb#2\relax
@@ -8370,10 +8726,6 @@ Type H <return> for immediate help.}%
\def\reserved@c#1{\catcode#1=11\relax}
\reserved@a{`\A}{`\Z}
\reserved@a{`\a}{`\z}
-\def\reserved@c#1{\catcode#1=15\relax}
-\reserved@a{0}{`\^^H}
-\reserved@c{`\^^K}
-\reserved@a{`\^^N}{31}
\ifnum 0%
\ifx\Umathcode\@undefined\else 1\fi
\ifx\XeTeXmathcode\@undefined\else 1\fi