From a4824d556273f90fbb37d24449cca150397ab7f2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 21 Jul 2020 21:39:07 +0000 Subject: latex-dev (21jul20) git-svn-id: svn://tug.org/texlive/trunk@55898 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex-dev/base/doc.sty | 3 +- Master/texmf-dist/tex/latex-dev/base/docstrip.tex | 49 +- .../texmf-dist/tex/latex-dev/base/filehook-ltx.sty | 101 ++ Master/texmf-dist/tex/latex-dev/base/latex.ltx | 372 +++---- .../texmf-dist/tex/latex-dev/base/latexrelease.sty | 410 +++++++- Master/texmf-dist/tex/latex-dev/base/ltexpl.ltx | 95 +- .../texmf-dist/tex/latex-dev/base/ltfilehook.ltx | 343 ++++++ Master/texmf-dist/tex/latex-dev/base/lthooks.ltx | 1091 ++++++++++++++++++++ Master/texmf-dist/tex/latex-dev/base/lthooks.sty | 67 ++ Master/texmf-dist/tex/latex-dev/base/ltluatex.tex | 8 +- Master/texmf-dist/tex/latex-dev/base/ltnews.cls | 4 + Master/texmf-dist/tex/latex-dev/base/ltshipout.ltx | 424 ++++++++ Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls | 11 +- Master/texmf-dist/tex/latex-dev/base/shortvrb.sty | 2 +- .../texmf-dist/tex/latex-dev/base/srclfile-ltx.sty | 65 ++ .../tex/latex-dev/base/structuredlog.sty | 72 ++ Master/texmf-dist/tex/latex-dev/base/tuenc.def | 53 +- .../texmf-dist/tex/latex-dev/graphics/lscape.sty | 6 +- Master/texmf-dist/tex/latex-dev/tools/array.sty | 10 +- Master/texmf-dist/tex/latex-dev/tools/varioref.sty | 59 +- Master/texmf-dist/tex/latex-dev/tools/verbatim.sty | 10 +- 21 files changed, 2979 insertions(+), 276 deletions(-) create mode 100644 Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty create mode 100644 Master/texmf-dist/tex/latex-dev/base/ltfilehook.ltx create mode 100644 Master/texmf-dist/tex/latex-dev/base/lthooks.ltx create mode 100644 Master/texmf-dist/tex/latex-dev/base/lthooks.sty create mode 100644 Master/texmf-dist/tex/latex-dev/base/ltshipout.ltx create mode 100644 Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty create mode 100644 Master/texmf-dist/tex/latex-dev/base/structuredlog.sty (limited to 'Master/texmf-dist/tex/latex-dev') diff --git a/Master/texmf-dist/tex/latex-dev/base/doc.sty b/Master/texmf-dist/tex/latex-dev/base/doc.sty index 94b1a9754f2..417340cebc9 100644 --- a/Master/texmf-dist/tex/latex-dev/base/doc.sty +++ b/Master/texmf-dist/tex/latex-dev/base/doc.sty @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{doc} - [2019/12/16 v2.1l + [2020/06/15 v2.1m Standard LaTeX documentation package (FMi)] %% %% Package `doc' to use with LaTeX 2e @@ -59,6 +59,7 @@ \@beginparpenalty \predisplaypenalty \if@inlabel\leavevmode\fi \trivlist \parskip \z@ \item[]% + \global\setbox\@labels\box\voidb@x \macro@font \leftskip\@totalleftmargin \advance\leftskip\MacroIndent \rightskip\z@ \parindent\z@ \parfillskip\@flushglue diff --git a/Master/texmf-dist/tex/latex-dev/base/docstrip.tex b/Master/texmf-dist/tex/latex-dev/base/docstrip.tex index 127c7c6e371..e670198de27 100644 --- a/Master/texmf-dist/tex/latex-dev/base/docstrip.tex +++ b/Master/texmf-dist/tex/latex-dev/base/docstrip.tex @@ -44,9 +44,9 @@ \catcode`\{=1 \catcode`\}=2 \def\filename{docstrip.dtx} -\def\fileversion{v2.5h} -\def\filedate{2020/04/18} -\def\docdate {2018/05/03} +\def\fileversion{v2.6a} +\def\filedate{2020-07-07} +\def\docdate {2020-07-11} %% %% The docstrip program for use with TeX. %% Copyright (C) 1989-1991 Frank Mittelbach @@ -54,7 +54,7 @@ %% Frank Mittelbach %% Copyright (C) 1995 Marcin Woli\'nski %% Copyright (C) 1996-1997 Mark Wooding, Marcin Woli\'nski -%% Copyright (C) 1998-2003 LaTeX3 project and the above authors +%% Copyright (C) 1998-2020 LaTeX3 project and the above authors %% All rights are reserved. %% \catcode`\Z=\catcode`\% @@ -356,6 +356,7 @@ Z \advance\codeLinesPassed\@ne \maybeMsg{.}% \def\inLine{#1}% + \replaceModuleInLine \let\do\putline@do \activefiles } @@ -397,19 +398,23 @@ Z \ifcase \ifx*#10\else \ifx/#11\else \ifx+#12\else \ifx-#13\else - \ifx<#14\else 5\fi\fi\fi\fi\fi\relax + \ifx<#14\else \ifx @#15\else 6\fi\fi\fi\fi\fi\fi\relax \expandafter\starOption\or \expandafter\slashOption\or \expandafter\plusOption\or \expandafter\minusOption\or \expandafter\verbOption\or + \expandafter\moduleOption\or \expandafter\doOption\fi #1} \def\doOption#1>#2\endLine{% \maybeMsg{<#1 . >}% \Evaluate{#1}% \def\do##1##2##3{% - \if1\Expr{##2}\StreamPut##1{#2}\fi + \if1\Expr{##2}% + \def\inLine{#2}% + \replaceModuleInLine + \StreamPut##1{\inLine}\fi }% \activefiles } @@ -485,6 +490,38 @@ Z \repeat \maybeMsg{>}% }} +\def\moduleOption @@=#1>#2\endLine{% + \maybeMsg{<@@=#1>}% + \prepareActiveModule{#1}% +} +\begingroup + \catcode`\_ = 12 % + \long\gdef\prepareActiveModule#1{% + \ifx\relax#1\relax + \let\replaceModuleInLine\empty + \else + \edef\replaceModuleInLine{% + \noexpand\replaceAllIn\noexpand\inLine{@@@@}{\string aa}% + \noexpand\replaceAllIn\noexpand\inLine{__@@}{__#1}% + \noexpand\replaceAllIn\noexpand\inLine{_@@}{__#1}% + \noexpand\replaceAllIn\noexpand\inLine{@@}{__#1}% + \noexpand\replaceAllIn\noexpand\inLine{\string aa}{@@}% + }% + \fi + } +\endgroup +\let\replaceModuleInLine\empty +\long\def\replaceAllIn#1#2#3{% + \long\def\tempa##1##2#2{% + ##2\qMark\replaceAllInAuxIII#3##1% + }% + \edef#1{\expandafter\replaceAllInAuxI#1\qMark#2\qStop}% +} +\def\replaceAllInAuxI{% + \expandafter\replaceAllInAuxII\tempa\replaceAllInAuxI\empty +} +\long\def\replaceAllInAuxII#1\qMark#2{#1} +\long\def\replaceAllInAuxIII#1\qStop{} \def\generate#1{\begingroup \let\inputfiles\empty \let\filestogenerate\empty \let\file\@file diff --git a/Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty new file mode 100644 index 00000000000..5ee890ae506 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty @@ -0,0 +1,101 @@ +%% +%% This is file `filehook-ltx.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ltfilehook.dtx (with options: `filehook-draft') +%% +%% This is a generated file. +%% +%% Copyright 2020 Frank Mittelbach +%% +%% This file was generated from file(s) of the LaTeX `lthooks Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% 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 +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `lthooks Bundle'. You may however distribute the `lthooks Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/FrankMittelbach/fmitex/ +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team +\providecommand\ltfilehookversion{v0.9a} +\providecommand\ltfilehookdate{2020/07/19} +\newcommand\AtBeginOfEveryFile [1] + {\AddToHook{file/before}{#1}} +\newcommand\AtEndOfEveryFile [1] + {\AddToHook{file/after}{#1}} +\newcommand\AtBeginOfIncludes [1] + {\AddToHook{include/before}{#1}} +\newcommand\AtEndOfIncludes [1] + {\AddToHook{include/end}{#1}} +\newcommand\AfterIncludes [1] + {\AddToHook{include/after}{#1}} +\newcommand\AtBeginOfPackages [1] + {\AddToHook{package/before}{#1}} +\newcommand\AtEndOfPackages [1] + {\AddToHook{package/after}{#1}} +\newcommand\AtBeginOfClasses [1] + {\AddToHook{class/before}{#1}} +\newcommand\AtEndOfClasses [1] + {\AddToHook{class/after}{#1}} +\newcommand\AtBeginOfFile [2] + {\AddToHook{file/before/#1}{#2}} +\newcommand\AtEndOfFile [2] + {\AddToHook{file/after/#1}{#2}} +\DeclareDocumentCommand \AtBeginOfPackageFile {smm} + {\IfBooleanTF{#1}% + {\@ifpackageloaded{#2}% + {#3}% + {\AddToHook{package/before/#2}{#3}}}% + {\AddToHook{package/before/#2}{#3}}% + } +\DeclareDocumentCommand \AtEndOfPackageFile {smm} + {\IfBooleanTF{#1}% + {\@ifpackageloaded{#2}% + {#3}% + {\AddToHook{package/after/#2}{#3}}}% + {\AddToHook{package/after/#2}{#3}}% + } +\DeclareDocumentCommand \AtBeginOfClassFile {smm} + {\IfBooleanTF{#1}% + {\@ifclassloaded{#2}% + {#3}% + {\AddToHook{class/before/#2}{#3}}}% + {\AddToHook{class/before/#2}{#3}}% + } +\DeclareDocumentCommand \AtEndOfClassFile {smm} + {\IfBooleanTF{#1}% + {\@ifclassloaded{#2}% + {#3}% + {\AddToHook{class/after/#2}{#3}}}% + {\AddToHook{class/after/#2}{#3}}% + } +\newcommand\AtBeginOfIncludeFile [2] + {\AddToHook{include/before/#1}{#2}} +\newcommand\AtEndOfIncludeFile [2] + {\AddToHook{include/end/#1}{#2}} +\newcommand\AfterIncludeFile [2] + {\AddToHook{include/after/#1}{#2}} +\expandafter\let\csname ver@filehook.sty\endcsname\fmtversion +\@namedef {ver@filehook.sty}{2020/10/01} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%% +%% End of file `filehook-ltx.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/base/latex.ltx b/Master/texmf-dist/tex/latex-dev/base/latex.ltx index fa463159956..67fea591af3 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latex.ltx +++ b/Master/texmf-dist/tex/latex-dev/base/latex.ltx @@ -7,6 +7,7 @@ %% ltdirchk.dtx (with options: `initex,2ekernel,dircheck') %% ltplain.dtx (with options: `2ekernel') %% ltvers.dtx (with options: `2ekernel') +%% ltluatex.dtx (with options: `2ekernel') %% ltdefns.dtx (with options: `2ekernel') %% ltalloc.dtx (with options: `2ekernel') %% ltcntrl.dtx (with options: `2ekernel') @@ -41,7 +42,6 @@ %% ltpage.dtx (with options: `2ekernel') %% ltoutput.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. @@ -710,7 +710,7 @@ \def\fmtname{LaTeX2e} \edef\fmtversion {2020-10-01} -\def\patch@level{-6} +\def\patch@level{-7} \edef\development@branch@name{develop \the\year-\the\month-\the\day} \iffalse \def\reserved@a#1/#2/#3\@nil{% @@ -808,7 +808,182 @@ \ifx\@check@IncludeInRelease#2\else \PackageError{latexrelease}{skipped IncludeInRelease for tag \string#2}{}% \fi} +%%% From File: ltluatex.dtx +\ifx\directlua\@undefined\else +\ifnum\luatexversion<60 % + \wlog{***************************************************} + \wlog{* LuaTeX version too old for ltluatex support *} + \wlog{***************************************************} + \expandafter\endinput +\fi +\long\def\@gobble#1{} +\long\def\@firstofone#1{#1} +\ifx\e@alloc@attribute@count\@undefined + \countdef\e@alloc@attribute@count=258 +\fi +\def\newattribute#1{% + \e@alloc\attribute\attributedef + \e@alloc@attribute@count\m@ne\e@alloc@top#1% +} +\e@alloc@attribute@count=\z@ +\def\setattribute#1#2{#1=\numexpr#2\relax} +\def\unsetattribute#1{#1=-"7FFFFFFF\relax} +\ifx\e@alloc@ccodetable@count\@undefined + \countdef\e@alloc@ccodetable@count=259 +\fi +\def\newcatcodetable#1{% + \e@alloc\catcodetable\chardef + \e@alloc@ccodetable@count\m@ne{"8000}#1% + \initcatcodetable\allocationnumber +} +\e@alloc@ccodetable@count=\z@ +\newcatcodetable\catcodetable@initex +\newcatcodetable\catcodetable@string +\begingroup + \def\setrangecatcode#1#2#3{% + \ifnum#1>#2 % + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi + {% + \catcode#1=#3 % + \expandafter\setrangecatcode\expandafter + {\number\numexpr#1 + 1\relax}{#2}{#3} + }% + } + \@firstofone{% + \catcodetable\catcodetable@initex + \catcode0=12 % + \catcode13=12 % + \catcode37=12 % + \setrangecatcode{65}{90}{12}% + \setrangecatcode{97}{122}{12}% + \catcode92=12 % + \catcode127=12 % + \savecatcodetable\catcodetable@string + \endgroup + }% +\newcatcodetable\catcodetable@latex +\newcatcodetable\catcodetable@atletter +\begingroup + \def\parseunicodedataI#1;#2;#3;#4\relax{% + \parseunicodedataII#1;#3;#2 First>\relax + }% + \def\parseunicodedataII#1;#2;#3 First>#4\relax{% + \ifx\relax#4\relax + \expandafter\parseunicodedataIII + \else + \expandafter\parseunicodedataIV + \fi + {#1}#2\relax% + }% + \def\parseunicodedataIII#1#2#3\relax{% + \ifnum 0% + \if L#21\fi + \if M#21\fi + >0 % + \catcode"#1=11 % + \fi + }% + \def\parseunicodedataIV#1#2#3\relax{% + \read\unicoderead to \unicodedataline + \if L#2% + \count0="#1 % + \expandafter\parseunicodedataV\unicodedataline\relax + \fi + }% + \def\parseunicodedataV#1;#2\relax{% + \loop + \unless\ifnum\count0>"#1 % + \catcode\count0=11 % + \advance\count0 by 1 % + \repeat + }% + \def\storedpar{\par}% + \chardef\unicoderead=\numexpr\count16 + 1\relax + \openin\unicoderead=UnicodeData.txt % + \loop\unless\ifeof\unicoderead % + \read\unicoderead to \unicodedataline + \unless\ifx\unicodedataline\storedpar + \expandafter\parseunicodedataI\unicodedataline\relax + \fi + \repeat + \closein\unicoderead + \@firstofone{% + \catcode64=12 % + \savecatcodetable\catcodetable@latex + \catcode64=11 % + \savecatcodetable\catcodetable@atletter + } +\endgroup +\ifx\e@alloc@luafunction@count\@undefined + \countdef\e@alloc@luafunction@count=260 +\fi +\def\newluafunction{% + \e@alloc\luafunction\e@alloc@chardef + \e@alloc@luafunction@count\m@ne\e@alloc@top +} +\e@alloc@luafunction@count=\z@ +\ifx\e@alloc@whatsit@count\@undefined + \countdef\e@alloc@whatsit@count=261 +\fi +\def\newwhatsit#1{% + \e@alloc\whatsit\e@alloc@chardef + \e@alloc@whatsit@count\m@ne\e@alloc@top#1% +} +\e@alloc@whatsit@count=\z@ +\ifx\e@alloc@bytecode@count\@undefined + \countdef\e@alloc@bytecode@count=262 +\fi +\def\newluabytecode#1{% + \e@alloc\luabytecode\e@alloc@chardef + \e@alloc@bytecode@count\m@ne\e@alloc@top#1% +} +\e@alloc@bytecode@count=\z@ + +\ifx\e@alloc@luachunk@count\@undefined + \countdef\e@alloc@luachunk@count=263 +\fi +\def\newluachunkname#1{% + \e@alloc\luachunk\e@alloc@chardef + \e@alloc@luachunk@count\m@ne\e@alloc@top#1% + {\escapechar\m@ne + \directlua{lua.name[\the\allocationnumber]="\string#1"}}% +} +\e@alloc@luachunk@count=\z@ +\everyjob\expandafter{% + \the\everyjob + \begingroup + \attributedef\attributezero=0 % + \chardef \charzero =0 % + \countdef \CountZero =0 % + \dimendef \dimenzero =0 % + \mathchardef \mathcharzero =0 % + \muskipdef \muskipzero =0 % + \skipdef \skipzero =0 % + \toksdef \tokszero =0 % + \directlua{require("ltluatex")} + \endgroup +} +\everyjob\expandafter{% + \the\everyjob + \directlua{% + if xpcall(function ()% + require('luaotfload-main')% + end,texio.write_nl) then % + local _void = luaotfload.main ()% + else % + texio.write_nl('Error in luaotfload: reverting to OT1')% + tex.print('\string\\def\string\\encodingdefault{OT1}')% + end % + }% + \let\f@encoding\encodingdefault + \expandafter\let\csname ver@luaotfload.sty\endcsname\fmtversion + } +\fi %%% From File: ltdefns.dtx +\input ltexpl.ltx \def\two@digits#1{\ifnum#1<10 0\fi\number#1} \protected\long\def\typeout#1{\begingroup \set@display@protect @@ -1726,6 +1901,7 @@ Type H for immediate help.}% \newcount\@clubpenalty \@clubpenalty \clubpenalty \def\document{\endgroup + \@expl@sys@load@backend@@ \ifx\@unusedoptionlist\@empty\else \@latex@warning@no@line{Unused global option(s):^^J% \@spaces[\@unusedoptionlist]}% @@ -5776,14 +5952,17 @@ Type H for immediate help.}% \DeclareRobustCommand\centering{% \let\\\@centercr \rightskip\@flushglue\leftskip\@flushglue + \finalhyphendemerits=\z@ \parindent\z@\parfillskip\z@skip} \DeclareRobustCommand\raggedright{% \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip + \finalhyphendemerits=\z@ \leftskip\z@skip \parindent\z@} \DeclareRobustCommand\raggedleft{% \let\\\@centercr \rightskip\z@skip\leftskip\@flushglue + \finalhyphendemerits=\z@ \parindent\z@\parfillskip\z@skip} \newskip\@rightskip \@rightskip \z@skip \def\flushleft{\trivlist \raggedright\item\relax} @@ -9180,13 +9359,16 @@ Type H for immediate help.}% \@onlypreamble\@clsextension \@onlypreamble\@pkgextension \def\@pushfilename{% + \@expl@push@filename@@ \xdef\@currnamestack{% {\@currname}% {\@currext}% {\the\catcode`\@}% - \@currnamestack}} + \@currnamestack}% + \@expl@push@filename@aux@@} \@onlypreamble\@pushfilename -\def\@popfilename{\expandafter\@p@pfilename\@currnamestack\@nil} +\def\@popfilename{\expandafter\@p@pfilename\@currnamestack\@nil + \@expl@pop@filename@@} \@onlypreamble\@popfilename \def\@p@pfilename#1#2#3#4\@nil{% \gdef\@currname{#1}% @@ -9952,178 +10134,6 @@ Type H for immediate help.}% \expandafter\@secondoftwo \fi } -%%% From File: ltluatex.dtx -\ifx\directlua\@undefined\else -\ifnum\luatexversion<60 % - \wlog{***************************************************} - \wlog{* LuaTeX version too old for ltluatex support *} - \wlog{***************************************************} - \expandafter\endinput -\fi -\ifx\e@alloc@attribute@count\@undefined - \countdef\e@alloc@attribute@count=258 -\fi -\def\newattribute#1{% - \e@alloc\attribute\attributedef - \e@alloc@attribute@count\m@ne\e@alloc@top#1% -} -\e@alloc@attribute@count=\z@ -\def\setattribute#1#2{#1=\numexpr#2\relax} -\def\unsetattribute#1{#1=-"7FFFFFFF\relax} -\ifx\e@alloc@ccodetable@count\@undefined - \countdef\e@alloc@ccodetable@count=259 -\fi -\def\newcatcodetable#1{% - \e@alloc\catcodetable\chardef - \e@alloc@ccodetable@count\m@ne{"8000}#1% - \initcatcodetable\allocationnumber -} -\e@alloc@ccodetable@count=\z@ -\newcatcodetable\catcodetable@initex -\newcatcodetable\catcodetable@string -\begingroup - \def\setrangecatcode#1#2#3{% - \ifnum#1>#2 % - \expandafter\@gobble - \else - \expandafter\@firstofone - \fi - {% - \catcode#1=#3 % - \expandafter\setrangecatcode\expandafter - {\number\numexpr#1 + 1\relax}{#2}{#3} - }% - } - \@firstofone{% - \catcodetable\catcodetable@initex - \catcode0=12 % - \catcode13=12 % - \catcode37=12 % - \setrangecatcode{65}{90}{12}% - \setrangecatcode{97}{122}{12}% - \catcode92=12 % - \catcode127=12 % - \savecatcodetable\catcodetable@string - \endgroup - }% -\newcatcodetable\catcodetable@latex -\newcatcodetable\catcodetable@atletter -\begingroup - \def\parseunicodedataI#1;#2;#3;#4\relax{% - \parseunicodedataII#1;#3;#2 First>\relax - }% - \def\parseunicodedataII#1;#2;#3 First>#4\relax{% - \ifx\relax#4\relax - \expandafter\parseunicodedataIII - \else - \expandafter\parseunicodedataIV - \fi - {#1}#2\relax% - }% - \def\parseunicodedataIII#1#2#3\relax{% - \ifnum 0% - \if L#21\fi - \if M#21\fi - >0 % - \catcode"#1=11 % - \fi - }% - \def\parseunicodedataIV#1#2#3\relax{% - \read\unicoderead to \unicodedataline - \if L#2% - \count0="#1 % - \expandafter\parseunicodedataV\unicodedataline\relax - \fi - }% - \def\parseunicodedataV#1;#2\relax{% - \loop - \unless\ifnum\count0>"#1 % - \catcode\count0=11 % - \advance\count0 by 1 % - \repeat - }% - \def\storedpar{\par}% - \chardef\unicoderead=\numexpr\count16 + 1\relax - \openin\unicoderead=UnicodeData.txt % - \loop\unless\ifeof\unicoderead % - \read\unicoderead to \unicodedataline - \unless\ifx\unicodedataline\storedpar - \expandafter\parseunicodedataI\unicodedataline\relax - \fi - \repeat - \closein\unicoderead - \@firstofone{% - \catcode64=12 % - \savecatcodetable\catcodetable@latex - \catcode64=11 % - \savecatcodetable\catcodetable@atletter - } -\endgroup -\ifx\e@alloc@luafunction@count\@undefined - \countdef\e@alloc@luafunction@count=260 -\fi -\def\newluafunction{% - \e@alloc\luafunction\e@alloc@chardef - \e@alloc@luafunction@count\m@ne\e@alloc@top -} -\e@alloc@luafunction@count=\z@ -\ifx\e@alloc@whatsit@count\@undefined - \countdef\e@alloc@whatsit@count=261 -\fi -\def\newwhatsit#1{% - \e@alloc\whatsit\e@alloc@chardef - \e@alloc@whatsit@count\m@ne\e@alloc@top#1% -} -\e@alloc@whatsit@count=\z@ -\ifx\e@alloc@bytecode@count\@undefined - \countdef\e@alloc@bytecode@count=262 -\fi -\def\newluabytecode#1{% - \e@alloc\luabytecode\e@alloc@chardef - \e@alloc@bytecode@count\m@ne\e@alloc@top#1% -} -\e@alloc@bytecode@count=\z@ - -\ifx\e@alloc@luachunk@count\@undefined - \countdef\e@alloc@luachunk@count=263 -\fi -\def\newluachunkname#1{% - \e@alloc\luachunk\e@alloc@chardef - \e@alloc@luachunk@count\m@ne\e@alloc@top#1% - {\escapechar\m@ne - \directlua{lua.name[\the\allocationnumber]="\string#1"}}% -} -\e@alloc@luachunk@count=\z@ -\everyjob\expandafter{% - \the\everyjob - \begingroup - \attributedef\attributezero=0 % - \chardef \charzero =0 % - \countdef \CountZero =0 % - \dimendef \dimenzero =0 % - \mathchardef \mathcharzero =0 % - \muskipdef \muskipzero =0 % - \skipdef \skipzero =0 % - \toksdef \tokszero =0 % - \directlua{require("ltluatex")} - \endgroup -} -\everyjob\expandafter{% - \the\everyjob - \directlua{% - if xpcall(function ()% - require('luaotfload-main')% - end,texio.write_nl) then % - local _void = luaotfload.main ()% - else % - texio.write_nl('Error in luaotfload: reverting to OT1')% - tex.print('\string\\def\string\\encodingdefault{OT1}')% - end % - }% - \let\f@encoding\encodingdefault - \expandafter\let\csname ver@luaotfload.sty\endcsname\fmtversion - } -\fi %%% From File: ltfinal.dtx \tracingstats1 \newcount\@lowpenalty @@ -10209,6 +10219,8 @@ Type H for immediate help.}% \lccode 127=127 % alternate hyphen char \lccode 23 =23 % textcompwordmark in T1 \fi +\@expl@finalise@setup@@ +\def\@expl@finalise@setup@@{} \ifx\XeTeXuseglyphmetrics\@undefined \else \XeTeXuseglyphmetrics=1 % @@ -10422,7 +10434,6 @@ Type H for immediate help.}% \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\th\TH} \protected@edef\MakeUppercase#1{\MakeUppercase{#1}} \protected@edef\MakeLowercase#1{\MakeLowercase{#1}} -\input{ltexpl.ltx} \let\reserved@a\@filelist \let\reserved@b=\@undefined \let\reserved@c=\@undefined @@ -10441,7 +10452,12 @@ Type H for immediate help.}% \endgroup} \let\@filelist\@gobble \def\@addtofilelist#1{\xdef\@filelist{\@filelist,#1}}% -\AtBeginDocument{\reinstall@nfss@defs\init@series@setup} +\input lthooks.ltx +\input ltshipout.ltx +\input ltfilehook.ltx + +\g@addto@macro\@kernel@after@env@document@begin + {\reinstall@nfss@defs\init@series@setup} \makeatother \errorstopmode \dump diff --git a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty index 11831f0601c..b5ac7332d94 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty +++ b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty @@ -1182,6 +1182,64 @@ of this package available from CTAN} \let\noprotrusion\@undefined \EndIncludeInRelease %%% From File: ltfiles.dtx +\IncludeInRelease{2020/06/05}% + {\document}{Added hook to load l3backend code}% +\def\document{\endgroup + \@expl@sys@load@backend@@ + \ifx\@unusedoptionlist\@empty\else + \@latex@warning@no@line{Unused global option(s):^^J% + \@spaces[\@unusedoptionlist]}% + \fi + \@colht\textheight + \@colroom\textheight \vsize\textheight + \columnwidth\textwidth + \@clubpenalty\clubpenalty + \if@twocolumn + \advance\columnwidth -\columnsep + \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue + \fi + \hsize\columnwidth \linewidth\hsize + \begingroup\@floatplacement\@dblfloatplacement + \makeatletter\let\@writefile\@gobbletwo + \global \let \@multiplelabels \relax + \@input{\jobname.aux}% + \endgroup + \if@filesw + \immediate\openout\@mainaux\jobname.aux + \immediate\write\@mainaux{\relax}% + \fi + \process@table + \let\glb@currsize\@empty % Force math initialization. + \normalsize + \everypar{}% + \ifx\normalsfcodes\@empty + \ifnum\sfcode`\.=\@m + \let\normalsfcodes\frenchspacing + \else + \let\normalsfcodes\nonfrenchspacing + \fi + \fi + \ifx\document@default@language\m@ne + \chardef\document@default@language\language + \fi + \@noskipsecfalse + \let \@refundefined \relax + \let\AtBeginDocument\@firstofone + \@begindocumenthook + \ifdim\topskip<1sp\global\topskip 1sp\relax\fi + \global\@maxdepth\maxdepth + \global\let\@begindocumenthook\@undefined + \ifx\@listfiles\@undefined + \global\let\@filelist\relax + \global\let\@addtofilelist\@gobble + \fi + \gdef\do##1{\global\let ##1\@notprerr}% + \@preamblecmds + \global\let \@nodocument \relax + \global\let\do\noexpand + \ignorespaces} +\EndIncludeInRelease + \IncludeInRelease{2017/04/15}% {\document}{Save language for hyphenation}% \def\document{\endgroup @@ -1238,6 +1296,7 @@ of this package available from CTAN} \global\let\do\noexpand \ignorespaces} \EndIncludeInRelease + \IncludeInRelease{0000/00/00}% {\document}{Save language for hyphenation} \def\document{\endgroup @@ -2828,6 +2887,41 @@ of this package available from CTAN} }% \EndIncludeInRelease %%% From File: ltclass.dtx + +\IncludeInRelease{2020/10/01}{\@pushfilename}% + {Add \@expl@push@filename@@ and \@expl@push@filename@aux@@}% +\def\@pushfilename{% + \@expl@push@filename@@ + \xdef\@currnamestack{% + {\@currname}% + {\@currext}% + {\the\catcode`\@}% + \@currnamestack}% + \@expl@push@filename@aux@@} +\EndIncludeInRelease + +\IncludeInRelease{0000/00/00}{\@pushfilename}% + {Add \@expl@push@filename@@ and \@expl@push@filename@aux@@}% +\def\@pushfilename{% + \xdef\@currnamestack{% + {\@currname}% + {\@currext}% + {\the\catcode`\@}% + \@currnamestack}} +\EndIncludeInRelease +\@onlypreamble\@pushfilename + +\IncludeInRelease{2020/10/01}{\@popfilename}% + {Add \@expl@pop@filename@@}% +\def\@popfilename{\expandafter\@p@pfilename\@currnamestack\@nil + \@expl@pop@filename@@} +\EndIncludeInRelease + +\IncludeInRelease{0000/00/00}{\@pushfilename}% + {Add \@expl@push@filename@@ and \@expl@push@filename@aux@@}% +\def\@popfilename{\expandafter\@p@pfilename\@currnamestack\@nil} +\EndIncludeInRelease +\@onlypreamble\@popfilename \IncludeInRelease{2020/10/01}% {\IfFormatAtLeastTF}{Test format date}% \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} @@ -6651,8 +6745,27 @@ of this package available from CTAN} \def\@icentercr[#1]{\vskip #1\ignorespaces} \EndIncludeInRelease +\IncludeInRelease{2020/10/01}% + {\centering}{Set finaldhypendemerits}% +\DeclareRobustCommand\centering{% + \let\\\@centercr + \rightskip\@flushglue\leftskip\@flushglue + \finalhyphendemerits=\z@ + \parindent\z@\parfillskip\z@skip} +\DeclareRobustCommand\raggedright{% + \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip + \finalhyphendemerits=\z@ + \leftskip\z@skip + \parindent\z@} +\DeclareRobustCommand\raggedleft{% + \let\\\@centercr + \rightskip\z@skip\leftskip\@flushglue + \finalhyphendemerits=\z@ + \parindent\z@\parfillskip\z@skip} +\EndIncludeInRelease \IncludeInRelease{2019/10/01}% {\centering}{Make commands robust}% + \DeclareRobustCommand\centering{% \let\\\@centercr \rightskip\@flushglue\leftskip\@flushglue @@ -6666,6 +6779,7 @@ of this package available from CTAN} \rightskip\z@skip\leftskip\@flushglue \parindent\z@\parfillskip\z@skip} \EndIncludeInRelease + \IncludeInRelease{0000/00/00}% {\centering}{Make commands robust}% @@ -6819,6 +6933,8 @@ of this package available from CTAN} \wlog{***************************************************} \expandafter\endinput \fi +\long\def\@gobble#1{} +\long\def\@firstofone#1{#1} \ifx\e@alloc@attribute@count\@undefined \countdef\e@alloc@attribute@count=258 \fi @@ -7012,38 +7128,71 @@ of this package available from CTAN} \EndIncludeInRelease \fi %%% From File: ltexpl.dtx -\IncludeInRelease{2020/02/02}% +\IncludeInRelease{2020/10/01}% {expl3}{Pre-load expl3}% \expandafter\ifx\csname tex\string _let:D\endcsname\relax - \IfFileExists{expl3.ltx} - {% - \ifnum0% - \ifdefined\pdffilesize 1\fi - \ifdefined\filesize 1\fi - \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi - >0 % - \expandafter\@firstofone - \else - \message{Skipping expl3-dependent extensions} - \expandafter\@gobble - \fi - } - {% - \message{Skipping expl3-dependent extensions}% - \@gobble - }% - {% - \input{expl3.ltx} - \ifdefined\NewDocumentCommand - \else - \IfFileExists{xparse.ltx} - {\input{xparse.ltx}} - {}% - \fi - }% + \expandafter\@firstofone \else - \GenericInfo{}{Skipping: expl3 code already part of the format} + \GenericInfo{}{Skipping: expl3 code already part of the format}% + \expandafter\@gobble \fi + {% + \IfFileExists{expl3.ltx} + {% + \ifnum0% + \ifdefined\pdffilesize 1\fi + \ifdefined\filesize 1\fi + \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi + \ifdefined\kanjiskip 1\fi + >0 % + \expandafter\@firstofone + \else + \@latex@error{% + LaTeX requires the e-TeX primitives and additional\MessageBreak + functionality available in the engines:\MessageBreak + - pdfTeX v1.40\MessageBreak + - XeTeX v0.99992\MessageBreak + - LuaTeX v0.95\MessageBreak + - e-(u)pTeX mid-2012\MessageBreak + or later% + }\@ehd \expandafter\@gobble + \fi + } + {% + \@latex@error{LaTeX requires expl3}\@ehd + \@gobble + }% + {% + \input expl3.ltx + \ifdefined\NewDocumentCommand + \else + \IfFileExists{xparse.ltx} + {\input xparse.ltx } + {}% + \fi + }% + } +\EndIncludeInRelease + +\IncludeInRelease{2020/02/02}% + {expl3}{Pre-load expl3}% +\IfFileExists{expl3.ltx} + {% + \ifnum0% + \ifdefined\pdffilesize 1\fi + \ifdefined\filesize 1\fi + \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi + >0 % + \else + \message{Skipping expl3-dependent extensions} + \expandafter\@gobbletwo + \fi + } + {% + \message{Skipping expl3-dependent extensions}% + \@gobbletwo + }% +\input{expl3.ltx} \EndIncludeInRelease \IncludeInRelease{2020/10/01}% {\@expl@tl@trim@spaces@apply@@nN} @@ -7317,6 +7466,211 @@ of this package available from CTAN} \let\UseRawInputEncoding\@undefined \let\DeclareFontEncoding@saved\@undefined \let\inputencodingname\@undefined +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}% + {\ShowHook}{The hook management}% +\input lthooks.ltx +\input ltshipout.ltx +\input ltfilehook.ltx +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\ShowHook}{The hook management}% + + +\DeclareRobustCommand*\begin[1]{% + \@ifundefined{#1}% + {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}% + {\def\reserved@a{\def\@currenvir{#1}% + \edef\@currenvline{\on@line}% + \csname #1\endcsname}}% + \@ignorefalse + \begingroup\@endpefalse\reserved@a} + +\@namedef{end }#1{% + \csname end#1\endcsname\@checkend{#1}% + \expandafter\endgroup\if@endpe\@doendpe\fi + \if@ignore\@ignorefalse\ignorespaces\fi} + +\DeclareDocumentCommand \NewHook {m}{} +\DeclareDocumentCommand \NewReversedHook {m}{} +\DeclareDocumentCommand \NewMirroredHookPair {mm}{} + +\DeclareDocumentCommand \AddToHookNext {m+m}{} +\DeclareDocumentCommand \RemoveFromHook {mo}{} +\def \UseHook #1{} +\def \UseOneTimeHook #1{} +\def \ShowHook #1{} +\let \DebugHookOn \@empty +\let \DebugHookOff\@empty + +\DeclareDocumentCommand \DeclareHookRule {mmmm}{} +\DeclareDocumentCommand \DeclareDefaultHookRule {mmm}{} +\DeclareDocumentCommand \ClearHookRule {mmm}{} +\DeclareExpandableDocumentCommand \IfHookExistTF {mmm}{#3} +\DeclareExpandableDocumentCommand \IfHookEmptyTF {mmm}{#2} + +\DeclareRobustCommand\AtBeginDocument{\g@addto@macro\@begindocumenthook} +\DeclareRobustCommand\AtEndDocument{\g@addto@macro\@enddocumenthook} + +\let\AtBeginEnvironment \@undefined +\let\AtEndEnvironment \@undefined +\let\BeforeBeginEnvironment \@undefined +\let\AfterEndEnvironment \@undefined + +\def\@pushfilename{% + \@expl@push@filename@@ + \xdef\@currnamestack{% + {\@currname}% + {\@currext}% + {\the\catcode`\@}% + \@currnamestack}% + \@expl@push@filename@aux@@} +\def\@popfilename{\expandafter\@p@pfilename\@currnamestack\@nil + \@expl@pop@filename@@} + + +% next goes away again when etoolbox is updated ... +\expandafter\let\csname ver@etoolbox.sty\endcsname\@undefined + +\def\document{\endgroup + \@expl@sys@load@backend@@ + \ifx\@unusedoptionlist\@empty\else + \@latex@warning@no@line{Unused global option(s):^^J% + \@spaces[\@unusedoptionlist]}% + \fi + \@colht\textheight + \@colroom\textheight \vsize\textheight + \columnwidth\textwidth + \@clubpenalty\clubpenalty + \if@twocolumn + \advance\columnwidth -\columnsep + \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue + \fi + \hsize\columnwidth \linewidth\hsize + \begingroup\@floatplacement\@dblfloatplacement + \makeatletter\let\@writefile\@gobbletwo + \global \let \@multiplelabels \relax + \@input{\jobname.aux}% + \endgroup + \if@filesw + \immediate\openout\@mainaux\jobname.aux + \immediate\write\@mainaux{\relax}% + \fi + \process@table + \let\glb@currsize\@empty % Force math initialization. + \normalsize + \everypar{}% + \ifx\normalsfcodes\@empty + \ifnum\sfcode`\.=\@m + \let\normalsfcodes\frenchspacing + \else + \let\normalsfcodes\nonfrenchspacing + \fi + \fi + \ifx\document@default@language\m@ne + \chardef\document@default@language\language + \fi + \@noskipsecfalse + \let \@refundefined \relax + \let\AtBeginDocument\@firstofone + \@begindocumenthook + \ifdim\topskip<1sp\global\topskip 1sp\relax\fi + \global\@maxdepth\maxdepth + \global\let\@begindocumenthook\@undefined + \ifx\@listfiles\@undefined + \global\let\@filelist\relax + \global\let\@addtofilelist\@gobble + \fi + \gdef\do##1{\global\let ##1\@notprerr}% + \@preamblecmds + \global\let \@nodocument \relax + \global\let\do\noexpand + \ignorespaces} + +\def\enddocument{% + \let\AtEndDocument\@firstofone + \@enddocumenthook + \@checkend{document}% + \clearpage + \begingroup + \if@filesw + \immediate\closeout\@mainaux + \let\@setckpt\@gobbletwo + \let\@newl@bel\@testdef + \@tempswafalse + \makeatletter \@@input\jobname.aux + \fi + \@dofilelist + \ifdim \font@submax >\fontsubfuzz\relax + \@font@warning{Size substitutions with differences\MessageBreak + up to \font@submax\space have occurred.\@gobbletwo}% + \fi + \@defaultsubs + \@refundefined + \if@filesw + \ifx \@multiplelabels \relax + \if@tempswa + \@latex@warning@no@line{Label(s) may have changed. + Rerun to get cross-references right}% + \fi + \else + \@multiplelabels + \fi + \fi + \endgroup + \deadcycles\z@\@@end} + +\expandafter\let\csname ver@atveryend.sty\endcsname\@undefined +\let\AfterLastShipout \@undefined +\let\AtVeryEndDocument \@undefined +\let\AtEndAfterFileList \@undefined +\let\AtVeryVeryEnd \@undefined +\let\BeforeClearDocument \@undefined + + +\expandafter\let\expandafter\shipout\csname tex_shipout:D\endcsname + +\let \ShipoutBox\@undefined +\let \ReadonlyShipoutCounter \@undefined +\let \c@totalpages \@undefined +\let \thetotalpages \@undefined + +\let \DiscardShipoutBox \@undefined +\let \DebugShipoutOn \@undefined +\let \DebugShipoutOff \@undefined + +\DeclareRobustCommand \AtBeginDvi [1]{% + \global \setbox \@begindvibox + \vbox{\unvbox \@begindvibox #1}% +} + +\let \AtBeginShipout \@undefined +\let \AtBeginShipoutNext \@undefined + +\let \AtBeginShipoutFirst \@undefined + +\let \ShipoutBoxHeight \@undefined +\let \ShipoutBoxDepth \@undefined +\let \ShipoutBoxWidth \@undefined + +\let \AtBeginShipoutDiscard \@undefined + +\let \AtBeginShipoutAddToBox \@undefined +\let \AtBeginShipoutAddToBoxForeground \@undefined +\let \AtBeginShipoutUpperLeft \@undefined +\let \AtBeginShipoutUpperLeftForeground \@undefined + +\expandafter\let\csname ver@atbegshi.sty\endcsname \@undefined + +\let \EveryShipout \@undefined +\let \AtNextShipout \@undefined +\expandafter \let \csname ver@everyshi.sty\endcsname \@undefined + +\let \AtEndDvi \@undefined +\expandafter\let \csname ver@atenddvi.sty\endcsname \@undefined + +\AtBeginDocument{\reinstall@nfss@defs\init@series@setup} + \EndIncludeInRelease \endinput %% diff --git a/Master/texmf-dist/tex/latex-dev/base/ltexpl.ltx b/Master/texmf-dist/tex/latex-dev/base/ltexpl.ltx index b0e023f3337..64908ce7448 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltexpl.ltx +++ b/Master/texmf-dist/tex/latex-dev/base/ltexpl.ltx @@ -42,36 +42,77 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %%% From File: ltexpl.dtx +\def\@expl@sys@load@backend@@{} +\def\@expl@push@filename@@{} +\def\@expl@push@filename@aux@@{} +\def\@expl@pop@filename@@{} +\def\@expl@finalise@setup@@{} +\long\def\@gobble#1{} +\long\def\@firstofone#1{#1} +\long\def\@firstoftwo#1#2{#1} +\long\def\@secondoftwo#1#2{#2} +\long\def\IfFileExists#1{% + \openin\@inputcheck"#1" % + \ifeof\@inputcheck + \expandafter\@secondoftwo + \else + \closein\@inputcheck + \expandafter\@firstoftwo + \fi} +\long\def\@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2}% + \def\reserved@b{#3}% + \futurelet\@let@token\@ifnch} +\def\@ifnch{% + \ifx\@let@token\reserved@d + \expandafter\reserved@a + \else + \expandafter\reserved@b + \fi} \expandafter\ifx\csname tex\string _let:D\endcsname\relax - \IfFileExists{expl3.ltx} - {% - \ifnum0% - \ifdefined\pdffilesize 1\fi - \ifdefined\filesize 1\fi - \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi - >0 % - \expandafter\@firstofone - \else - \message{Skipping expl3-dependent extensions} - \expandafter\endinput - \fi - } - {% - \message{Skipping expl3-dependent extensions}% - \endinput - }% - {% - \input{expl3.ltx} - \ifdefined\NewDocumentCommand - \else - \IfFileExists{xparse.ltx} - {\input{xparse.ltx}} - {}% - \fi - }% + \expandafter\@firstofone \else - \GenericInfo{}{Skipping: expl3 code already part of the format} + \GenericInfo{}{Skipping: expl3 code already part of the format}% + \expandafter\endinput \fi + {% + \IfFileExists{expl3.ltx} + {% + \ifnum0% + \ifdefined\pdffilesize 1\fi + \ifdefined\filesize 1\fi + \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi + \ifdefined\kanjiskip 1\fi + >0 % + \expandafter\@firstofone + \else + \def~{ }\def\MessageBreak{^^J~~~~~~~~~~~~~~~}% + \errmessage{LaTeX Error: + LaTeX requires the e-TeX primitives and additional\MessageBreak + functionality available in the engines:\MessageBreak + - pdfTeX v1.40\MessageBreak + - XeTeX v0.99992\MessageBreak + - LuaTeX v0.95\MessageBreak + - e-(u)pTeX mid-2012\MessageBreak + or later% + }\batchmode \read -1 to \reserved@a + \fi + } + {% + \errmessage{LaTeX requires expl3}% + \batchmode \read -1 to \reserved@a + }% + {% + \input expl3.ltx + \ifdefined\NewDocumentCommand + \else + \IfFileExists{xparse.ltx} + {\input xparse.ltx } + {}% + \fi + }% + } \ExplSyntaxOn \cs_new_eq:NN \@expl@tl@trim@spaces@apply@@nN \tl_trim_spaces_apply:nN \ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex-dev/base/ltfilehook.ltx b/Master/texmf-dist/tex/latex-dev/base/ltfilehook.ltx new file mode 100644 index 00000000000..b164900b594 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/base/ltfilehook.ltx @@ -0,0 +1,343 @@ +%% +%% This is file `ltfilehook.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ltfilehook.dtx (with options: `2ekernel') +%% +%% This is a generated file. +%% +%% Copyright 2020 Frank Mittelbach +%% +%% This file was generated from file(s) of the LaTeX `lthooks Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% 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 +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `lthooks Bundle'. You may however distribute the `lthooks Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/FrankMittelbach/fmitex/ +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team +\providecommand\ltfilehookversion{v0.9a} +\providecommand\ltfilehookdate{2020/07/19} +\def\CurrentFile{} +\def\CurrentFilePath{} +\ExplSyntaxOn +\tl_new:N \l__filehook_internal_tl +\cs_new_protected:Npn \@filehook@set@curr@file #1 + { \exp_args:NV \__filehook_normalise_file_name:n #1 } +\cs_new_protected:Npn \__filehook_normalise_file_name:n #1 + { + \file_if_exist:nTF {#1} + { + \exp_args:Nx \file_parse_full_name:nNNN + { \file_full_name:n {#1} } + } + { \file_parse_full_name:nNNN {#1} } + \CurrentFilePath \CurrentFile \l__filehook_internal_tl + \tl_set:Nx \CurrentFile { \CurrentFile \l__filehook_internal_tl } + } +\seq_new:N \g__filehook_input_file_seq +\cs_new_protected:Npn \@filehook@file@push + { + \seq_gpush:Nx \g__filehook_input_file_seq + { { \CurrentFilePath } { \CurrentFile } } + } +\cs_new_protected:Npn \@filehook@file@pop + { + \seq_gpop:NNTF \g__filehook_input_file_seq \l__filehook_internal_tl + { \exp_after:wN \__filehook_file_pop_assign:nn \l__filehook_internal_tl } + { \ERROR_should_not_happen } + } +\cs_new_protected:Npn \__filehook_file_pop_assign:nn #1 #2 + { + \tl_set:Nn \CurrentFilePath {#1} + \tl_set:Nn \CurrentFile {#2} + } +\ExplSyntaxOff +\let\InputIfFileExists\@undefined +\DeclareRobustCommand \InputIfFileExists[3]{% + \@filehook@file@push + \IfFileExists{#1}% + {% + \edef\reserved@a{\@filef@und + \def\noexpand\CurrentFile{\CurrentFile}% + \def\noexpand\CurrentFilePath{\CurrentFilePath}% + }% + \expandafter\@swaptwoargs\expandafter + {\reserved@a}% + {% + #2% + \@addtofilelist{#1}% + \UseHook{file/before}% + \UseHook{file/before/\CurrentFile}% + \@@input + }% + \UseHook{file/after/\CurrentFile}% + \UseHook{file/after}% + \@filehook@file@pop + }% + {\@filehook@file@pop #3}% +} +\def\set@curr@file#1{% + \begingroup + \escapechar\m@ne + \xdef\@curr@file{% + \expandafter\expandafter\expandafter\unquote@name + \expandafter\expandafter\expandafter{% + \expandafter\string + \csname\@firstofone#1\@empty\endcsname}}% + \endgroup + \@filehook@set@curr@file{\@curr@file}% +} +\def\load@onefilewithoptions#1[#2][#3]#4{% + \@pushfilename + \xdef\@currname{#1}% + \global\let\@currext#4% + \let\CurrentOption\@empty + \@reset@ptions + \makeatletter + \def\reserved@a{% + \@ifl@aded\@currext{#1}% + {\@if@ptions\@currext{#1}{#2}{}% + {\@latex@error + {Option clash for \@cls@pkg\space #1}% + {The package #1 has already been loaded + with options:\MessageBreak + \space\space[\@ptionlist{#1.\@currext}]\MessageBreak + There has now been an attempt to load it + with options\MessageBreak + \space\space[#2]\MessageBreak + Adding the global options:\MessageBreak + \space\space + \@ptionlist{#1.\@currext},#2\MessageBreak + to your \noexpand\documentclass declaration may fix this.% + \MessageBreak + Try typing \space \space to proceed.}}}% + {\@pass@ptions\@currext{#2}{#1}% + \global\expandafter + \let\csname ver@\@currname.\@currext\endcsname\@empty + \expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty + \InputIfFileExists + {\@currname.\@currext}% + {% + \ifx\@currext\@pkgextension + \UseHook{package/before}% + \UseHook{package/before/\@currname}% + \else + \ifx\@currext\@clsextension + \UseHook{class/before}% + \UseHook{class/before/\@currname}% + \fi + \fi + \@filehook@file@push + }% + {\@missingfileerror\@currname\@currext}% + \let\@unprocessedoptions\@@unprocessedoptions + \csname\@currname.\@currext-h@@k\endcsname + \expandafter\let\csname\@currname.\@currext-h@@k\endcsname + \@undefined + \ifx\@currext\@pkgextension + \UseHook{package/after/\@currname}% + \UseHook{package/after}% + \else + \ifx\@currext\@clsextension + \UseHook{class/after/\@currname}% + \UseHook{class/after}% + \fi + \fi + \@filehook@file@pop + \@unprocessedoptions}% + \@ifl@ter\@currext{#1}{#3}{}% + {\@latex@warning@no@line + {You have requested,\on@line, + version\MessageBreak + `#3' of \@cls@pkg\space #1,\MessageBreak + but only version\MessageBreak + `\csname ver@#1.\@currext\endcsname'\MessageBreak + is available}}% + \ifx\@currext\@clsextension\let\LoadClass\@twoloadclasserror\fi + \@popfilename + \@reset@ptions}% + \reserved@a} +\@ifl@t@r\fmtversion{2020/10/01} +{% +\def\load@onefilewithoptions#1[#2][#3]#4{% + \@pushfilename + \xdef\@currname{#1}% + \global\let\@currext#4% + \let\CurrentOption\@empty + \@reset@ptions + \makeatletter + \def\reserved@a{% + \@ifl@aded\@currext{#1}% + {\@if@ptions\@currext{#1}{#2}{}% + {\@latex@error + {Option clash for \@cls@pkg\space #1}% + {The package #1 has already been loaded + with options:\MessageBreak + \space\space[\@ptionlist{#1.\@currext}]\MessageBreak + There has now been an attempt to load it + with options\MessageBreak + \space\space[#2]\MessageBreak + Adding the global options:\MessageBreak + \space\space + \@ptionlist{#1.\@currext},#2\MessageBreak + to your \noexpand\documentclass declaration may fix this.% + \MessageBreak + Try typing \space \space to proceed.}}}% + {\@pass@ptions\@currext{#2}{#1}% + \global\expandafter + \let\csname ver@\@currname.\@currext\endcsname\@empty + \expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty + \InputIfFileExists + {\@currname.\@currext}% + {% + \ifx\@currext\@pkgextension + \UseHook{package/before}% + \UseHook{package/before/\@currname}% + \else + \ifx\@currext\@clsextension + \UseHook{class/before}% + \UseHook{class/before/\@currname}% + \fi + \fi + \@filehook@file@push + }% + {\@missingfileerror\@currname\@currext}% + \expandafter\let\csname unprocessedoptions-\@currname.\@currext\endcsname + \@@unprocessedoptions + \csname\@currname.\@currext-h@@k\endcsname + \expandafter\let\csname\@currname.\@currext-h@@k\endcsname + \@undefined + \ifx\@unprocessedoptions\relax + \let\@unprocessedoptions\@undefined + \else + \csname unprocessedoptions-\@currname.\@currext\endcsname + \fi + \expandafter\let + \csname unprocessedoptions-\@currname.\@currext\endcsname + \@undefined + \ifx\@currext\@pkgextension + \UseHook{package/after/\@currname}% + \UseHook{package/after}% + \else + \ifx\@currext\@clsextension + \UseHook{class/after/\@currname}% + \UseHook{class/after}% + \fi + \fi + \@filehook@file@pop + }% + \@ifl@ter\@currext{#1}{#3}{}% + {\@latex@warning@no@line + {You have requested,\on@line, + version\MessageBreak + `#3' of \@cls@pkg\space #1,\MessageBreak + but only version\MessageBreak + `\csname ver@#1.\@currext\endcsname'\MessageBreak + is available}}% + \ifx\@currext\@clsextension\let\LoadClass\@twoloadclasserror\fi + \@popfilename + \@reset@ptions}% + \reserved@a} +}{}% + +\def\@include#1 {% + \clearpage + \if@filesw + \immediate\write\@mainaux{\string\@input{#1.aux}}% + \fi + \@tempswatrue + \if@partsw + \@tempswafalse + \edef\reserved@b{#1}% + \@for\reserved@a:=\@partlist\do + {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% + \fi + \if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux #1.aux + \immediate\write\@partaux{\relax}% + \fi + \set@curr@file{#1}% + \UseHook{include/before}% + \UseHook{include/before/#1}% + \@input@{#1.tex}% + \UseHook{include/end/#1}% + \UseHook{include/end}% + \clearpage + \UseHook{include/after/#1}% + \UseHook{include/after}% + \clearpage + \@writeckpt{#1}% + \if@filesw + \immediate\closeout\@partaux + \fi + \else + \deadcycles\z@ + \@nameuse{cp@#1}% + \fi + \let\@auxout\@mainaux +} +\@ifl@t@r\fmtversion{2020/10/01} +{% +\def\@include#1 {% + \clearpage + \if@filesw + \immediate\write\@mainaux{\string\@input{"#1.aux"}}% + \fi + \@tempswatrue + \if@partsw + \@tempswafalse + \edef\reserved@b{#1}% + \@for\reserved@a:=\@partlist\do + {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% + \fi + \if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux "#1.aux" + \immediate\write\@partaux{\relax}% + \fi + \UseHook{include/before}% + \UseHook{include/before/#1}% + \@input@{#1.tex}% + \UseHook{include/end/#1}% + \UseHook{include/end}% + \clearpage + \UseHook{include/after/#1}% + \UseHook{include/after}% + \clearpage + \@writeckpt{#1}% + \if@filesw + \immediate\closeout\@partaux + \fi + \else + \deadcycles\z@ + \@nameuse{cp@#1}% + \fi + \let\@auxout\@mainaux} +}{} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%% +%% End of file `ltfilehook.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/base/lthooks.ltx b/Master/texmf-dist/tex/latex-dev/base/lthooks.ltx new file mode 100644 index 00000000000..e214c4d6ccb --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/base/lthooks.ltx @@ -0,0 +1,1091 @@ +%% +%% This is file `lthooks.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lthooks.dtx (with options: `2ekernel') +%% +%% This is a generated file. +%% +%% Copyright 2020 Frank Mittelbach +%% +%% This file was generated from file(s) of the LaTeX `lthooks Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% 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 +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `lthooks Bundle'. You may however distribute the `lthooks Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/FrankMittelbach/fmitex/ +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: lthooks.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team +\providecommand\lthooksversion{v0.9b} +\providecommand\lthooksdate{2020/07/19} + + + + + + +\ExplSyntaxOn +\bool_new:N \g__hook_debug_bool +\cs_new_eq:NN \__hook_debug:n \use_none:n +\cs_new_protected:Npn \hook_debug_on: + { + \bool_gset_true:N \g__hook_debug_bool + \__hook_debug_gset: + } +\cs_new_protected:Npn \hook_debug_off: + { + \bool_gset_false:N \g__hook_debug_bool + \__hook_debug_gset: + } +\cs_new_protected:Npn \__hook_debug_gset: + { + \cs_gset_protected:Npx \__hook_debug:n ##1 + { \bool_if:NT \g__hook_debug_bool {##1} } + } + +\cs_new_eq:NN \__hook_str_compare:nn \__str_if_eq:nn +\tl_new:N \l__hook_return_tl +\tl_new:N \l__hook_tmpa_tl +\tl_new:N \l__hook_tmpb_tl +\seq_new:N \g__hook_all_seq +\tl_new:N \g__hook_removal_list_tl +\tl_new:N \l__hook_cur_hook_tl +\prop_new:N \g__hook_code_temp_prop +\tl_new:N \g__hook_hook_curr_name_tl +\seq_new:N \g__hook_name_stack_seq +\cs_new_eq:NN \__hook_tmp:w ? +\cs_generate_variant:Nn \tl_gremove_once:Nn { Nx } +\scan_new:N \s__hook_mark + +\cs_new_protected:Npn \hook_new:n #1 + { + \exp_args:Nx \__hook_new:n + { \__hook_parse_label_default:nn {#1} { top-level } } + } +\cs_new_protected:Npn \__hook_new:n #1 { + \hook_if_exist:nTF {#1} + { \ErrorHookExists } + { \seq_gput_right:Nn \g__hook_all_seq {#1} + \tl_new:c { g__hook_#1_code_tl } + \__hook_declare:n {#1} + \clist_new:c {g__hook_#1_labels_clist} + \tl_new:c { g__hook_#1_reversed_tl } + \__hook_provide_legacy_interface:n {#1} + } +} + +\cs_new_protected:Npn \__hook_declare:n #1 + { + \__hook_if_exist:nF {#1} + { + \prop_new:c { g__hook_#1_code_prop } + \tl_new:c { g__hook_#1_next_code_tl } + \prop_new:c { g__hook_#1_rules_prop } % only for debugging + } + } + +\cs_new_protected:Npn \hook_new_reversed:n #1 { + \hook_new:n {#1} + \tl_gset:cn { g__hook_#1_reversed_tl } { - } +} + +\cs_new_protected:Npn \hook_new_pair:nn #1#2 { + \hook_new:n {#1} \hook_new_reversed:n {#2} +} + +\cs_new_protected:Npn \__hook_provide_legacy_interface:n #1 + { + \debug_suspend: + \tl_if_exist:cT { @#1hook } + { + \tl_if_empty:cF { @#1hook } + { + \__hook_gput_code:nxv {#1} + { \__hook_parse_label_default:Vn \c_novalue_tl { legacy } } + { @#1hook } + } + } + \tl_gset:co{@#1hook}{\cs:w g__hook_#1_code_tl\cs_end:} + \debug_resume: + } +\cs_new:Npn \__hook_parse_label_default:nn #1 #2 + { + \tl_if_novalue:nTF {#1} + { \__hook_currname_or_default:n {#2} } + { \tl_trim_spaces_apply:nN {#1} \__hook_parse_dot_label:nn {#2} } + } +\cs_generate_variant:Nn \__hook_parse_label_default:nn { V } +\cs_new:Npn \__hook_parse_dot_label:nn #1 #2 + { + \tl_if_empty:nTF {#1} + { + \msg_expandable_error:nnn { hooks } { empty-label } {#2} + #2 + } + { + \str_if_eq:nnTF {#1} { . } + { \__hook_currname_or_default:n {#1} } + { \__hook_parse_dot_label:nw {#2} #1 ./ \s__hook_mark } + } + } +\cs_new:Npn \__hook_parse_dot_label:nw #1 #2 ./ #3 \s__hook_mark + { + \tl_if_empty:nTF {#2} + { \__hook_parse_dot_label_aux:nw {#1} #3 \s__hook_mark } + { + \tl_if_empty:nTF {#3} + {#2} + { \__hook_parse_dot_label_cleanup:w #2 ./ #3 \s__hook_mark } + } + } +\cs_new:Npn \__hook_parse_dot_label_cleanup:w #1 ./ \s__hook_mark {#1} +\cs_new:Npn \__hook_parse_dot_label_aux:nw #1 #2 ./ \s__hook_mark + { \__hook_currname_or_default:n {#1} / #2 } +\cs_new:Npn \__hook_currname_or_default:n #1 + { + \tl_if_empty:NTF \g__hook_hook_curr_name_tl + { + \tl_if_empty:NTF \@currname + {#1} + { \@currname } + } + { \g__hook_hook_curr_name_tl } + } + +\cs_new_protected:Npn \hook_gput_code:nnn #1 #2 + { + \exp_args:Nxx \__hook_gput_code:nnn + { \__hook_parse_label_default:nn {#1} { top-level } } + { \__hook_parse_label_default:nn {#2} { top-level } } + } +\cs_new_protected:Npn \__hook_gput_code:nnn #1 #2 #3 + { + \__hook_if_marked_removal:nnTF {#1} {#2} + { \__hook_unmark_removal:nn {#1} {#2} } + { + \hook_if_exist:nTF {#1} + { + \__hook_hook_gput_code_do:nnn {#1} {#2} {#3} + \__hook_update_hook_code:n {#1} + } + { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} } + } + } +\cs_generate_variant:Nn \__hook_gput_code:nnn { nxv } +\cs_new_protected:Npn \__hook_hook_gput_code_do:nnn #1 #2 #3 + { + \__hook_debug:n{\iow_term:x{****~ Add~ to~ + \hook_if_exist:nF {#1} { undeclared~ } + hook~ #1~ (#2) + \on@line\space <-~ \tl_to_str:n{#3}} } + \prop_get:cnNTF { g__hook_#1_code_prop } {#2} \l__hook_return_tl + { + \prop_gput:cno { g__hook_#1_code_prop } {#2} + { \l__hook_return_tl #3 } + } + { \prop_gput:cnn { g__hook_#1_code_prop } {#2} {#3} } + } +\cs_new_protected:Npn \__hook_gput_undeclared_hook:nnn #1 #2 #3 + { + \__hook_declare:n {#1} + \__hook_hook_gput_code_do:nnn {#1} {#2} {#3} + } +\cs_new_protected:Npn \__hook_try_declaring_generic_hook:nnn #1 + { + \__hook_try_declaring_generic_hook:nNNnn {#1} + \hook_gput_code:nnn \__hook_gput_undeclared_hook:nnn + } +\cs_new_protected:Npn \__hook_try_declaring_generic_next_hook:nn #1 + { + \__hook_try_declaring_generic_hook:nNNnn {#1} + \hook_gput_next_code:nn \__hook_gput_next_do:nn + } +\cs_new_protected:Npn \__hook_try_declaring_generic_hook:nNNnn #1 + { + \__hook_if_file_hook:wTF #1 / / \s__hook_mark + { + \exp_args:Ne \__hook_try_declaring_generic_hook_split:nNNnn + { \exp_args:Ne \__hook_file_hook_normalise:n {#1} } + } + { \__hook_try_declaring_generic_hook_split:nNNnn {#1} } + } +\cs_new_protected:Npn \__hook_try_declaring_generic_hook_split:nNNnn #1 #2 #3 + { + \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} + { #2 } + { #3 } {#1} + } +\prg_new_protected_conditional:Npnn \__hook_try_declaring_generic_hook:wn + #1 / #2 / #3 / #4 \scan_stop: #5 { TF } + { + \tl_if_empty:nTF {#2} + { \prg_return_false: } + { + \prop_if_in:NnTF \c__hook_generics_prop {#1} + { + \hook_if_exist:nF {#5} { \hook_new:n {#5} } + \prop_if_in:NnTF \c__hook_generics_reversed_ii_prop {#2} + { \tl_gset:cn { g__hook_#5_reversed_tl } { - } } + { + \prop_if_in:NnT \c__hook_generics_reversed_iii_prop {#3} + { \tl_gset:cn { g__hook_#5_reversed_tl } { - } } + } + \prg_return_true: + } + { \prg_return_false: } + } + } +\prg_new_conditional:Npnn \__hook_if_file_hook:w + #1 / #2 / #3 \s__hook_mark { TF } + { + \str_if_eq:nnTF {#1} { file } + { + \bool_lazy_or:nnTF + { \tl_if_empty_p:n {#3} } + { \str_if_eq_p:nn {#3} { / } } + { \prg_return_false: } + { + \prop_if_in:NnTF \c__hook_generics_file_prop {#2} + { \prg_return_true: } + { \prg_return_false: } + } + } + { \prg_return_false: } + } +\cs_new:Npn \__hook_file_hook_normalise:n #1 + { \__hook_strip_double_slash:n {#1} } +\cs_new:Npn \__hook_strip_double_slash:n #1 + { \__hook_strip_double_slash:w #1 // \s__hook_mark } +\cs_new:Npn \__hook_strip_double_slash:w #1 // #2 \s__hook_mark + { + \tl_if_empty:nTF {#2} + {#1} + { \__hook_strip_double_slash:w #1 / #2 \s__hook_mark } + } + +\prop_const_from_keyval:Nn \c__hook_generics_prop + {env=,file=,package=,class=,include=} +\prop_const_from_keyval:Nn \c__hook_generics_reversed_ii_prop {after=,end=} +\prop_const_from_keyval:Nn \c__hook_generics_reversed_iii_prop {after=} +\prop_const_from_keyval:Nn \c__hook_generics_file_prop {before=,after=} + +\cs_new_eq:NN \__hook_update_hook_code:n \use_none:n + +\cs_new_protected:Npn \hook_gremove_code:nn #1 #2 + { + \exp_args:Nxx \__hook_gremove_code:nn + { \__hook_parse_label_default:nn {#1} { top-level } } + { \__hook_parse_label_default:nn {#2} { top-level } } + } +\cs_new_protected:Npn \__hook_gremove_code:nn #1 #2 + { + \__hook_if_exist:nTF {#1} + { + \str_if_eq:nnTF {#2} {*} + { + \prop_gclear:c { g__hook_#1_code_prop } + \clist_gclear:c { g__hook_#1_labels_clist } % for debugging only + } + { + \prop_get:cnNTF { g__hook_#1_code_prop } {#2} \l__hook_return_tl + { \__hook_gremove_code_do:nn } + { \__hook_mark_removal:nn } + {#1} {#2} + } + \hook_if_exist:nT {#1} + { \__hook_update_hook_code:n {#1} } + } + { \__hook_mark_removal:nn {#1} {#2} } + } +\cs_new_protected:Npn \__hook_gremove_code_do:nn #1 #2 + { + \prop_gremove:cn { g__hook_#1_code_prop } {#2} + \exp_args:Nco \clist_gremove_all:Nn + { g__hook_#1_labels_clist } { \tl_to_str:n {#2} } % for debugging only + } + +\cs_new_protected:Npn \__hook_mark_removal:nn #1 #2 + { + \tl_gput_right:Nx \g__hook_removal_list_tl + { \__hook_removal_tl:nn {#1} {#2} } + } +\cs_new_protected:Npn \__hook_unmark_removal:nn #1 #2 + { + \tl_gremove_once:Nx \g__hook_removal_list_tl + { \__hook_removal_tl:nn {#1} {#2} } + } +\prg_new_protected_conditional:Npnn \__hook_if_marked_removal:nn #1 #2 { TF } + { + \exp_args:NNx \tl_if_in:NnTF \g__hook_removal_list_tl + { \__hook_removal_tl:nn {#1} {#2} } + { \prg_return_true: } { \prg_return_false: } + } +\cs_new:Npn \__hook_removal_tl:nn #1 #2 + { & \tl_to_str:n {#2} $ \tl_to_str:n {#1} $ } + +\prop_new:c {g__hook_??_rules_prop} +\prop_new:c {g__hook_??_code_prop} +\prop_new:c {g__hook_??_code_tl} +\tl_new:c {g__hook_??_reversed_tl} + +\cs_new_protected:Npn \__hook_debug_gset_rule:nnnn #1#2#3#4 + { + \prop_gremove:cn{g__hook_#1_rules_prop}{#2|#4} + \prop_gremove:cn{g__hook_#1_rules_prop}{#4|#2} + \str_case_e:nnF {#3} + { + {before} { \prop_gput:cnn {g__hook_#1_rules_prop}{#2|#4}{<} } + {after} { \prop_gput:cnn {g__hook_#1_rules_prop}{#4|#2}{<} } + {incompatible-error} { \prop_gput:cnn {g__hook_#1_rules_prop}{#2|#4}{xE} } + {incompatible-warning} { \prop_gput:cnn {g__hook_#1_rules_prop}{#2|#4}{xW} } + {removes} { \prop_gput:cnn {g__hook_#1_rules_prop}{#2|#4}{->} } + {unrelated}{ \prop_gremove:cn {g__hook_#1_rules_prop}{#2|#4} + \prop_gremove:cn {g__hook_#1_rules_prop}{#4|#2} } + } + { \ERRORunknownrule } + } +\cs_new_protected:Npn \hook_gset_rule:nnnn #1#2#3#4 + { + \use:x + { + \__hook_gset_rule:nnnn + { \__hook_parse_label_default:nn {#1} { top-level } } + { \__hook_parse_label_default:nn {#2} { top-level } } + {#3} + { \__hook_parse_label_default:nn {#4} { top-level } } + } + } +\cs_new_protected:Npn \__hook_gset_rule:nnnn #1#2#3#4 + { + \__hook_declare:n {#1} + \__hook_rule_gclear:nnn {#1} {#2} {#4} + \debug_suspend: + \cs_if_exist_use:cTF { __hook_rule_#3_gset:nnn } + { + {#1} {#2} {#4} + \__hook_update_hook_code:n {#1} + } + { \ERRORunknownrule } + \debug_resume: + \__hook_debug_gset_rule:nnnn {#1} {#2} {#3} {#4} % for debugging + } +\cs_new_protected:Npn \__hook_rule_before_gset:nnn #1#2#3 + { + \tl_gset:cx { g__hook_#1_rule_ \__hook_label_pair:nn {#2} {#3} _tl } + { \__hook_label_ordered:nnTF {#2} {#3} { < } { > } } + } +\cs_new_eq:cN { __hook_rule_<_gset:nnn } \__hook_rule_before_gset:nnn +\cs_new_protected:Npn \__hook_rule_after_gset:nnn #1#2#3 + { + \tl_gset:cx { g__hook_#1_rule_ \__hook_label_pair:nn {#3} {#2} _tl } + { \__hook_label_ordered:nnTF {#3} {#2} { < } { > } } + } +\cs_new_eq:cN { __hook_rule_>_gset:nnn } \__hook_rule_after_gset:nnn +\cs_new_protected:Npn \__hook_rule_removes_gset:nnn #1#2#3 + { + \tl_gset:cx { g__hook_#1_rule_ \__hook_label_pair:nn {#2} {#3} _tl } + { \__hook_label_ordered:nnTF {#2} {#3} { -> } { <- } } + } +\cs_new_protected:cpn { __hook_rule_incompatible-error_gset:nnn } #1#2#3 + { \tl_gset:cn { g__hook_#1_rule_ \__hook_label_pair:nn {#2} {#3} _tl } { xE } } +\cs_new_protected:cpn { __hook_rule_incompatible-warning_gset:nnn } #1#2#3 + { \tl_gset:cn { g__hook_#1_rule_ \__hook_label_pair:nn {#2} {#3} _tl } { xW } } +\cs_new_protected:Npn \__hook_rule_unrelated_gset:nnn #1#2#3 { } +\cs_new_protected:Npn \__hook_rule_gclear:nnn #1#2#3 + { \cs_undefine:c { g__hook_#1_rule_ \__hook_label_pair:nn {#2} {#3} _tl } } +\cs_new:Npn \__hook_label_pair:nn #1#2 + { + \if_case:w \__hook_str_compare:nn {#1} {#2} \exp_stop_f: + #1 | #1 % 0 + \or: #1 | #2 % +1 + \else: #2 | #1 % -1 + \fi: + } +\prg_new_conditional:Npnn \__hook_label_ordered:nn #1#2 { TF } + { + \if_int_compare:w \__hook_str_compare:nn {#1} {#2} > 0 \exp_stop_f: + \prg_return_true: + \else + \prg_return_false: + \fi: + } +\cs_new:Npn \__hook_if_label_case:nnnnn #1#2 + { + \cs:w use_ + \if_case:w \__hook_str_compare:nn {#1} {#2} + i \or: ii \else: iii \fi: :nnn + \cs_end: + } + +\cs_new_protected:Npn \__hook_initialize_all: { + \cs_gset_eq:NN \__hook_update_hook_code:n \__hook_initialize_hook_code:n + \__hook_debug:n { \prop_gclear:N \g__hook_used_prop } + \seq_map_inline:Nn \g__hook_all_seq + { + \__hook_update_hook_code:n {##1} + } + \__hook_debug:n + { \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:} + \prop_map_inline:Nn \g__hook_used_prop + { \iow_term:x{^^J~ ##1~ ->~ + \exp_not:v {g__hook_##1_code_tl}~ } + } + } + \cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n + \cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n +} + +\cs_new_protected:Npn \__hook_initialize_hook_code:n #1 { + \__hook_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~ + '#1' \on@line :^^J} } + \hook_if_exist:nT {#1} + { + \prop_if_empty:cTF {g__hook_#1_code_prop} + { \tl_gset:co {g__hook_#1_code_tl} + {\cs:w g__hook_#1_next_code_tl \cs_end: } } + { + \__hook_if_reversed:nTF {#1} + { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_left:NV + \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_left:NV } + { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_right:NV + \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_right:NV } + \prop_gset_eq:Nc \g__hook_code_temp_prop { g__hook_#1_code_prop } + \__hook_initialize_single:ccccn + { g__hook_#1_code_prop } { g__hook_#1_code_tl } + { g__hook_#1_next_code_tl } { g__hook_#1_labels_clist } + {#1} + \prop_gset_eq:cN { g__hook_#1_code_prop } \g__hook_code_temp_prop + \__hook_debug:n{ \exp_args:NNx \prop_gput:Nnn \g__hook_used_prop {#1}{} } + } + } +} + +\prop_new:N\g__hook_used_prop + +\cs_new:Npn \__hook_tl_csname:n #1 { l__hook_label_#1_tl } +\cs_new:Npn \__hook_seq_csname:n #1 { l__hook_label_#1_seq } + +\seq_new:N \l__hook_labels_seq +\int_new:N \l__hook_labels_int +\tl_new:N \l__hook_front_tl +\tl_new:N \l__hook_rear_tl +\tl_new:c { \__hook_tl_csname:n { 0 } } + +\cs_new_protected:Npn \__hook_initialize_single:NNNNn #1#2#3#4#5 { + \debug_suspend: + \seq_clear:N \l__hook_labels_seq + \int_zero:N \l__hook_labels_int + \tl_set:Nn \l__hook_cur_hook_tl {#5} + \prop_map_inline:Nn #1 + { + \int_incr:N \l__hook_labels_int + \seq_put_right:Nn \l__hook_labels_seq {##1} + \tl_set:cn { \__hook_tl_csname:n {##1} }{0} % the counter k for number of + % j before k rules + \seq_clear_new:c { \__hook_seq_csname:n {##1} } % sequence of successors to k + % i.e., k before j rules (stores + % the names of the j's) + } + \prop_map_inline:Nn #1 + { + \prop_map_inline:Nn #1 + { + \__hook_if_label_case:nnnnn {##1} {####1} + { \prop_map_break: } + { \__hook_apply_label_pair:nnn {##1} {####1} } + { \__hook_apply_label_pair:nnn {####1} {##1} } + {#5} + } + } + \__hook_debug:n { \__hook_debug_label_data:N #1 } + \tl_set:Nn \l__hook_rear_tl { 0 } + \tl_set:cn { \__hook_tl_csname:n { 0 } } { 0 } % really {l__hook_label_ \l__hook_rear_tl _tl} + \seq_map_inline:Nn \l__hook_labels_seq + { + \int_compare:nNnT { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0 + { + \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } }{##1} + \tl_set:Nn \l__hook_rear_tl {##1} + } + } + \tl_set_eq:Nc \l__hook_front_tl { \__hook_tl_csname:n { 0 } } + \tl_gclear:N #2 + \clist_gclear:N #4 + \bool_while_do:nn { ! \str_if_eq_p:Vn \l__hook_front_tl { 0 } } + { + \int_decr:N \l__hook_labels_int + \prop_get:NVN #1 \l__hook_front_tl \l__hook_return_tl + \__hook_tl_gput:NV #2 \l__hook_return_tl + \__hook_clist_gput:NV #4 \l__hook_front_tl + \__hook_debug:n{ \iow_term:x{Handled~ code~ for~ \l__hook_front_tl} } + \seq_map_inline:cn { \__hook_seq_csname:n { \l__hook_front_tl } } + { + \tl_set:cx { \__hook_tl_csname:n {##1} } + { \int_eval:n { \cs:w \__hook_tl_csname:n {##1} \cs_end: - 1 } } + \int_compare:nNnT { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0 + { + \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } } {##1} + \tl_set:Nn \l__hook_rear_tl {##1} + } + } + \tl_set_eq:Nc \l__hook_front_tl { \__hook_tl_csname:n { \l__hook_front_tl } } + } + \int_compare:nNnF \l__hook_labels_int = 0 + { + \iow_term:x{====================} + \iow_term:x{Error:~ label~ rules~ are~ incompatible:} + \__hook_debug_label_data:N #1 + \iow_term:x{====================} + } + \tl_gput_right:Nn #2 {#3} + \debug_resume: +} +\cs_generate_variant:Nn \__hook_initialize_single:NNNNn {cccc} + +\cs_new:Npn \__hook_tl_gput:NV {\ERROR} +\cs_new:Npn \__hook_clist_gput:NV {\ERROR} + +\cs_new_protected:Npn \__hook_apply_label_pair:nnn #1#2#3 + { + \__hook_label_if_exist_apply:nnnF {#1} {#2} {#3} + { + \__hook_label_if_exist_apply:nnnF {#1} {#2} { ?? } { } + } + } +\cs_new_protected:Npn \__hook_label_if_exist_apply:nnnF #1#2#3 + { + \if_cs_exist:w g__hook_ #3 _rule_ #1 | #2 _tl \cs_end: + \__hook_apply_rule:nnn {#1} {#2} {#3} + \exp_after:wN \use_none:n + \else: + \use:nn + \fi: + } + +\cs_new_protected:Npn \__hook_apply_rule:nnn #1#2#3 + { + \cs:w __hook_apply_ + \cs:w g__hook_#3_reversed_tl \cs_end: rule_ + \cs:w g__hook_ #3 _rule_ #1 | #2 _tl \cs_end: :nnn \cs_end: + {#1} {#2} {#3} + } +\cs_new_protected:cpn { __hook_apply_rule_<:nnn } #1#2#3 + { + \__hook_debug:n { \__hook_msg_pair_found:nnn {#1} {#2} {#3} } + \tl_set:cx { \__hook_tl_csname:n {#2} } + { \int_eval:n{ \cs:w \__hook_tl_csname:n {#2} \cs_end: + 1 } } + \seq_put_right:cn{ \__hook_seq_csname:n {#1} }{#2} + } +\cs_new_protected:cpn { __hook_apply_rule_>:nnn } #1#2#3 + { + \__hook_debug:n { \__hook_msg_pair_found:nnn {#1} {#2} {#3} } + \tl_set:cx { \__hook_tl_csname:n {#1} } + { \int_eval:n{ \cs:w \__hook_tl_csname:n {#1} \cs_end: + 1 } } + \seq_put_right:cn{ \__hook_seq_csname:n {#2} }{#1} + } +\cs_new_protected:cpn { __hook_apply_rule_xE:nnn } #1#2#3 + { + \__hook_debug:n { \__hook_msg_pair_found:nnn {#1} {#2} {#3} } + \msg_error:nnnnnn { hooks } { labels-incompatible } + {#1} {#2} {#3} { 1 } + \use:c { __hook_apply_rule_->:nnn } {#1} {#2} {#3} + \use:c { __hook_apply_rule_<-:nnn } {#1} {#2} {#3} + } +\cs_new_protected:cpn { __hook_apply_rule_xW:nnn } #1#2#3 + { + \__hook_debug:n { \__hook_msg_pair_found:nnn {#1} {#2} {#3} } + \msg_warning:nnnnnn { hooks } { labels-incompatible } + {#1} {#2} {#3} { 0 } + } +\cs_new_protected:cpn { __hook_apply_rule_->:nnn } #1#2#3 + { + \__hook_debug:n + { + \__hook_msg_pair_found:nnn {#1} {#2} {#3} + \iow_term:x{--->~ Drop~ '#2'~ code~ from~ + \iow_char:N \\ g__hook_ \l__hook_cur_hook_tl _code_prop ~ because~ of~ '#1' } + } + \prop_gput:cnn { g__hook_ \l__hook_cur_hook_tl _code_prop } {#2} { } + } +\cs_new_protected:cpn { __hook_apply_rule_<-:nnn } #1#2#3 + { + \__hook_debug:n + { + \__hook_msg_pair_found:nnn {#1} {#2} {#3} + \iow_term:x{--->~ Drop~ '#1'~ code~ from~ + \iow_char:N \\ g__hook_ \l__hook_cur_hook_tl _code_prop ~ because~ of~ '#2' } + } + \prop_gput:cnn { g__hook_ \l__hook_cur_hook_tl _code_prop } {#1} { } + } + +\cs_new_eq:cc { __hook_apply_-rule_<:nnn } { __hook_apply_rule_>:nnn } +\cs_new_eq:cc { __hook_apply_-rule_>:nnn } { __hook_apply_rule_<:nnn } +\cs_new_eq:cc { __hook_apply_-rule_<-:nnn } { __hook_apply_rule_<-:nnn } +\cs_new_eq:cc { __hook_apply_-rule_->:nnn } { __hook_apply_rule_->:nnn } +\cs_new_eq:cc { __hook_apply_-rule_xE:nnn } { __hook_apply_rule_xE:nnn } +\cs_new_eq:cc { __hook_apply_-rule_xW:nnn } { __hook_apply_rule_xW:nnn } + +\cs_new_protected:Npn \__hook_msg_pair_found:nnn #1#2#3 + { + \iow_term:x{~ \str_if_eq:nnTF {#3} {??} {default} {~normal} ~ + rule~ \__hook_label_pair:nn {#1} {#2}:~ + \use:c { g__hook_#3_rule_ \__hook_label_pair:nn {#1} {#2} _tl } ~ found} + } + +\cs_new_protected:Npn \__hook_debug_label_data:N #1 { + \iow_term:x{Code~ labels~ for~ sorting:} + \iow_term:x{~ \seq_use:Nnnn\l__hook_labels_seq {~and~}{,~}{~and~} } % fix name! + \iow_term:x{^^J Data~ structure~ for~ label~ rules:} + \prop_map_inline:Nn #1 + { + \iow_term:x{~ ##1~ =~ \tl_use:c{ \__hook_tl_csname:n {##1} }~ ->~ + \seq_use:cnnn{ \__hook_seq_csname:n {##1} }{~->~}{~->~}{~->~} + } + } + \iow_term:x{} +} + +\cs_new_protected:Npn \hook_log:n #1 + { + \exp_args:Nx \__hook_log:n + { \__hook_parse_label_default:nn {#1} { top-level } } + } +\cs_new_protected:Npn \__hook_log:n #1 + { + \iow_term:x{^^JThe~ hook~ '#1':} + \hook_if_exist:nF {#1} + { \iow_term:x {~Hook~ is~ not~ declared!} } + \__hook_if_exist:nTF {#1} + { + \iow_term:x{~Code~ chunks:} + \prop_if_empty:cTF {g__hook_#1_code_prop} + { \iow_term:x{\@spaces ---} } + { + \prop_map_inline:cn {g__hook_#1_code_prop} + { \iow_term:x{\@spaces ##1~ ->~ \tl_to_str:n{##2} } } + } + \iow_term:x{~Extra~ code~ next~ invocation:} + \iow_term:x{\@spaces + \tl_if_empty:cTF { g__hook_#1_next_code_tl } + {---} {->~ \str_use:c{g__hook_#1_next_code_tl} } } + \iow_term:x{~Rules:} + \prop_if_empty:cTF {g__hook_#1_rules_prop} + { \iow_term:x{\@spaces ---} } + { \prop_map_inline:cn {g__hook_#1_rules_prop} + { \iow_term:x{\@spaces ##1~ with~ relation~ ##2} } + } + \hook_if_exist:nT {#1} + { \iow_term:x { ~Execution~ order + \prop_if_empty:cTF {g__hook_#1_rules_prop} + { \__hook_if_reversed:nT {#1} + { ~ (after~ reversal) } + } + { ~ (after~ + \__hook_if_reversed:nT {#1} {reversal~ and~} + applying~ rules) + } + : + } + \iow_term:x { \@spaces + \clist_if_empty:cTF{g__hook_#1_labels_clist} + {not~ set~ yet} + { \clist_use:cnnn {g__hook_#1_labels_clist} + { ,~ } { ,~ } { ,~ } } + } + } + } + { \iow_term:n { ~The~hook~is~empty. } } + \iow_term:n { } + } + +\cs_new_protected:Npn \hook_gput_next_code:nn #1 + { + \exp_args:Nx \__hook_gput_next_code:nn + { \__hook_parse_label_default:nn {#1} { top-level } } + } +\cs_new_protected:Npn \__hook_gput_next_code:nn #1 #2 + { + \__hook_declare:n {#1} + \hook_if_exist:nTF {#1} + { \__hook_gput_next_do:nn {#1} {#2} } + { \__hook_try_declaring_generic_next_hook:nn {#1} {#2} } + } +\cs_new_protected:Npn \__hook_gput_next_do:nn #1 #2 + { + \tl_gput_right:cn { g__hook_#1_next_code_tl } + { #2 \tl_gclear:c { g__hook_#1_next_code_tl } } + } +\cs_new_protected:Npn \hook_use:n #1 + { + \tl_if_exist:cTF { g__hook_#1_code_tl } + { + \__hook_preamble_hook:n {#1} + \cs:w g__hook_#1_code_tl \cs_end: + } + { \__hook_use:wn #1 / \s__hook_mark {#1} } + } +\cs_new:Npn \__hook_use_initialized:n #1 + { + \tl_if_exist:cTF { g__hook_#1_code_tl } + { \cs:w g__hook_#1_code_tl \cs_end: } + { \__hook_use:wn #1 / \s__hook_mark {#1} } + } +\cs_new_protected:Npn \__hook_preamble_hook:n #1 + { \__hook_initialize_hook_code:n {#1} } +\cs_new:Npn \__hook_use:wn #1 / #2 \s__hook_mark #3 + { + \str_if_eq:nnTF {#1} { file } + { \__hook_try_file_hook:n {#3} } + { } % Hook doesn't exist + } +\cs_new_protected:Npn \__hook_try_file_hook:n #1 + { + \__hook_if_file_hook:wTF #1 / / \s__hook_mark + { + \exp_args:Ne \__hook_if_exist_use:n + { \exp_args:Ne \__hook_file_hook_normalise:n {#1} } + } + { \__hook_if_exist_use:n {#1} } % file/ generic hook (e.g. file/before) + } +\cs_new_protected:Npn \__hook_if_exist_use:n #1 + { + \tl_if_exist:cT { g__hook_#1_code_tl } + { + \__hook_preamble_hook:n {#1} + \cs:w g__hook_#1_code_tl \cs_end: + } + } +\cs_new_protected:Npn \hook_use_once:n #1 + { + \tl_if_exist:cT { g__hook_#1_code_tl } + { + \clist_gput_left:Nn \g__hook_execute_immediately_clist {#1} + \hook_use:n {#1} + } + } + +\prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF } + { + \__hook_if_exist:nTF {#1} + { + \bool_lazy_and:nnTF + { \prop_if_empty_p:c { g__hook_#1_code_prop } } + { \tl_if_empty_p:c { g__hook_#1_next_code_tl } } + { \prg_return_true: } + { \prg_return_false: } + } + { \prg_return_true: } + } + +\prg_new_conditional:Npnn \hook_if_exist:n #1 { p , T , F , TF } + { + \tl_if_exist:cTF { g__hook_#1_code_tl } + { \prg_return_true: } + { \prg_return_false: } + } + +\prg_new_conditional:Npnn \__hook_if_exist:n #1 { p , T , F , TF } + { + \prop_if_exist:cTF { g__hook_#1_code_prop } + { \prg_return_true: } + { \prg_return_false: } + } +\prg_new_conditional:Npnn \__hook_if_reversed:n #1 { p , T , F , TF } + { + \if_int_compare:w \cs:w g__hook_#1_reversed_tl \cs_end: 1 < 0 \exp_stop_f: + \prg_return_true: + \else: + \prg_return_false: + \fi: + } + +\clist_new:N \g__hook_execute_immediately_clist +\msg_new:nnnn { hooks } { labels-incompatible } + { + Labels~`#1'~and~`#2'~are~incompatible + \str_if_eq:nnF {#3} {??} { ~in~hook~`#3' } .~ + \int_compare:nNnT {#4} = { 1 } + { The~code~for~both~labels~will~be~dropped. } + } + { + LaTeX~found~two~incompatible~labels~in~the~same~hook.~ + This~indicates~an~incompatibility~between~packages. + } +\msg_new:nnn { hooks } { empty-label } + { Empty~code~label~\msg_line_context:.~Using~`#1'~instead. } + +\NewDocumentCommand \NewHook { m }{ \hook_new:n {#1} } +\NewDocumentCommand \NewReversedHook { m }{ \hook_new_reversed:n {#1} } +\NewDocumentCommand \NewMirroredHookPair { mm }{ \hook_new_pair:nn {#1}{#2} } + +\NewDocumentCommand \AddToHook { m o +m } + { + \clist_if_in:NnTF \g__hook_execute_immediately_clist {#1} + {#3} + { \hook_gput_code:nnn {#1} {#2} {#3} } + } + +\NewDocumentCommand \AddToHookNext { m +m } + { \hook_gput_next_code:nn {#1} {#2} } + +\NewDocumentCommand \RemoveFromHook { m o } + { \hook_gremove_code:nn {#1} {#2} } +\str_if_eq:VnTF \@currname { lthooks } + { + \seq_gpush:Nn \g__hook_name_stack_seq { lthooks } + \cs_set_protected:Npn \__hook_tmp:w #1 #2 #3 + { + \quark_if_recursion_tail_stop:n {#1} + \seq_gput_right:Nn \g__hook_name_stack_seq { } + \__hook_tmp:w + } + \exp_after:wN \__hook_tmp:w + \@currnamestack + \q_recursion_tail \q_recursion_tail + \q_recursion_tail \q_recursion_stop + } + { \seq_gpush:Nn \g__hook_name_stack_seq { } } +\cs_new_protected:Npn \__hook_curr_name_push:n #1 + { + \seq_gpush:Nn \g__hook_name_stack_seq {#1} + \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} + } +\cs_new_protected:Npn \__hook_curr_name_pop: + { + \seq_gpop:NN \g__hook_name_stack_seq \l__hook_return_tl + \seq_get:NNTF \g__hook_name_stack_seq \l__hook_return_tl + { \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl } + { \ERROR_should_not_happen } + } +\NewDocumentCommand \DeclareDefaultHookLabel { m } + { + \seq_gpop:NN \g__hook_name_stack_seq \l__hook_return_tl + \__hook_curr_name_push:n {#1} + } +\tl_gput_left:Nn \@pushfilename { \__hook_curr_name_push:n { } } +\tl_gput_left:Nn \@popfilename { \__hook_curr_name_pop: } +\newcommand \UseHook { \hook_use:n } +\cs_new_protected:Npn \UseOneTimeHook { \hook_use_once:n } + +\cs_new_protected:Npn \ShowHook { \hook_log:n } + +\cs_new_protected:Npn \DebugHookOn { \hook_debug_on: } +\cs_new_protected:Npn \DebugHookOff { \hook_debug_off: } + +\NewDocumentCommand \DeclareHookRule { m m m m } +{ \hook_gset_rule:nnnn {#1}{#2}{#3}{#4} } + +\NewDocumentCommand \DeclareDefaultHookRule { m m m } + { \hook_gset_rule:nnnn {??}{#1}{#2}{#3} } +\@onlypreamble\DeclareDefaultHookRule +\NewDocumentCommand \ClearHookRule { m m m } +{ \hook_gset_rule:nnnn {#1}{#2}{unrelated}{#3} } +\NewExpandableDocumentCommand \IfHookExistTF { m } + { \hook_if_exist:nTF {#1} } +\NewExpandableDocumentCommand \IfHookEmptyTF { m } + { \hook_if_empty:nTF {#1} } + +\renewcommand\AtBeginDocument{\AddToHook{begindocument}} + +\renewcommand\AtEndDocument {\AddToHook{enddocument}} + +\begingroup + \def\@currname{} + \NewHook{begindocument} + \NewHook{enddocument} + \NewHook{rmfamily} + \NewHook{sffamily} + \NewHook{ttfamily} + \NewHook{defaultfamily} + \NewHook{documentclass} +\endgroup +\let\begin\relax % avoid redeclaration message +\DeclareRobustCommand*\begin[1]{% + \UseHook{env/#1/before}% + \@ifundefined{#1}% + {\def\reserved@a{\@latex@error{Environment~#1~undefined}\@eha}}% + {\def\reserved@a{\def\@currenvir{#1}% + \edef\@currenvline{\on@line}% + \@execute@begin@hook{#1}% + \csname #1\endcsname}}% + \@ignorefalse + \begingroup\@endpefalse\reserved@a} +\def\@execute@begin@hook #1{% + \expandafter\ifx\csname #1\endcsname\document + \endgroup + \gdef\@execute@begin@hook##1{\UseHook{env/##1/begin}}% + \__hook_initialize_all: + \@execute@begin@hook{#1}% + \else + \UseHook{env/#1/begin}% + \fi +} +\@namedef{end~}#1{% + \UseHook{env/#1/end}% + \csname end#1\endcsname\@checkend{#1}% + \expandafter\endgroup\if@endpe\@doendpe\fi + \UseHook{env/#1/after}% + \if@ignore\@ignorefalse\ignorespaces\fi}% +\@namedef{end~}#1{% +\romannumeral +\IfHookEmptyTF{env/#1/end}% + {\expandafter\z@}% + {\z@\UseHook{env/#1/end}}% +\csname end#1\endcsname\@checkend{#1}% +\expandafter\endgroup\if@endpe\@doendpe\fi +\UseHook{env/#1/after}% +\if@ignore\@ignorefalse\ignorespaces\fi}% +\newcommand\AtBeginEnvironment[1] {\AddToHook{env/#1/begin}} +\newcommand\AtEndEnvironment[1] {\AddToHook{env/#1/end}} +\newcommand\BeforeBeginEnvironment[1]{\AddToHook{env/#1/before}} +\newcommand\AfterEndEnvironment[1] {\AddToHook{env/#1/after}} +\ExplSyntaxOff +\NewHook{begindocument/end} + +\def\document{% + \@kernel@after@env@document@begin + \@expl@sys@load@backend@@ + \ifx\@unusedoptionlist\@empty\else + \@latex@warning@no@line{Unused global option(s):^^J% + \@spaces[\@unusedoptionlist]}% + \fi + \@colht\textheight + \@colroom\textheight \vsize\textheight + \columnwidth\textwidth + \@clubpenalty\clubpenalty + \if@twocolumn + \advance\columnwidth -\columnsep + \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue + \fi + \hsize\columnwidth \linewidth\hsize + \begingroup\@floatplacement\@dblfloatplacement + \makeatletter\let\@writefile\@gobbletwo + \global \let \@multiplelabels \relax + \@input{\jobname.aux}% + \endgroup + \if@filesw + \immediate\openout\@mainaux\jobname.aux + \immediate\write\@mainaux{\relax}% + \fi + \process@table + \let\glb@currsize\@empty % Force math initialization. + \normalsize + \everypar{}% + \ifx\normalsfcodes\@empty + \ifnum\sfcode`\.=\@m + \let\normalsfcodes\frenchspacing + \else + \let\normalsfcodes\nonfrenchspacing + \fi + \fi + \ifx\document@default@language\m@ne + \chardef\document@default@language\language + \fi + \@noskipsecfalse + \let \@refundefined \relax + \UseOneTimeHook{begindocument}% + \@kernel@after@begindocument + \ifdim\topskip<1sp\global\topskip 1sp\relax\fi + \global\@maxdepth\maxdepth + \global\let\@begindocumenthook\@undefined + \ifx\@listfiles\@undefined + \global\let\@filelist\relax + \global\let\@addtofilelist\@gobble + \fi + \gdef\do##1{\global\let ##1\@notprerr}% + \@preamblecmds + \global\let \@nodocument \relax + \global\let\do\noexpand + \UseOneTimeHook{begindocument/end}% + \ignorespaces} +\let\@kernel@after@begindocument\@empty +\edef \@kernel@after@env@document@begin{% + \let\expandafter\noexpand\csname + g__hook_env/document/begin_code_tl\endcsname + \noexpand\@empty} +\let\@kernel@hook@begindocument\@empty +\NewHook{enddocument/afterlastpage} +\NewHook{enddocument/afteraux} +\NewHook{enddocument/info} +\NewHook{enddocument/end} + +\def\enddocument{% + \UseHook{enddocument}% + \@kernel@after@enddocument + \@checkend{document}% + \clearpage + \UseHook{enddocument/afterlastpage}% + \@kernel@after@enddocument@afterlastpage + \begingroup + \if@filesw + \immediate\closeout\@mainaux + \let\@setckpt\@gobbletwo + \let\@newl@bel\@testdef + \@tempswafalse + \makeatletter \@@input\jobname.aux + \fi + \UseHook{enddocument/afteraux}% + \UseHook{enddocument/info}% + \endgroup + \UseHook{enddocument/end}% + \deadcycles\z@\@@end} +\let\@kernel@after@enddocument\@empty +\let\@kernel@after@enddocument@afterlastpage\@empty +\def\@enddocument@kernel@warnings{% + \ifdim \font@submax >\fontsubfuzz\relax + \@font@warning{Size substitutions with differences\MessageBreak + up to \font@submax\space have occurred.\@gobbletwo}% + \fi + \@defaultsubs + \@refundefined + \if@filesw + \ifx \@multiplelabels \relax + \if@tempswa + \@latex@warning@no@line{Label(s) may have changed. + Rerun to get cross-references right}% + \fi + \else + \@multiplelabels + \fi + \fi +} +\AddToHook{enddocument/info}[kernel/filelist]{\@dofilelist} +\AddToHook{enddocument/info}[kernel/warnings]{\@enddocument@kernel@warnings} +\DeclareHookRule{enddocument/info}{kernel/filelist}{before}{kernel/warnings} +\expandafter\let\csname ver@atveryend.sty\endcsname\fmtversion +\newcommand\AfterLastShipout {\AddToHook{enddocument/afterlastpage}} +\newcommand\AtVeryEndDocument {\AddToHook{enddocument/afteraux}} +\newcommand\AtEndAfterFileList{\AddToHook{enddocument/info}} +\newcommand\AtVeryVeryEnd {\AddToHook{enddocument/end}} + +\ExplSyntaxOn +\newcommand\BeforeClearDocument[1] + { \AtEndDocument{#1} + \@DEPRECATED{BeforeClearDocument \tl_to_str:n{#1}} + } +\cs_new:Npn\@DEPRECATED #1 + {\iow_term:x{======~DEPRECATED~USAGE~#1~==========}} +\ExplSyntaxOff + + + +\endinput +%% +%% End of file `lthooks.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/base/lthooks.sty b/Master/texmf-dist/tex/latex-dev/base/lthooks.sty new file mode 100644 index 00000000000..3ee2120eab5 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/base/lthooks.sty @@ -0,0 +1,67 @@ +%% +%% This is file `lthooks.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lthooks.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2020 Frank Mittelbach +%% +%% This file was generated from file(s) of the LaTeX `lthooks Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% 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 +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `lthooks Bundle'. You may however distribute the `lthooks Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/FrankMittelbach/fmitex/ +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: lthooks.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team +\providecommand\lthooksversion{v0.9b} +\providecommand\lthooksdate{2020/07/19} + + + + + + + + + +\RequirePackage{xparse} +\ProvidesExplPackage{lthooks}{\lthooksdate}{\lthooksversion} + {Hook management interface for LaTeX2e} +\@ifl@t@r\fmtversion{2020/10/01} + {} + {\input{lthooks.ltx} + \input{ltshipout.ltx} + \input{ltfilehook.ltx} + } +\ExplSyntaxOn +\hook_debug_off: +\DeclareOption { debug } { \hook_debug_on: + \shipout_debug_on: } +\shipout_debug_off: +\DeclareOption { debug-shipout } { \shipout_debug_on: } +\ProcessOptions +\RequirePackage{filehook-ltx} + +\endinput +%% +%% End of file `lthooks.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex b/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex index 2930f1876e6..e73c4ef2c88 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex +++ b/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex @@ -46,8 +46,8 @@ \ProvidesFile\undefined\begingroup\def\ProvidesFile #1#2[#3]{\endgroup\immediate\write-1{File: #1 #3}} \fi -\ProvidesFile{ltluatex.tex} -[2020/03/07 v1.1m +\ProvidesFile{ltluatex.tex}% +[2020/06/10 v1.1n LuaTeX support for plain TeX (core) ] \edef\etatcatcode{\the\catcode`\@} @@ -58,6 +58,8 @@ \wlog{***************************************************} \expandafter\endinput \fi +\long\def\@gobble#1{} +\long\def\@firstofone#1{#1} \directlua{tex.enableprimitives("",tex.extraprimitives("luatex"))} \ifx\e@alloc\@undefined \ifx\documentclass\@undefined @@ -109,8 +111,6 @@ \errmessage{No room for a new \string#4}% \fi \fi}% -\long\def\@gobble#1{} -\long\def\@firstofone#1{#1} \expandafter\csname newcount\endcsname\e@alloc@attribute@count \expandafter\csname newcount\endcsname\e@alloc@ccodetable@count \expandafter\csname newcount\endcsname\e@alloc@luafunction@count diff --git a/Master/texmf-dist/tex/latex-dev/base/ltnews.cls b/Master/texmf-dist/tex/latex-dev/base/ltnews.cls index 08f098515b7..632f0681175 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltnews.cls +++ b/Master/texmf-dist/tex/latex-dev/base/ltnews.cls @@ -608,6 +608,10 @@ % That's it! +%FMi temp addition until etoolbox is updated +%\RequirePackage{etoolbox-ltx} +%\AddToHook{env/document/begin}{\RemoveFromHook{env/document/begin}[*]} % done in \document + \endinput % CHANGELOG diff --git a/Master/texmf-dist/tex/latex-dev/base/ltshipout.ltx b/Master/texmf-dist/tex/latex-dev/base/ltshipout.ltx new file mode 100644 index 00000000000..c473f64fae7 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/base/ltshipout.ltx @@ -0,0 +1,424 @@ +%% +%% This is file `ltshipout.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ltshipout.dtx (with options: `2ekernel') +%% +%% This is a generated file. +%% +%% Copyright 2020 Frank Mittelbach +%% +%% This file was generated from file(s) of the LaTeX `lthooks Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% 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 +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `lthooks Bundle'. You may however distribute the `lthooks Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/FrankMittelbach/fmitex/ +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: ltshipout.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team +\providecommand\ltshipoutversion{v0.9a} +\providecommand\ltshipoutdate{2020/07/15} + + + + + + + + + + +\ExplSyntaxOn +\bool_new:N \g__shipout_debug_bool +\cs_new_eq:NN \__shipout_debug:n \use_none:n +\cs_new_protected:Npn \shipout_debug_on: + { + \bool_gset_true:N \g__shipout_debug_bool + \__shipout_debug_gset: + } +\cs_new_protected:Npn \shipout_debug_off: + { + \bool_gset_false:N \g__shipout_debug_bool + \__shipout_debug_gset: + } +\cs_new_protected:Npn \__shipout_debug_gset: + { + \cs_gset_protected:Npx \__shipout_debug:n ##1 + { \bool_if:NT \g__shipout_debug_bool {##1} } + } + +\hook_new:n{shipout/before} +\hook_new:n{shipout/foreground} +\hook_new:n{shipout/background} +\hook_new:n{shipout/firstpage} +\hook_new:n{shipout/lastpage} + +\box_new:N \l_shipout_box +\cs_set_eq:NN \ShipoutBox \l_shipout_box + +\cs_set:Npn\__shipout_execute: { + \tl_set:Nx \l__shipout_group_level_tl + { \int_value:w \tex_currentgrouplevel:D } + \tex_afterassignment:D \__shipout_execute_test_level: + \tex_setbox:D \l_shipout_box +} + +\cs_gset_eq:NN \shipout \__shipout_execute: + +\tl_new:N \l__shipout_group_level_tl + +\cs_new:Npn \__shipout_execute_test_level: { + \int_compare:nNnT + \l__shipout_group_level_tl < \tex_currentgrouplevel:D + \tex_aftergroup:D + \__shipout_execute_cont: +} + +\cs_new:Npn \__shipout_execute_cont: { + \box_if_empty:NTF \l_shipout_box + { \PackageWarning{ltshipout}{Ignoring~ void~ shipout~ box} } + { + \bool_gset_false:N \g__shipout_discard_bool + \set@typeset@protect + \__shipout_get_box_size:N \l_shipout_box + \hook_use:n {shipout/before} + \int_gincr:N \g_shipout_totalpages_int + \bool_if:NTF \g__shipout_discard_bool + { \PackageInfo{ltshipout}{Completed~ page~ discarded} + \bool_gset_false:N \g__shipout_discard_bool + \tex_deadcycles:D \c_zero_int + } + { \box_if_empty:NTF \l_shipout_box + { \PackageWarning{ltshipout}{ + Shipout~ box~ was~ voided~ by~ hook,\MessageBreak + ignoring~ shipout~ box } + } + { + \int_gincr:N \g_shipout_readonly_int + \__shipout_debug:n { + \typeout{Absolute~ page~ =~ \int_use:N \g_shipout_readonly_int + \space (target:~ \@abspage@last)} + } + \__shipout_get_box_size:N \l_shipout_box + \@kernel@before@shipout@foreground + \hook_if_empty:nF {shipout/foreground} + { \__shipout_add_foreground_picture:n + { \hook_use:n {shipout/foreground} } } + \hook_if_empty:nF {shipout/background} + { \__shipout_add_background_picture:n + { \hook_use:n {shipout/background} } } + \__shipout_execute_firstpage_hook: + \int_compare:nNnT \@abspage@last = \g_shipout_readonly_int + { \hook_if_empty:nF {shipout/lastpage} + { \__shipout_debug:n { \typeout{Executing~ lastpage~ hook~ + on~ page~ \int_use:N \g_shipout_readonly_int } } + \__shipout_add_foreground_box:n { \UseHook{shipout/lastpage} + \@kernel@after@shipout@lastpage } + } + \bool_gset_true:N \g__shipout_lastpage_handled_bool + } + \cs_set_eq:NN \protect \exp_not:N + \tex_shipout:D \box_use:N \l_shipout_box + } + } + } +} + +\let\@kernel@after@shipout@lastpage\@empty +\let\@kernel@before@shipout@foreground\@empty + +\cs_new:Npn \__shipout_execute_firstpage_hook: { + \hook_if_empty:nF {shipout/firstpage} + { \__shipout_add_background_box:n { \UseHook{shipout/firstpage} } } + \cs_gset_eq:NN \__shipout_execute_firstpage_hook: \prg_do_nothing: + \cs_gset:Npn \__shipout_add_firstpage_material:Nn ##1 ##2 { + \PackageWarning{ltshipout}{ + First~ page~ is~ already~ shipped~ out,~ ignoring\MessageBreak + \string##1 } + } +} + +\bool_new:N \g__shipout_lastpage_handled_bool + +\cs_new:Npn \__shipout_add_firstpage_material:Nn #1#2 { + \AddToHook{shipout/firstpage}{#2} +} + +\cs_new:Npn \__shipout_get_box_size:N #1 { + \dim_set:Nn \l_shipout_box_ht_dim { \box_ht:N #1 } + \dim_set:Nn \l_shipout_box_dp_dim { \box_dp:N #1 } + \dim_set:Nn \l_shipout_box_wd_dim { \box_wd:N #1 } + \dim_set:Nn \l_shipout_box_ht_plus_dp_dim { \l_shipout_box_ht_dim + + \l_shipout_box_dp_dim } +} + +\dim_new:N \l_shipout_box_ht_dim +\dim_new:N \l_shipout_box_dp_dim +\dim_new:N \l_shipout_box_wd_dim +\dim_new:N \l_shipout_box_ht_plus_dp_dim + +\bool_new:N \g__shipout_discard_bool + +\box_new:N \l__shipout_tmp_box +\tl_new:N \l__shipout_saved_badness_tl + +\cs_new:Npn \__shipout_add_background_box:n #1 +{ \__shipout_get_box_size:N \l_shipout_box + \box_if_vertical:NTF \l_shipout_box + { + \tl_set:Nx \l__shipout_saved_badness_tl + { \vfuzz=\the\vfuzz\relax + \vbadness=\the\vbadness\relax } + \vfuzz=\c_max_dim + \vbadness=\c_max_int + \vbox_set_to_ht:Nnn \l_shipout_box \l_shipout_box_ht_plus_dp_dim + { + \hbox_set:Nn \l__shipout_tmp_box + { \l__shipout_saved_badness_tl #1 } + \box_set_wd:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim + \skip_zero:N \baselineskip + \skip_zero:N \lineskip + \skip_zero:N \lineskiplimit + \box_use:N \l__shipout_tmp_box + \vbox_unpack:N \l_shipout_box + \kern \c_zero_dim + } + \box_set_ht:Nn \l_shipout_box \l_shipout_box_ht_dim + \box_set_dp:Nn \l_shipout_box \l_shipout_box_dp_dim + \l__shipout_saved_badness_tl + } + { + \box_if_horizontal:NT \l_shipout_box + { + \tl_set:Nx \l__shipout_saved_badness_tl + { \hfuzz=\the\hfuzz\relax + \hbadness=\the\hbadness\relax } + \hfuzz=\c_max_dim + \hbadness=\c_max_int + \hbox_set_to_wd:Nnn \l_shipout_box \l_shipout_box_wd_dim + { + \hbox_set:Nn \l__shipout_tmp_box + { \l__shipout_saved_badness_tl #1 } + \box_set_wd:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim + \box_move_up:nn + \l_shipout_box_ht_dim + { \box_use:N \l__shipout_tmp_box } + \hbox_unpack:N \l_shipout_box + } + \l__shipout_saved_badness_tl + } + } +} + +\cs_new:Npn \__shipout_add_foreground_box:n #1 +{ + \box_if_vertical:NTF \l_shipout_box + { + \tl_set:Nx \l__shipout_saved_badness_tl + { \vfuzz=\the\vfuzz\relax + \vbadness=\the\vbadness\relax } + \vfuzz=\c_max_dim + \vbadness=\c_max_int + \vbox_set_to_ht:Nnn \l_shipout_box \l_shipout_box_ht_plus_dp_dim + { + \hbox_set:Nn \l__shipout_tmp_box + { \l__shipout_saved_badness_tl #1 } + \box_set_wd:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim + \skip_zero:N \baselineskip + \skip_zero:N \lineskip + \skip_zero:N \lineskiplimit + \vbox_unpack:N \l_shipout_box + \kern -\l_shipout_box_ht_plus_dp_dim + \box_use:N \l__shipout_tmp_box + \kern \l_shipout_box_ht_plus_dp_dim + } + \l__shipout_saved_badness_tl + \box_set_ht:Nn \l_shipout_box \l_shipout_box_ht_dim + \box_set_dp:Nn \l_shipout_box \l_shipout_box_dp_dim + } + { + \box_if_horizontal:NT \l_shipout_box + { + \tl_set:Nx \l__shipout_saved_badness_tl + { \hfuzz=\the\hfuzz\relax + \hbadness=\the\hbadness\relax } + \hfuzz=\c_max_dim + \hbadness=\c_max_int + \hbox_set_to_wd:Nnn \l_shipout_box \l_shipout_box_wd_dim + { + \hbox_unpack:N \l_shipout_box + \kern -\box_wd:N \l_shipout_box + \hbox_set:Nn \l__shipout_tmp_box + { \l__shipout_saved_badness_tl #1 } + \box_set_wd:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim + \box_move_up:nn { \box_ht:N \l_shipout_box } + { \box_use:N \l__shipout_tmp_box } + \kern \box_wd:N \l_shipout_box + }% + \l__shipout_saved_badness_tl + } + } +} + +\tl_gput_right:Nn \@kernel@after@begindocument { + \tl_const:Nx \c__shipout_horigin_tl + { + \cs_if_exist_use:NTF \pdfvariable { horigin } + { \cs_if_exist_use:NF \pdfhorigin { 1in } } + } + \tl_const:Nx \c__shipout_vorigin_tl + { + \cs_if_exist_use:NTF \pdfvariable { vorigin } + { \cs_if_exist_use:NF \pdfvorigin { 1in } } + } +} + +\cs_new:Npn \__shipout_picture_overlay:n #1 { + \kern -\c__shipout_horigin_tl \scan_stop: + \vbox_to_zero:n { + \kern -\c__shipout_vorigin_tl \scan_stop: + \unitlength 1pt \scan_stop: + \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim { \ignorespaces #1 } + \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim + \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim + \box_use:N \l__shipout_tmp_box + \tex_vss:D + } +} + +\cs_new:Npn \__shipout_add_background_picture:n #1 { + \__shipout_add_background_box:n { \__shipout_picture_overlay:n {#1} } +} + +\cs_new:Npn \__shipout_add_foreground_picture:n #1 { + \__shipout_add_foreground_box:n { \__shipout_picture_overlay:n {#1} } +} + +\cs_new:Npn \shipout_discard: { + \bool_gset_true:N \g__shipout_discard_bool +} + + + +\int_new:N \g_shipout_readonly_int +\cs_new_eq:NN \ReadonlyShipoutCounter \g_shipout_readonly_int + +\int_new:N \g_shipout_totalpages_int +\cs_new_eq:NN \c@totalpages \g_shipout_totalpages_int +\cs_new:Npn \thetotalpages { \arabic{totalpages} } + +\xdef\@abspage@last{\number\maxdimen} + +\g@addto@macro \@kernel@after@enddocument { + \int_compare:nNnT \@abspage@last = \maxdimen + { + \xdef\@abspage@last{ \int_eval:n {\g_shipout_readonly_int + 1} } + } +} +\g@addto@macro \@kernel@after@enddocument@afterlastpage { + \int_compare:nNnF \g_shipout_readonly_int = 0 + { + \if@filesw + \iow_now:Nx \@auxout { + \gdef\string\@abspage@last {\int_use:N \g_shipout_readonly_int}} + \fi + \bool_if:NF \g__shipout_lastpage_handled_bool + { \tex_shipout:D\vbox to\textheight{ + \hbox{\UseHook{shipout/lastpage} \@kernel@after@shipout@lastpage } + \__shipout_excuse_extra_page: + \null + } + } + } +} + +\cs_new:Npn \__shipout_excuse_extra_page: { + \vfil + \begin{center} + \bfseries Temporary~ page! + \end{center} + \LaTeX{}~ was~ unable~ to~ guess~ the~ total~ number~ of~ pages~ + correctly.~ ~ As~ there~ was~ some~ unprocessed~ data~ that~ + should~ have~ been~ added~ to~ the~ final~ page~ this~ extra~ + page~ has~ been~ added~ to~ receive~ it. + \par + If~ you~ rerun~ the~ document~ (without~ altering~ it)~ this~ + surplus~ page~ will~ go~ away,~ because~ \LaTeX{}~ now~ knows~ + how~ many~ pages~ to~ expect~ for~ this~ document. + \vfil +} + + +\cs_new_eq:NN \DiscardShipoutBox \shipout_discard: + +\renewcommand \AtBeginDvi {\__shipout_add_firstpage_material:Nn \AtBeginDvi} + +\cs_new_eq:NN \DebugShipoutOn \shipout_debug_on: +\cs_new_eq:NN \DebugShipoutOff \shipout_debug_off: + + + +\cs_new_eq:NN \AtBeginShipoutBox \ShipoutBox + +\cs_set_eq:NN\AtBeginShipoutInit\@empty + +\newcommand\AtBeginShipout {\AddToHook{shipout/before}} +\newcommand\AtBeginShipoutNext {\AddToHookNext{shipout/before}} + +\newcommand\AtBeginShipoutFirst{\__shipout_add_firstpage_material:Nn \AtBeginShipoutFirst} + +\cs_new:Npn \ShipoutBoxHeight { \dim_use:N \l_shipout_box_ht_dim } +\cs_new:Npn \ShipoutBoxDepth { \dim_use:N \l_shipout_box_dp_dim } +\cs_new:Npn \ShipoutBoxWidth { \dim_use:N \l_shipout_box_wd_dim } + +\cs_new_eq:NN \AtBeginShipoutDiscard \DiscardShipoutBox + +\cs_new_eq:NN \AtBeginShipoutAddToBox \__shipout_add_background_box:n +\cs_new_eq:NN \AtBeginShipoutAddToBoxForeground \__shipout_add_foreground_box:n +\cs_new_eq:NN\AtBeginShipoutUpperLeft \__shipout_add_background_picture:n +\cs_new_eq:NN\AtBeginShipoutUpperLeftForeground \__shipout_add_foreground_picture:n + +\expandafter\cs_set_eq:NN\csname ver@atbegshi.sty\endcsname\fmtversion +\@namedef {ver@atbegshi.sty}{2020/10/01} + +\cs_new_eq:NN\EveryShipout\AtBeginShipout +\cs_new_eq:NN\AtNextShipout\AtBeginShipoutNext +\expandafter\cs_set_eq:NN\csname ver@everyshi.sty\endcsname\fmtversion +\@namedef {ver@everyshi.sty}{2020/10/01} + +\cs_new:Npn \AtEndDvi {\AddToHook{shipout/lastpage}} +\expandafter\cs_set_eq:NN\csname ver@atenddvi.sty\endcsname\fmtversion +\@namedef {ver@atenddvi.sty}{2020/10/01} + +\ExplSyntaxOff + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%% +%% End of file `ltshipout.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls b/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls index 18ca996958a..09520e6cfd2 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls +++ b/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltxdoc} - [2019/09/16 v2.0y Standard LaTeX documentation class] + [2020/05/17 v2.0z Standard LaTeX documentation class] \DeclareOption{a5paper}{\@latexerr{Option not supported}% {}} \DeclareOption*{% @@ -158,13 +158,16 @@ {\def\currentfile{#1.dtx}}% \ifnum\@auxout=\@partaux \@latexerr{\string\include\space cannot be nested}\@eha - \else \@docinclude#1 \fi} + \else + \set@curr@file@trim@spaces{#1}% + \expandafter\@docinclude\expandafter{\@curr@file} + \fi} \def\@docinclude#1 {\clearpage -\if@filesw \immediate\write\@mainaux{\string\@input{#1.aux}}\fi +\if@filesw \immediate\write\@mainaux{\string\@input{"#1.aux"}}\fi \@tempswatrue\if@partsw \@tempswafalse\edef\@tempb{#1}\@for \@tempa:=\@partlist\do{\ifx\@tempa\@tempb\@tempswatrue\fi}\fi \if@tempswa \let\@auxout\@partaux \if@filesw -\immediate\openout\@partaux #1.aux +\immediate\openout\@partaux "#1.aux" \immediate\write\@partaux{\relax}\fi \let\@ltxdoc@PrintIndex\PrintIndex \let\PrintIndex\relax diff --git a/Master/texmf-dist/tex/latex-dev/base/shortvrb.sty b/Master/texmf-dist/tex/latex-dev/base/shortvrb.sty index 804f54aa0d0..adeae1eca9d 100644 --- a/Master/texmf-dist/tex/latex-dev/base/shortvrb.sty +++ b/Master/texmf-dist/tex/latex-dev/base/shortvrb.sty @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{shortvrb} - [2019/12/16 v2.1l + [2020/06/15 v2.1m Standard LaTeX documentation package (FMi)] %% %% Package `doc' to use with LaTeX 2e diff --git a/Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty new file mode 100644 index 00000000000..1e7ca0773cf --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty @@ -0,0 +1,65 @@ +%% +%% This is file `srclfile-ltx.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ltfilehook.dtx (with options: `scrlfile-draft') +%% +%% This is a generated file. +%% +%% Copyright 2020 Frank Mittelbach +%% +%% This file was generated from file(s) of the LaTeX `lthooks Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% 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 +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `lthooks Bundle'. You may however distribute the `lthooks Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/FrankMittelbach/fmitex/ +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team +\providecommand\ltfilehookversion{v0.9a} +\providecommand\ltfilehookdate{2020/07/19} +\newcommand\BeforeClass[2] + {\AddToHook{file/before/#1.cls}{#2}} +\newcommand\AfterClass [2] + {\AddToHook{file/after/#1.cls}{#2}} +\newcommand\AfterAtEndOfClass [2] + {\AddToHook{class/after/#1}{#2}} +\newcommand\BeforePackage [2] + {\AddToHook{package/before/#1.sty}{#2}} +\newcommand\AfterPackage [2] + {\AddToHook{file/after/#1.sty}{#2}} +\newcommand\AfterEndOfPackage [2] + {\AddToHook{package/after/#1}{#2}} +\newcommand\BeforeFile [2] + {% + \typeout{BeforeFile: #1!!!}% + \AddToHook{file/before/#1}{#2}} +\newcommand\AfterFile [2] + {% + \typeout{AfterFile: #1!!!}% + \AddToHook{file/after/#1}{#2}} +\expandafter\let\csname ver@scrlfile.sty\endcsname\fmtversion +\@namedef {ver@scrlfile.sty}{2020/10/01} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%% +%% End of file `srclfile-ltx.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty b/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty new file mode 100644 index 00000000000..84faaeb8b54 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty @@ -0,0 +1,72 @@ +%% +%% This is file `structuredlog.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ltfilehook.dtx (with options: `structuredlog') +%% +%% This is a generated file. +%% +%% Copyright 2020 Frank Mittelbach +%% +%% This file was generated from file(s) of the LaTeX `lthooks Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% 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 +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `lthooks Bundle'. You may however distribute the `lthooks Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/FrankMittelbach/fmitex/ +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team +\providecommand\ltfilehookversion{v0.9a} +\providecommand\ltfilehookdate{2020/07/19} +\ProvidesExplPackage + {structuredlog}{\ltfilehookdate}{\ltfilehookversion} + {Structuring the TeX transcript file} + +\int_new:N \g__filehook_nesting_level_int + +\tl_new:N \g__filehook_nesting_prefix_tl +\tl_gset:Nn \g__filehook_nesting_prefix_tl { } +\AddToHook{file/before}{ + \int_gincr:N \g__filehook_nesting_level_int + \tl_gput_right:Nn\g__filehook_nesting_prefix_tl {=} + \iow_term:x { + \g__filehook_nesting_prefix_tl \space + ( LEVEL~ \int_use:N \g__filehook_nesting_level_int \space START )~ + \CurrentFile ^^J + } +} +\AddToHookNext{file/after}{ + \AddToHook{file/after}{ + \iow_term:x { + \g__filehook_nesting_prefix_tl \space + ( LEVEL~ \int_use:N \g__filehook_nesting_level_int \space STOP )~ + \CurrentFile ^^J + } + \int_gdecr:N \g__filehook_nesting_level_int + \tl_gset:Nx \g__filehook_nesting_prefix_tl + {\exp_after:wN \use_none:n \g__filehook_nesting_prefix_tl} + } +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%% +%% End of file `structuredlog.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/base/tuenc.def b/Master/texmf-dist/tex/latex-dev/base/tuenc.def index 7305cc90dca..c7e3b1fded1 100644 --- a/Master/texmf-dist/tex/latex-dev/base/tuenc.def +++ b/Master/texmf-dist/tex/latex-dev/base/tuenc.def @@ -58,20 +58,45 @@ \expandafter\expandafter\expandafter\endinput \else \def\UnicodeFontTeXLigatures{+tlig;} - \def\reserved@a#1{% - \def\@remove@tlig##1{\@remove@tlig@##1\@nil#1\@nil\relax} - \def\@remove@tlig@##1#1{\@remove@tlig@@##1}} - \edef\reserved@b{\detokenize{+tlig;}} - \expandafter\reserved@a\expandafter{\reserved@b} - \def\@remove@tlig@@#1\@nil#2\relax{#1} - \def\remove@tlig#1{% - \begingroup - \font\remove@tlig - \expandafter\@remove@tlig\expandafter{\fontname\font}% - \remove@tlig - \char#1\relax - \endgroup - } + \ifnum\luatexversion<110 + \def\reserved@a#1{% + \def\@remove@tlig##1{\@remove@tlig@##1\@nil#1\@nil\relax} + \def\@remove@tlig@##1#1{\@remove@tlig@@##1}} + \edef\reserved@b{\detokenize{+tlig;}} + \expandafter\reserved@a\expandafter{\reserved@b} + \def\@remove@tlig@@#1\@nil#2\relax{#1} + \def\remove@tlig#1{% + \begingroup + \font\remove@tlig + \expandafter\@remove@tlig\expandafter{\fontname\font}% + \remove@tlig + \char#1\relax + \endgroup + } + \else + \newluafunction\@remove@tlig@@@@ + \def\now@and@everyjob#1{\toksapp\everyjob{#1}#1} + \now@and@everyjob{\directlua{ + local rawchar_func = token.create'@remove@tlig@@@@'.index + local forcehmode = tex.forcehmode + local put_next = token.put_next + local glyph_id = node.id'glyph' + local rawchar_token = token.new(rawchar_func, token.command_id'lua_call') + lua.get_functions_table()[rawchar_func] = function() + local mode = tex.nest.top.mode + if mode == 1 or mode == -1 then + put_next(rawchar_token) + return forcehmode(true) + end + local n = node.new(glyph_id, 256) + n.font = font.current() + n.char = token.scan_int() + return node.write(n) + end + token.set_lua('@remove@tlig@@@', rawchar_func, 'global', 'protected') + }} + \def\remove@tlig#1{\@remove@tlig@@@#1\relax} + \fi \fi \else \def\UnicodeFontTeXLigatures{mapping=tex-text;} diff --git a/Master/texmf-dist/tex/latex-dev/graphics/lscape.sty b/Master/texmf-dist/tex/latex-dev/graphics/lscape.sty index e4ece0f218d..d9f2daee5a8 100644 --- a/Master/texmf-dist/tex/latex-dev/graphics/lscape.sty +++ b/Master/texmf-dist/tex/latex-dev/graphics/lscape.sty @@ -21,7 +21,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{lscape} - [2000/10/22 v3.01 Landscape Pages (DPC)] + [2020/05/28 v3.02 Landscape Pages (DPC)] \newif\ifGin@pdftex \Gin@pdftexfalse \DeclareOption{pdftex}{% @@ -31,11 +31,11 @@ \DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}} \ProcessOptions \RequirePackage{graphics} -\let\LS@makecol=\@makecol -\let\LS@makefcolumn=\@makefcolumn \def\LS@rot{% \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}} \def\landscape{% + \let\LS@makecol=\@makecol + \let\LS@makefcolumn=\@makefcolumn \clearpage \begingroup \vsize=\textwidth diff --git a/Master/texmf-dist/tex/latex-dev/tools/array.sty b/Master/texmf-dist/tex/latex-dev/tools/array.sty index cbf82052b2c..28162839cb1 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/array.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/array.sty @@ -46,7 +46,7 @@ \DeclareCurrentRelease{}{2020-10-01} \ProvidesPackage{array} - [2020/10/01 v2.5b Tabular extension package (FMi)] + [2020/10/01 v2.5c Tabular extension package (FMi)] %% \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}} @@ -330,20 +330,22 @@ \setlength{\extratabsurround}{2pt} \newlength{\backup@length} \newcommand{\firsthline}{% - \multicolumn1c{% + \multicolumn1{@{}c@{}}{% \global\backup@length\ht\@arstrutbox \global\advance\backup@length\dp\@arstrutbox \global\advance\backup@length\arrayrulewidth \raise\extratabsurround\copy\@arstrutbox + \kern-1sp% }\\[-\backup@length]\hline } -\newcommand{\lasthline}{\hline\multicolumn1c{% +\newcommand{\lasthline}{\hline\multicolumn1{@{}c@{}}{% \global\backup@length2\ht\@arstrutbox \global\advance\backup@length2\dp\@arstrutbox \global\advance\backup@length\arrayrulewidth }\\[-\backup@length]% - \multicolumn1c{% + \multicolumn1{@{}c@{}}{% \lower\extratabsurround\copy\@arstrutbox + \kern-1sp% }% } \CheckCommand*\@xhline{\ifx\reserved@a\hline diff --git a/Master/texmf-dist/tex/latex-dev/tools/varioref.sty b/Master/texmf-dist/tex/latex-dev/tools/varioref.sty index 532d7fa572d..57c3227b5b3 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/varioref.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/varioref.sty @@ -52,7 +52,7 @@ \DeclareCurrentRelease{}{2019-10-01} \ProvidesPackage{varioref} - [2020/01/23 v1.6c package for extended references (FMi)] + [2020/07/20 v1.6d package for extended references (FMi)] %% @@ -108,6 +108,7 @@ \def\reftextfaraway#1{op bladsy~\pageref{#1}}% \def\reftextpagerange#1#2{op bladsye~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} tot~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{american} {\vref@addto\extrasamerican{% @@ -120,6 +121,7 @@ \def\reftextfaraway#1{on page~\pageref{#1}}% \def\reftextpagerange#1#2{on pages~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{arabic} {\vref@addto\extrasarabic{% @@ -131,6 +133,7 @@ \def\reftextfaraway#1{بالصفحة رقم~\pageref{#1}}% \def\reftextpagerange#1#2{بالصفحات~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} حتى~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{austrian} {\vref@addto\extrasaustrian{% @@ -142,6 +145,7 @@ \def\reftextfaraway#1{auf Seite~\pageref{#1}}% \def\reftextpagerange#1#2{auf Seiten~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} bis~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{naustrian} {\vref@addto\extrasnaustrian{% @@ -153,6 +157,7 @@ \def\reftextfaraway#1{auf Seite~\pageref{#1}}% \def\reftextpagerange#1#2{auf Seiten~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} bis~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{basque} {\vref@addto\extrasbasque{% @@ -164,6 +169,7 @@ \def\reftextfaraway#1{~\pageref{#1}. orrialdean}% \def\reftextpagerange#1#2{~\pageref{#1}--\pageref{#2} orrialdeetan}% \def\reftextlabelrange#1#2{\ref{#1}.etik \ref{#2}.eraino}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{bahasam} {\vref@addto\extrasbahasam{% @@ -175,6 +181,7 @@ \def\reftextfaraway#1{pada muka surat~\pageref{#1}}% \def\reftextpagerange#1#2{pada muka surat~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1}--\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{brazil} {\vref@addto\extrasbrazil{% @@ -189,6 +196,7 @@ \def\reftextfaraway#1{na p\'agina~\pageref{#1}}% \def\reftextpagerange#1#2{nas p\'aginas~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} a~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{breton} {\vref@excuse{breton}% @@ -204,6 +212,7 @@ on pages~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\vref@stringwarning\reflabelpagerange \ref{#1} to~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{bulgarian}% {\vref@addto\extrasbulgarian{% @@ -233,6 +242,7 @@ \cyrs\cyrt\cyrr\cyra\cyrn\cyri\cyrc\cyri ~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} \cyrd\cyro~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{catalan} {\vref@addto\extrascatalan{% @@ -245,6 +255,7 @@ \def\reftextpagerange#1#2{a les p\`agines~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} a~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{croatian} {\vref@addto\extrascroatian{% @@ -256,6 +267,7 @@ \def\reftextfaraway#1{na stranici~\pageref{#1}}% \def\reftextpagerange#1#2{na stranicama~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} do~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{czech} {%\vref@excuse{czech}% @@ -268,6 +280,7 @@ \def\reftextfaraway#1{na stran\v{e}~\pageref{#1}}% \def\reftextpagerange#1#2{na stran\'ach~\pageref{#1}\--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} a\v{z}~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{danish} {\vref@addto\extrasdanish{% @@ -283,6 +296,7 @@ \def\reftextfaraway#1{p\aa{} side~\pageref{#1}}% \def\reftextpagerange#1#2{p\aa{} side~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} til~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{dutch} {\vref@addto\extrasdutch{% @@ -299,6 +313,7 @@ \def\reftextfaraway#1{op \refpagename~\pageref{#1}}% \def\reftextpagerange#1#2{op pagina's~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1}--\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{english} {\vref@addto\extrasenglish{% @@ -311,6 +326,7 @@ \def\reftextfaraway#1{on page~\pageref{#1}}% \def\reftextpagerange#1#2{on pages~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{esperanto} {\vref@addto\extrasesperanto{% @@ -325,6 +341,7 @@ \def\reftextfaraway#1{en pa\^go~\pageref{#1}}% \def\reftextpagerange#1#2{en pa\^goj~\pageref{#1} \^gis \pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} \^gis~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{finnish} {\vref@addto\extrasfinnish{% @@ -338,6 +355,7 @@ \def\reftextfaraway#1{sivulla~\pageref{#1}}% \def\reftextpagerange#1#2{sivuilla~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1}--\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{french} {\vref@addto\extrasfrench{% @@ -350,6 +368,7 @@ \def\reftextfaraway#1{page~\pageref{#1}}% \def\reftextpagerange#1#2{pages~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} \`a~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{galician} {\vref@addto\extrasgalician{% @@ -362,6 +381,7 @@ \def\reftextpagerange#1#2{% nas p\'axinas~\pageref{#1}-\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} a~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{german} {\vref@addto\extrasgerman{% @@ -373,6 +393,7 @@ \def\reftextfaraway#1{auf Seite~\pageref{#1}}% \def\reftextpagerange#1#2{auf den Seiten~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} bis~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{ngerman} {\vref@addto\extrasngerman{% @@ -384,6 +405,7 @@ \def\reftextfaraway#1{auf Seite~\pageref{#1}}% \def\reftextpagerange#1#2{auf den Seiten~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} bis~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{greek} {\vref@addto\extrasgreek{% @@ -398,6 +420,7 @@ \def\reftextpagerange#1#2{stis sel'ides\nobreakspace \pageref{#1}---\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} ws\nobreakspace\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{icelandic} {\vref@addto\extrasicelandic{% @@ -413,6 +436,7 @@ \def\reftextfaraway#1{\'{a} s\'{i}{\dh}u~\pageref{#1}}% \def\reftextpagerange#1#2{\'{a} s\'{i}{\dh}um~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} til~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{italian} {\vref@addto\extrasitalian{% @@ -427,6 +451,20 @@ \def\reftextfaraway#1{a pagina~\pageref{#1}}% \def\reftextpagerange#1#2{nelle pagine~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{da~\ref{#1} a~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat + }} +\DeclareOption{japanese} + {\vref@addto\extrasjapanese{% + \def\reftextfaceafter {\reftextvario{見開き}{次}頁}% + \def\reftextfacebefore{\reftextvario{見開き}{前}頁}% + \def\reftextafter {\reftextvario{直後の}{次}頁}% + \def\reftextbefore {\reftextvario{直前の}{前}頁}% + \def\reftextcurrent {\reftextvario{この}{現}頁}% + \def\reftextfaraway#1{\pageref{#1}頁}% + \def\reftextpagerange#1#2{\pageref{#1}頁から\pageref{#2}頁}% + \def\reftextlabelrange#1#2{\ref{#1}から\ref{#2}}% + \def\vrefrangeformat#1#2#3{\vpagerefrange[{#1}]{#2}{#3}の% + \reftextlabelrange{#2}{#3}}% }} \DeclareOption{magyar} {\vref@addto\extrasmagyar{% @@ -442,6 +480,7 @@ on pages~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\vref@stringwarning\reflabelpagerange \ref{#1} to~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }% \AtBeginDocument{\providecommand\aza[1]{a/az% \PackageError{varioref}{% @@ -463,6 +502,7 @@ \def\reftextfaraway#1{p\aa{} side~\pageref{#1}}% \def\reftextpagerange#1#2{p\aa{} side~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} til~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{nynorsk} {\vref@addto\extrasnynorsk{% @@ -474,6 +514,7 @@ \def\reftextfaraway#1{p\aa{} side~\pageref{#1}}% \def\reftextpagerange#1#2{p\aa{} side~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} til~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{polish} {\vref@addto\extraspolish{% @@ -488,6 +529,7 @@ \def\reftextfaraway#1{na stronie~\pageref{#1}}% \def\reftextpagerange#1#2{na stronach~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{od~\ref{#1} do~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{portuges} {\vref@addto\extrasportuges{% @@ -501,6 +543,7 @@ \def\reftextfaraway#1{na p\'agina~\pageref{#1}}% \def\reftextpagerange#1#2{nas p\'aginas~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} a~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{romanian} {\vref@addto\extrasromanian{% @@ -514,6 +557,7 @@ \def\reftextfaraway#1{pe pagina~\pageref{#1}}% \def\reftextpagerange#1#2{pe paginile~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} la~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{russian} {\vref@addto\extrasrussian{% @@ -538,6 +582,7 @@ \def\reftextpagerange#1#2{\cyrn\cyra\ \cyrs\cyrt\cyrr\cyra\cyrn \cyri\cyrc\cyra\cyrh~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\cyrs~\ref{#1}\ \cyrp\cyro~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{slovak} {\vref@addto\extrasslovak{% @@ -553,6 +598,7 @@ \def\reftextfaraway#1{na strane~\pageref{#1}}% \def\reftextpagerange#1#2{na stran\'ach~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} a\v z~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{slovene} {\vref@addto\extrasslovene{% @@ -564,6 +610,7 @@ \def\reftextfaraway#1{na strani~\pageref{#1}}% \def\reftextpagerange#1#2{na straneh~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{od~\ref{#1} do~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{spanish} {\vref@addto\extrasspanish{% @@ -576,6 +623,7 @@ \def\reftextpagerange#1#2{en las p\'aginas~\pageref{#1}% -\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} a~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{swedish} {\vref@addto\extrasswedish{% @@ -591,6 +639,7 @@ \def\reftextpagerange#1#2{p\aa\ sidorna~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} till~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{turkish} {\vref@excuse{turkish}% @@ -604,6 +653,7 @@ \def\reftextfaraway#1{on page~\pageref{#1}}% \def\reftextpagerange#1#2{on pages~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{ukrainian} {\vref@addto\extrasukrainian{% @@ -626,6 +676,7 @@ \def\reftextpagerange#1#2{\cyrn\cyra\ \cyrs\cyrt\cyro\cyrr\cyrii \cyrn\cyrk\cyra\cyrh~\pageref{#1}--\pageref{#2}}% \def\reftextlabelrange#1#2{\cyrz~\ref{#1}\ \cyrd\cyro~\ref{#2}}% + \let\vrefrangeformat\vrefrangedefaultformat }} \DeclareOption{francais}{% \typeout{Please use `french' instead of `francais'}% @@ -798,8 +849,10 @@ \fi } \newcommand\vpagerefrange{\@ifstar\@svpagerefrange\@vpagerefrange} -\newcommand\vrefrange[3][\reftextcurrent] - {\reftextlabelrange{#2}{#3} \vpagerefrange[{#1}]{#2}{#3}} +\newcommand\vrefrange[1][\reftextcurrent]{\vrefrangeformat{#1}} +\def\vrefrangedefaultformat#1#2#3{% + \reftextlabelrange{#2}{#3} \vpagerefrange[{#1}]{#2}{#3}} +\let\vrefrangeformat\vrefrangedefaultformat \DeclareRobustCommand\Vref{\@ifstar {\Vref@star}% {\Vr@f}} diff --git a/Master/texmf-dist/tex/latex-dev/tools/verbatim.sty b/Master/texmf-dist/tex/latex-dev/tools/verbatim.sty index ab0f603ba5d..647fe064567 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/verbatim.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/verbatim.sty @@ -39,7 +39,7 @@ %% Copyright (C) 1989--2003 by Rainer Sch\"opf. All rights reserved. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{verbatim} - [2019/11/10 v1.5r LaTeX2e package for verbatim enhancements] + [2020-07-07 v1.5u LaTeX2e package for verbatim enhancements] \@ifundefined{verbatim@@@}{}{\endinput} \newtoks\every@verbatim \every@verbatim={} @@ -206,8 +206,12 @@ \@ifstar{\verbatim@input\relax}% {\verbatim@input{\frenchspacing\@vobeyspaces}}} \def\verbatim@input#1#2{% - \IfFileExists {#2}{\@verbatim #1\relax - \verbatim@readfile{\@filef@und}\endtrivlist\endgroup\@doendpe}% + \IfFileExists {#2}{% + \expandafter\@swaptwoargs\expandafter + {\expandafter{\@filef@und}}% + {\@verbatim #1\relax + \verbatim@readfile}% + \endtrivlist\endgroup\@doendpe}% {\typeout {No file #2.}\endgroup}} \endinput %% -- cgit v1.2.3