diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/base/ltplain.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/base/ltplain.dtx | 467 |
1 files changed, 403 insertions, 64 deletions
diff --git a/Master/texmf-dist/source/latex/base/ltplain.dtx b/Master/texmf-dist/source/latex/base/ltplain.dtx index b12f44a725c..da1398c4538 100644 --- a/Master/texmf-dist/source/latex/base/ltplain.dtx +++ b/Master/texmf-dist/source/latex/base/ltplain.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2014 +% Copyright 1993-2015 % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltplain.dtx} - [2014/09/29 v1.1y LaTeX Kernel (Plain TeX)] + [2015/03/10 v2.0g LaTeX Kernel (Plain TeX)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltplain.dtx} @@ -43,13 +43,14 @@ Leslie Lamport, Frank Mittelbach,\\ Rainer Sch\"opf, David Carlisle} \date{\filedate} -\maketitle + \MaintainedByLaTeXTeam{latex} + \maketitle \DocInput{\filename} \end{document} %</driver> % \fi % -% \CheckSum{764} +% \CheckSum{1204} % % \changes{v1.0a}{1994/03/08} % {Remove need for a driver file.} @@ -72,6 +73,7 @@ % \changes{v1.1o}{1995/09/14}{Moved \cs{multispan} to lttab.dtx} % \changes{v1.1r}{1995/10/10}{Autoload tracing code} % \changes{v1.1u}{1996/10/28}{(CAR) More doc changes} +% \changes{v2.0e}{2015/02/21}{Removed autoload code} % % \section{Plain \TeX} % @@ -101,27 +103,9 @@ % % \StopEventually{} % -% \iffalse -%% \CharacterTable -%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} -%% -% \fi % % \begin{macrocode} -%<*2ekernel|autoload> +%<*2ekernel> \catcode`\{=1 % left brace is begin-group character \catcode`\}=2 % right brace is end-group character \catcode`\$=3 % dollar sign is math shift @@ -329,8 +313,9 @@ % \begin{macro}{\newskip} % \begin{macro}{\newmuskip} % \begin{macro}{\newbox} -% \begin{macro}{\newhelp} -% \begin{macro}{\newtoks} +% \begin{macro}{\newread} +% \begin{macro}{\newwrite} +% \begin{macro}{\newlanguage} % \changes{v1.0c}{1994/03/28} % {Remove some \cs{outer} declarations.} % \changes{v1.1h}{1995/04/24} @@ -349,15 +334,58 @@ % This is necessary to use |\newcount| inside |\if...| % later on. Also remove from |\newskip|, |\newbox| % |\newwrite| and |\newfam| (DPC) to save later redefinition. +% \changes{v2.0a}{2014/12/30}{New engine-specific allocation scheme (latexrelease)} +% \changes{v2.0f}{2015/03/02}{allow 255 math groups in Unicode engines} % \begin{macrocode} -\def\newcount{\alloc@0\count\countdef\insc@unt} -\def\newdimen{\alloc@1\dimen\dimendef\insc@unt} -\def\newskip{\alloc@2\skip\skipdef\insc@unt} -\def\newmuskip{\alloc@3\muskip\muskipdef\@cclvi} -\def\newbox{\alloc@4\box\chardef\insc@unt} -\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} -\def\newtoks{\alloc@5\toks\toksdef\@cclvi} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2015/01/01}% +%<latexrelease> {\newcount}{Extended Allocation}% +% \end{macrocode} +% +% \begin{macrocode} +\def\newcount {\e@alloc\count \countdef {\count10}\insc@unt\float@count} +\def\newdimen {\e@alloc\dimen \dimendef {\count11}\insc@unt\float@count} +\def\newskip {\e@alloc\skip \skipdef {\count12}\insc@unt\float@count} +\def\newmuskip + {\e@alloc\muskip\muskipdef{\count13}\e@alloc@top\e@alloc@top} +% \end{macrocode} +% For compatibility use |\chardef| in the classical range. +% \begin{macrocode} +\def\newbox {\e@alloc\box + {\ifnum\allocationnumber<\@cclvi + \expandafter\chardef + \else + \expandafter\e@alloc@chardef + \fi} + {\count14}\insc@unt\float@count} +\def\newtoks {\e@alloc\toks \toksdef{\count15}\e@alloc@top\e@alloc@top} +\def\newread {\e@alloc\read \chardef{\count16}\sixt@@n\sixt@@n} +\def\newwrite {\e@alloc\write \chardef{\count17}\sixt@@n\sixt@@n} +\def\new@mathgroup + {\e@alloc\mathgroup\chardef{\count18}\e@mathgroup@top\e@mathgroup@top} +\def\newlanguage {\e@alloc\language \chardef{\count19}\@cclvi\@cclvi} +\let\newfam\new@mathgroup +%</2ekernel|latexrelease> % \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\newcount}{Extended Allocation}% +%<latexrelease>\def\newcount{\alloc@0\count\countdef\insc@unt} +%<latexrelease>\def\newdimen{\alloc@1\dimen\dimendef\insc@unt} +%<latexrelease>\def\newskip{\alloc@2\skip\skipdef\insc@unt} +%<latexrelease>\def\newmuskip{\alloc@3\muskip\muskipdef\@cclvi} +%<latexrelease>\def\newbox{\alloc@4\box\chardef\insc@unt} +%<latexrelease>\def\newread{\alloc@6\read\chardef\sixt@@n} +%<latexrelease>\def\newwrite{\alloc@7\write\chardef\sixt@@n} +%<latexrelease>\def\new@mathgroup{\alloc@8\fam\chardef\sixt@@n} +%<latexrelease>\def\newlanguage{\alloc@9\language\chardef\@cclvi} +%<latexrelease>\let\newfam\new@mathgroup +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% \end{macro} % \end{macro} % \end{macro} % \end{macro} @@ -366,28 +394,231 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\newread} -% \begin{macro}{\newwrite} +%\begin{macro}{\e@alloc@chardef} +% \changes{v2.0a}{2014/12/30}{macro added} +%\begin{macro}{\e@alloc@top} +% \changes{v2.0a}{2014/12/30}{macro added} +% The upper limit of extended registers, which leaves +% this number (eg |\dimen32767|) always unallocated +% by these macros. +% cf traditional |\dimen255|. +% \begin{macrocode} +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2015/01/01}% +%<latexrelease> {\e@alloc@chardef}{Extended Allocation}% +% \end{macrocode} +% +% \begin{macrocode} +\ifx\directlua\@undefined + \ifx\widowpenalties\@undefined +% \end{macrocode} +% classic tex has $2^8$ registers. +% \begin{macrocode} + \mathchardef\e@alloc@top=255 + \let\e@alloc@chardef\chardef + \else +% \end{macrocode} +% etex and xetex have $2^{15}$ registers. +% \begin{macrocode} + \mathchardef\e@alloc@top=32767 + \let\e@alloc@chardef\mathchardef + \fi +\else +% \end{macrocode} +% luatex has $2^{16}$ registers. % \begin{macrocode} -\def\newread{\alloc@6\read\chardef\sixt@@n} -\def\newwrite{\alloc@7\write\chardef\sixt@@n} + \chardef\e@alloc@top=65535 + \let\e@alloc@chardef\chardef +\fi +% \end{macrocode} +% +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\e@alloc@chardef}{Extended Allocation}% +%<latexrelease>\let\e@alloc@top\@undefined +%<latexrelease>\let\e@alloc@chardef\@undefined +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} % -% \LaTeX\ defines |\newfam| in |ltfss.dtx|. -%\begin{verbatim} -%\def\newfam{\alloc@8\fam\chardef\sixt@@n} -%\end{verbatim} +%\begin{macro}{\e@mathgroup@top} +% \changes{v2.0f}{2015/03/02}{macro added} +% The upper limit of extended math groups (|\fam|) +% 16 in classic \TeX\ and e-\TeX, but 256 in Unicode TeX variants. +% \begin{macrocode} +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2015/01/01}% +%<latexrelease> {\e@mathgroup@top}{Extended Allocation}% +% \end{macrocode} +% +% \begin{macrocode} +\ifx\Umathcode\@undefined +% \end{macrocode} +% classic and e tex have 16 fam (0--15). +% \begin{macrocode} + \chardef\e@mathgroup@top=16 +\else +% \end{macrocode} +% xetex and luatex have 256 fam (0--255). +% \begin{macrocode} + \chardef\e@mathgroup@top=256 +\fi +% \end{macrocode} +% +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\e@mathgroup@top}{Extended Allocation}% +%<latexrelease>\let\e@mathgroup@top\@undefined +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\e@alloc} +% \changes{v2.0a}{2014/12/30}{macro added} +% A modified version of |\alloc@| that +% takes the count register rather than just the final digit of its number +% (assuming |\count|$1x$). +% It also has an extra argument to give the top of the extended range. +% +% | #1 #2 #3 #4 #5 #6 | +% +% | \e@alloc type defcmd current top extended-top newname| +% +% \begin{macrocode} +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2015/01/01}{\e@alloc}{Extended Allocation}% +% \end{macrocode} +% +% \begin{macrocode} +\def\e@alloc#1#2#3#4#5#6{% + \global\advance#3\@ne + \e@ch@ck{#3}#4#5#1% + \allocationnumber#3\relax + \global#2#6\allocationnumber + \wlog{\string#6=\string#1\the\allocationnumber}}% +% \end{macrocode} +% +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}{\e@alloc}{Extended Allocation}% +%<latexrelease>\let\e@alloc\@undefined +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% \end{macro} +% +%\begin{macro}{\e@ch@ck} +% \changes{v2.0a}{2014/12/30}{macro added} +% Extended check command. +% If the first range is exceeded, bump to 256 (or 266 for counts) +% and try again, testing the extended range. +%\begin{macro}{\extrafloats} +% \changes{v2.0a}{2014/12/30}{macro added} +% \changes{v2.0c}{2015/01/23}{reserve counts 256--265} +% Allocate matching registers from the top of the extended range +% and add to |\@freelist|. +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2015/01/01}{\e@ch@ck}{Extended Allocation}% +% \end{macrocode} +% +% \begin{macrocode} +\gdef\e@ch@ck#1#2#3#4{% + \ifnum#1<#2\else +% \end{macrocode} +% +% If we've reached the classical top limit, bump to 256 +% or 266 for counts (count 256--265 are reserved by the allocation +% system). +% \begin{macrocode} + \ifnum#1=#2\relax + #1\@cclvi + \ifx\count#4\advance#1 10 \fi + \fi +% \end{macrocode} +% Check we are below the extended limit. +% \begin{macrocode} + \ifnum#1<#3\relax + \else + \errmessage{No room for a new #4}% + \fi + \fi}% + +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\let\float@count\e@alloc@top +% \end{macrocode} +% +% \begin{macro}{\extrafloats} +% \begin{macrocode} +\ifx\numexpr\@undefined +% \end{macrocode} +% In classic TeX use |\newinsert| to allocate float boxes. +% \begin{macrocode} +\def\extrafloats#1{% +\count@#1\relax +\ifnum\count@>\z@ +\newinsert\reserved@a +\expandafter\chardef + \csname bx@\the\allocationnumber\endcsname\allocationnumber +\@cons\@freelist{\csname bx@\the\allocationnumber\endcsname}% +\advance\count@\m@ne +\expandafter\extrafloats +\expandafter\count@ +\fi +}% +% \end{macrocode} +% +% \begin{macrocode} +\else +% \end{macrocode} +% In e-tex take float boxes from the top of the extended range. +% \begin{macrocode} +\def\extrafloats#1{% +\ifnum#1>\z@ +\count@\numexpr\float@count-1\relax + \ch@ck0\count@\count + \ch@ck1\count@\dimen + \ch@ck2\count@\skip + \ch@ck4\count@\box +\e@alloc@chardef\float@count\count@ +\expandafter\e@alloc@chardef + \csname bx@\the\float@count\endcsname\float@count +\@cons\@freelist{\csname bx@\the\float@count\endcsname}% +\expandafter +\extrafloats\expandafter{\numexpr#1-1\relax}% +\fi}% +% \end{macrocode} +% +% \begin{macrocode} +\fi +% \end{macrocode} % -% \begin{macro}{\newlanguage} % \begin{macrocode} -\def\newlanguage{\alloc@9\language\chardef\@cclvi} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\e@ch@ck}{Extended Allocation}% +%<latexrelease>\let\e@ch@ck\@undefined +%<latexrelease>\let\float@count\@undefined +%<latexrelease>\let\extrafloats\@undefined +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\alloc@} % \begin{macrocode} +%<*2ekernel> \def\alloc@#1#2#3#4#5{\global\advance\count1#1\@ne \ch@ck#1#4#2% make sure there's still room \allocationnumber\count1#1% @@ -411,18 +642,22 @@ % % \begin{macro}{\ch@ck} % \begin{macrocode} -%</2ekernel|autoload> -%<*2ekernel|autoload|autoerr> \gdef\ch@ck#1#2#3{% \ifnum\count1#1<#2\else -%<!autoload> \errmessage{No room for a new #3}% -%<autoload> \@autoerr\ch@ck#1#2#3% + \errmessage{No room for a new #3}% \fi} -%</2ekernel|autoload|autoerr> -%<*2ekernel|autoload> % \end{macrocode} % \end{macro} % +% \begin{macro}{\newhelp} +% \begin{macro}{\newtoks} +% \begin{macrocode} +\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} +\def\newtoks{\alloc@5\toks\toksdef\@cclvi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}{\maxdimen} % \begin{macro}{\hideskip} % Here are some examples of allocation. @@ -1041,8 +1276,9 @@ % \begin{macrocode} \def\hrulefill{\leavevmode\leaders\hrule\hfill\kern\z@} % \end{macrocode} -% The box in |\dotfill| originally contained (in plain.tex): -% |\mkern 1.5mu .\mkern 1.5mu|; the width of .44em differs from this +% The box in |\dotfill| originally contained (in plain.tex):\\ +% |\mkern 1.5mu .\mkern 1.5mu|;\\ +% the width of .44em differs from this % by .04pt which is probably an acceptable difference within leaders. % \changes{v1.1u}{1996/10/28}{Removed math mode} % \changes{v1.1v}{1996/10/29}{Got arithmetic correct (CAR)} @@ -1095,13 +1331,10 @@ % \begin{macro}{\loggingoutput} % \changes{v1.1x}{2002/02/24}{Macro added} % \begin{macrocode} -%</2ekernel|autoload> -%<*2ekernel|autoerr> \gdef\loggingoutput{\tracingoutput\@ne \showboxbreadth\maxdimen\showboxdepth\maxdimen\errorstopmode} \gdef\showoutput{\loggingoutput\showoverfull} -%</2ekernel|autoerr> -%<autoload>\def\showoutput{\@autoerr\showoutput} +%</2ekernel> % \end{macrocode} % \end{macro} % \end{macro} @@ -1114,26 +1347,132 @@ % \changes{v1.1x}{2002/02/24}{Use newly added \cs{loggingoutput}} % \begin{macro}{\loggingall} % \changes{v1.1x}{2002/02/24}{Macro added} +% \changes{v2.0b}{2012/01/20}{etex tracing if available} +% \changes{v2.0d}{2015/02/20}{Spell commands correctly :-)} +% \changes{v2.0g}{2015/03/10}{Reorganise to be less noisy} +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2015/01/20}{\loggingall}{etex tracing}% +%<*2ekernel|latexrelease> +\ifx\tracingscantokens\@undefined +\gdef\loggingall{% + \tracingstats\tw@ + \tracingpages\@ne + \tracinglostchars\@ne + \tracingparagraphs\@ne + \errorcontextlines\maxdimen + \loggingoutput + \tracingmacros\tw@ + \tracingcommands\tw@ + \tracingrestores\@ne + }% +\else +\gdef\loggingall{% + \tracingstats\tw@ + \tracingpages\@ne + \tracinglostchars\tw@ + \tracingparagraphs\@ne + \tracinggroups\@ne + \tracingifs\@ne + \tracingscantokens\@ne + \tracingnesting\@ne + \errorcontextlines\maxdimen + \loggingoutput + \tracingmacros\tw@ + \tracingcommands\thr@@ + \tracingrestores\@ne + \tracingassigns\@ne +}% +\fi +\gdef\tracingall{\showoverfull\loggingall} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}{\loggingall}{etex tracing}% +%<latexrelease>\gdef\loggingall{\tracingcommands\tw@\tracingstats\tw@ +%<latexrelease> \tracingpages\@ne\tracinglostchars\@ne +%<latexrelease> \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\@ne +%<latexrelease> \errorcontextlines\maxdimen\loggingoutput} +%<latexrelease> \gdef\tracingall{\loggingall\showoverfull} +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\tracingnone} +% \changes{v2.0g}{2015/03/10}{macro added} +% \begin{macro}{\hideoutput} +% \changes{v2.0g}{2015/03/10}{macro added} +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2015/01/20}{\tracingnone}% +%<latexrelease> {turn off etex tracing}% +%<*2ekernel|latexrelease> +\ifx\tracingscantokens\@undefined +\def\tracingnone{% + \tracingonline\z@ + \tracingcommands\z@ + \showboxdepth\m@ne + \showboxbreadth\m@ne + \tracingoutput\z@ + \errorcontextlines\m@ne + \tracingrestores\z@ + \tracingparagraphs\z@ + \tracingmacros\z@ + \tracinglostchars\@ne + \tracingpages\z@ + \tracingstats\z@ +}% +\else +\def\tracingnone{% + \tracingassigns\z@ + \tracingrestores\z@ + \tracingonline\z@ + \tracingcommands\z@ + \showboxdepth\m@ne + \showboxbreadth\m@ne + \tracingoutput\z@ + \errorcontextlines\m@ne + \tracingnesting\z@ + \tracingscantokens\z@ + \tracingifs\z@ + \tracinggroups\z@ + \tracingparagraphs\z@ + \tracingmacros\z@ + \tracinglostchars\@ne + \tracingpages\z@ + \tracingstats\z@ +}% +\fi +% \end{macrocode} +% % \begin{macrocode} -%<*2ekernel|autoerr> -\gdef\loggingall{\tracingcommands\tw@\tracingstats\tw@ - \tracingpages\@ne\tracinglostchars\@ne - \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\@ne - \errorcontextlines\maxdimen\loggingoutput} -\gdef\tracingall{\loggingall\showoverfull} -%</2ekernel|autoerr> -%<autoload>\def\tracingall{\@autoerr\tracingall} +\def\hideoutput{% + \tracingoutput\z@ + \showboxbreadth\m@ne + \showboxdepth\m@ne + \tracingonline\m@ne +}% +% \end{macrocode} +% +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}{\tracingnone}% +%<latexrelease> {turn off etex tracing}% +%<latexrelease>\let\tracingnone\@undefined +%<latexrelease>\let\hideoutput\@undefined +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} % +% % \LaTeX\ change: |\showhyphens| Defined later. % % Punctuation affects the spacing. % \begin{macrocode} -%<*2ekernel|autoload> +%<*2ekernel> \nonfrenchspacing -%</2ekernel|autoload> +%</2ekernel> % \end{macrocode} % % |