summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/filehook/README2
-rw-r--r--Master/texmf-dist/doc/latex/filehook/filehook.pdfbin266229 -> 301526 bytes
-rw-r--r--Master/texmf-dist/source/latex/filehook/filehook.dtx688
-rw-r--r--Master/texmf-dist/source/latex/filehook/filehook.ins2
-rw-r--r--Master/texmf-dist/tex/latex/filehook/filehook-2019.sty379
-rw-r--r--Master/texmf-dist/tex/latex/filehook/filehook-2020.sty280
-rw-r--r--Master/texmf-dist/tex/latex/filehook/filehook.sty357
7 files changed, 1350 insertions, 358 deletions
diff --git a/Master/texmf-dist/doc/latex/filehook/README b/Master/texmf-dist/doc/latex/filehook/README
index 25cc0e39b10..aeac2f848e5 100644
--- a/Master/texmf-dist/doc/latex/filehook/README
+++ b/Master/texmf-dist/doc/latex/filehook/README
@@ -1,7 +1,7 @@
LaTeX package 'filehook'
~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (c) 2010-2020 by Martin Scharrer <martin@scharrer-online.de>
-Code repository: https://bitbucket.org/martin_scharrer/filehook
+Code repository: ssh://hth@helixteamhub.cloud/scharrer/projects/filehook/
Provides several file hooks for files read by \input, \include and \InputIfFileExists.
diff --git a/Master/texmf-dist/doc/latex/filehook/filehook.pdf b/Master/texmf-dist/doc/latex/filehook/filehook.pdf
index 4d3462623b9..dcd978b5f2d 100644
--- a/Master/texmf-dist/doc/latex/filehook/filehook.pdf
+++ b/Master/texmf-dist/doc/latex/filehook/filehook.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/filehook/filehook.dtx b/Master/texmf-dist/source/latex/filehook/filehook.dtx
index 0cd0f633541..07cb49537fc 100644
--- a/Master/texmf-dist/source/latex/filehook/filehook.dtx
+++ b/Master/texmf-dist/source/latex/filehook/filehook.dtx
@@ -26,15 +26,17 @@
%<*driver>
\ProvidesFile{filehook.dtx}[%
%<=*DATE>
- 2020/02/03
+ 2020/09/27
%<=/DATE>
%<=*VERSION>
- v0.7
+ v0.8
%<=/VERSION>
Hooks for input files]
\documentclass{ydoc}
\GetFileInfo{filehook.dtx}
\usepackage{filehook}[\filedate]
+\usepackage[utf8]{inputenc}
+\usepackage[TS1,T1]{fontenc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -55,7 +57,7 @@
%</driver>
% \fi
%
-% \CheckSum{1011}
+% \CheckSum{1478}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -526,6 +528,37 @@
%
% \subsection{Options}
% \begin{macrocode}
+\DeclareOption{force}{\PassOptionsToPackage{forse}{filehook-2019}}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{Load actual package}
+% \begin{macrocode}
+\@ifl@t@r\fmtversion{2020/10/01}{\RequirePackage{filehook-2020}}{\RequirePackage{filehook-2019}}
+% \end{macrocode}
+%
+% \iffalse
+%</filehook.sty>
+% \fi
+%
+% \iffalse
+%<*filehook-2019.sty>
+% \fi
+% \begin{macrocode}
+%<!COPYRIGHT>
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{filehook-2019}[%
+%<!DATE>
+%<!VERSION>
+%<*DRIVER>
+ 2099/01/01 develop
+%</DRIVER>
+ Hooks for input files]
+% \end{macrocode}
+%
+%
+% \subsection{Options}
+% \begin{macrocode}
\newif\iffilehook@force
\DeclareOption{force}{\filehook@forcetrue}
\ProcessOptions\relax
@@ -1311,7 +1344,654 @@
% \end{macrocode}
%
% \iffalse
-%</filehook.sty>
+%</filehook-2019.sty>
+% \fi
+%
+% \iffalse
+%<*filehook-2020.sty>
+% \fi
+% \begin{macrocode}
+%<!COPYRIGHT>
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{filehook-2020}[%
+%<!DATE>
+%<!VERSION>
+%<*DRIVER>
+ 2099/01/01 develop
+%</DRIVER>
+ Hooks for input files]
+% \end{macrocode}
+%
+%
+% \subsection{Options}
+% \begin{macrocode}
+\DeclareOption{force}{}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{General stuff}
+%
+% \subsection{Initialisation of Hooks}
+% The general hooks are initialised to call the file specific hooks.
+%
+% \begin{macro}{\filehook@csuse}
+% \begin{macrocode}
+\begingroup
+\gdef\filehook@csuse#1{\ifcsname #1\endcsname\csname #1\expandafter\endcsname\fi}
+\expandafter\ifx\csname csuse\endcsname\relax
+ \expandafter\ifx\csname ifcsname\endcsname\relax
+ \gdef\filehook@csuse#1{\expandafter\ifx\csname #1\endcsname\relax\else\csname #1\expandafter\endcsname\fi}
+ \fi
+\else
+ \global\let\filehook@csuse\csuse
+\fi
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@include@atbegin}
+% \begin{macrocode}
+\def\filehook@include@atbegin#1{%
+ \filehook@csuse{\filehook@include@atbegin@#1}%
+ \filehook@include@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@include@@atbegin}
+% \begin{macrocode}
+\def\filehook@include@@atbegin{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@include@atend}
+% \begin{macrocode}
+\def\filehook@include@atend#1{%
+ \filehook@include@@atend
+ \filehook@csuse{\filehook@include@atend@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@include@@atend}
+% \begin{macrocode}
+\def\filehook@include@@atend{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@include@after}
+% \begin{macrocode}
+\def\filehook@include@after#1{%
+ \filehook@include@@after
+ \filehook@csuse{\filehook@include@after@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@include@@after}
+% \begin{macrocode}
+\def\filehook@include@@after{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@input@atbegin}
+% \begin{macrocode}
+\def\filehook@input@atbegin#1{%
+ \filehook@csuse{\filehook@input@atbegin@\filehook@ensureext{#1}}%
+ \filehook@input@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@input@@atbegin}
+% \begin{macrocode}
+\def\filehook@input@@atbegin{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@input@atend}
+% \begin{macrocode}
+\def\filehook@input@atend#1{%
+ \filehook@input@@atend
+ \filehook@csuse{\filehook@input@atend@\filehook@ensureext{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@input@@atend}
+% \begin{macrocode}
+\def\filehook@input@@atend{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@atbegin}
+% \begin{macrocode}
+\def\filehook@atbegin#1{%
+ \filehook@csuse{\filehook@atbegin@\filehook@ensureext{#1}}%
+ \filehook@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@@atbegin}
+% \begin{macrocode}
+\def\filehook@@atbegin{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@atend}
+% \begin{macrocode}
+\def\filehook@atend#1{%
+ \filehook@@atend
+ \filehook@csuse{\filehook@atend@\filehook@ensureext{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@@atend}
+% \begin{macrocode}
+\def\filehook@@atend{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@every@atbegin}
+% \begin{macrocode}
+\def\filehook@every@atbegin#1{%
+ \filehook@every@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@every@@atbegin}
+% \begin{macrocode}
+\def\filehook@every@@atbegin{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@every@atend}
+% \begin{macrocode}
+\def\filehook@every@atend#1{%
+ \filehook@every@@atend
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@every@@atend}
+% \begin{macrocode}
+\def\filehook@every@@atend{}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Hook Modification Macros}
+% The following macros are used to modify the hooks, i.e.\ to prefix or append code to them.
+%
+%
+% \subsubsection*{Internal Macros}
+%
+% The macro prefixes for the file specific hooks are stored in macros to reduce the number of
+% tokens in the following macro definitions.
+% \begin{macrocode}
+\def\filehook@include@atbegin@{filehook@include@atbegin@}
+\def\filehook@include@atend@{filehook@include@atend@}
+\def\filehook@include@after@{filehook@include@after@}
+\def\filehook@input@atbegin@{filehook@input@atbegin@}
+\def\filehook@input@atend@{filehook@input@atend@}
+\def\filehook@input@after@{filehook@input@after@}
+\def\filehook@atbegin@{filehook@atbegin@}
+\def\filehook@atend@{filehook@atend@}
+\def\filehook@after@{filehook@after@}
+% \end{macrocode}
+%
+%
+% \begin{macro}{\filehook@append}
+% Uses default \LaTeX{} macro.
+% \begin{macrocode}
+\def\filehook@append{\g@addto@macro}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@appendwarg}
+% Appends code with one macro argument. The |\@tempa| intermediate step is required because of the
+% included |##1| which wouldn't correctly expand otherwise.
+% \begin{macrocode}
+\long\def\filehook@appendwarg#1#2{%
+ \begingroup
+ \toks@\expandafter{#1{##1}#2}%
+ \edef\@tempa{\the\toks@}%
+ \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@prefix}
+% Prefixes code to a hook.
+% \begin{macrocode}
+\long\def\filehook@prefix#1#2{%
+ \begingroup
+ \@temptokena{#2}%
+ \toks@\expandafter{#1}%
+ \xdef#1{\the\@temptokena\the\toks@}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@prefixwarg}
+% Prefixes code with an argument to a hook.
+% \begin{macrocode}
+\long\def\filehook@prefixwarg#1#2{%
+ \begingroup
+ \@temptokena{#2}%
+ \toks@\expandafter{#1{##1}}%
+ \edef\@tempa{\the\@temptokena\the\toks@}%
+ \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@addtohook}[3]{Macro which should be used to add the material to the hook}{Macro name prefix}{End of macro name (file name)}
+% The macro first expands the file name (|#3|) to flatten all included macros. An extension is added if missing, as well as the prefix.
+% All modifications of |\@tempa| are made inside a group to keep them local.
+% \begin{macrocode}
+\def\filehook@addtohook#1#2#3{%
+ \begingroup
+ \edef\@tempa{#3}%
+ \edef\@tempa{#2\filehook@ensureext{\@tempa}}%
+ \@ifundefined{\@tempa}{\global\@namedef{\@tempa}{}}{}%
+ \expandafter\endgroup
+ \expandafter#1\csname\@tempa\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection*{User Level Macros}
+% The user level macros simple use the above defined macros on the appropriate hook.
+%
+% \begin{macro}{\AtBeginOfIncludes}
+% \begin{macrocode}
+\newcommand*\AtBeginOfIncludes{%
+ \filehook@append\filehook@include@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfIncludes}
+% \begin{macrocode}
+\newcommand*\AtEndOfIncludes{%
+ \filehook@prefix\filehook@include@@atend
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AfterIncludes}
+% \begin{macrocode}
+\newcommand*\AfterIncludes{%
+ \filehook@prefix\filehook@include@@after
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfIncludeFile}
+% \begin{macrocode}
+\newcommand*\AtBeginOfIncludeFile[1]{%
+ \filehook@addtohook\filehook@append\filehook@include@atbegin@{\filehook@ensuretex{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfIncludeFile}
+% \begin{macrocode}
+\newcommand*\AtEndOfIncludeFile[1]{%
+ \filehook@addtohook\filehook@prefix\filehook@include@atend@{\filehook@ensuretex{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AfterIncludeFile}
+% \begin{macrocode}
+\newcommand*\AfterIncludeFile[1]{%
+ \filehook@addtohook\filehook@prefix\filehook@include@after@{\filehook@ensuretex{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfInputs}
+% \begin{macrocode}
+\newcommand*\AtBeginOfInputs{%
+ \filehook@append\filehook@input@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfInputs}
+% \begin{macrocode}
+\newcommand*\AtEndOfInputs{%
+ \filehook@prefix\filehook@input@@atend
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfInputFile}
+% \begin{macrocode}
+\newcommand*\AtBeginOfInputFile{%
+ \filehook@addtohook\filehook@append\filehook@input@atbegin@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfInputFile}
+% \begin{macrocode}
+\newcommand*\AtEndOfInputFile{%
+ \filehook@addtohook\filehook@prefix\filehook@input@atend@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfFiles}
+% \begin{macrocode}
+\newcommand*\AtBeginOfFiles{%
+ \filehook@append\filehook@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfFiles}
+% \begin{macrocode}
+\newcommand*\AtEndOfFiles{%
+ \filehook@prefix\filehook@@atend
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfEveryFile}
+% \begin{macrocode}
+\newcommand*\AtBeginOfEveryFile{%
+ \filehook@append\filehook@every@@atbegin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfEveryFile}
+% \begin{macrocode}
+\newcommand*\AtEndOfEveryFile{%
+ \filehook@prefix\filehook@every@@atend
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfFile}
+% \begin{macrocode}
+\newcommand*\AtBeginOfFile{%
+ \filehook@addtohook\filehook@append\filehook@atbegin@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfFile}
+% \begin{macrocode}
+\newcommand*\AtEndOfFile{%
+ \filehook@addtohook\filehook@prefix\filehook@atend@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\AtBeginOfClassFile}
+% \begin{macrocode}
+\newcommand*\AtBeginOfClassFile{%
+ \@ifnextchar*
+ {\AtBeginOfXFile@star\@clsextension}%
+ {\AtBeginOfXFile@normal\@clsextension}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfPackageFile}
+% \begin{macrocode}
+\newcommand*\AtBeginOfPackageFile{%
+ \@ifnextchar*
+ {\AtBeginOfXFile@star\@pkgextension}%
+ {\AtBeginOfXFile@normal\@pkgextension}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfXFile@star}[2]{extension}{name}
+% If the class or package is already loaded the code is executed right away.
+% Otherwise it is installed normally.
+% \begin{macrocode}
+\def\AtBeginOfXFile@star#1*#2{%
+ \@ifl@aded{#1}{#2}%
+ {\@firstofone}%
+ {\AtBeginOfXFile@normal{#1}{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginOfXFile@normal}[2]{extension}{name}
+% \begin{macrocode}
+\def\AtBeginOfXFile@normal#1#2{%
+ \AtBeginOfFile{#2.#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\AtEndOfClassFile}
+% \begin{macrocode}
+\newcommand*\AtEndOfClassFile{%
+ \@ifnextchar*
+ {\AtEndOfXFile@star\@clsextension}%
+ {\AtEndOfXFile@normal\@clsextension}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfPackageFile}
+% \begin{macrocode}
+\newcommand*\AtEndOfPackageFile{%
+ \@ifnextchar*
+ {\AtEndOfXFile@star\@pkgextension}%
+ {\AtEndOfXFile@normal\@pkgextension}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\AtEndOfXFile@star}[2]{extension}{name}
+% If the class or package is already loaded the code is executed right away.
+% Otherwise it is installed normally.
+% \begin{macrocode}
+\def\AtEndOfXFile@star#1*#2{%
+ \@ifl@aded{#1}{#2}%
+ {\@firstofone}%
+ {\AtEndOfXFile@normal{#1}{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndOfXFile@normal}[2]{extension}{name}
+% Note that \Macro\AtEndOfClass is identical to \Macro\AtEndOfPackage, so no
+% differentiation between classes and packages is needed here.
+% \begin{macrocode}
+\long\def\AtEndOfXFile@normal#1#2#3{%
+ \AtEndOfFile{#2.#1}{\AtEndOfPackage{#3}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClearHook}
+% Clears the hook by temporary redefining the prefix and append macros
+% to do a simple definition to empty.
+% \begin{macrocode}
+\newcommand*\ClearHook{%
+ \begingroup
+ \def\filehook@prefix##1##2{%
+ \gdef##1{}%
+ \endgroup
+ }%
+ \let\filehook@append\filehook@prefix
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+% \subsection{Installation of Hooks}
+% The \Macro\@input@ and \Macro\@iinput macros from |latex.ltx| are redefined to install the hooks.
+%
+% \begin{macro}{\@input@}
+% This macro is redefined for the \Macro\include file hooks.
+% Checks if the next command is \Macro\clearpage which indicates that we are inside \Macro\@include.
+% If so the hooks are installed, otherwise the original macro is used unchanged.
+% For the `after' hook an own \Macro\clearpage is inserted and the original one is gobbled.
+%
+% \begin{macrocode}
+\def\DEPRECATED@input@#1{%
+ \@ifnextchar\clearpage
+ {%
+ \filehook@every@atbegin{#1}%
+ \filehook@include@atbegin{#1}%
+ \filehook@orig@@input@{#1}%
+ \filehook@include@atend{#1}%
+ \clearpage
+ \filehook@include@after{#1}%
+ \filehook@every@atend{#1}%
+ \@gobble
+ }%
+ {\filehook@orig@@input@{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@iinput}
+% This macro is redefined for the \Macro\input file hooks.
+% it simply surrounds the original macro with the hooks.
+% \begin{macrocode}
+\def\filehook@@iinput#1{%
+ \filehook@every@atbegin{#1}%
+ \filehook@input@atbegin{#1}%
+ \filehook@orig@@iinput{#1}%
+ \filehook@input@atend{#1}%
+ \filehook@every@atend{#1}%
+}
+%\let\@iinput\filehook@@iinput
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@ensureext}
+% This macro ensures the existence of a file name extension. If non is given `|.tex|' is
+% added.
+% \begin{macrocode}
+\def\filehook@ensureext#1{%
+ \expandafter\filehook@@ensureext#1\empty.tex\empty\empty
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@@ensureext}
+% \begin{macrocode}
+\def\filehook@@ensureext#1.#2\empty#3\empty{#1.#2}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\filehook@ensuretex}
+% Ensures a `|.tex|' extension, i.e. adds it if missing, even if there is a different one.
+% \begin{macrocode}
+\def\filehook@ensuretex#1{%
+ \expandafter\filehook@@ensuretex#1\empty.tex\empty\empty
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@@ensuretex}
+% \begin{macrocode}
+\def\filehook@@ensuretex#1.tex\empty#2\empty{#1.tex}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hook}
+% \begin{macrocode}
+\AddToHook{include/before}{%
+ \filehook@include@atbegin{\CurrentFile}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hook}
+% \begin{macrocode}
+\AddToHook{include/end}{%
+ \filehook@include@atend{\CurrentFile}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hook}
+% \begin{macrocode}
+\AddToHook{include/after}{%
+ \filehook@include@after{\CurrentFile}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@istexfile}
+% \begin{macrocode}
+\begingroup
+\edef\dottex{\expandafter\expandafter\expandafter\@gobble\expandafter\string\csname.tex\endcsname}
+\expandafter
+\gdef\expandafter\filehook@istexfile\expandafter#\expandafter1\expandafter{%
+ \expandafter\expandafter\expandafter\filehook@istexfile@\expandafter#\expandafter1\expandafter\empty\dottex\empty\empty\@nil
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\filehook@istexfile@}
+% \begin{macrocode}
+\expandafter\gdef\expandafter\filehook@istexfile@\expandafter#\expandafter1\dottex\empty#2\empty#3\@nil{%
+ \begingroup
+ \def\@tempa{#2}%
+ \ifx\@tempa\empty
+ \endgroup
+ \expandafter\@secondoftwo
+ \else
+ \endgroup
+ \expandafter\@firstoftwo
+ \fi
+}
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\Hook}
+% \begin{macrocode}
+\AddToHook{file/before}{%
+ \filehook@every@atbegin{\CurrentFile}%
+ \filehook@istexfile\CurrentFile{\filehook@input@atbegin{\CurrentFile}}{}%
+ \filehook@atbegin{\CurrentFile}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hook}
+% \begin{macrocode}
+\AddToHook{file/after}{%
+ \filehook@atend{\CurrentFile}%
+ \filehook@istexfile\CurrentFile{\filehook@input@atend{\CurrentFile}}{}%
+ \filehook@every@atend{\CurrentFile}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</filehook-2020.sty>
% \fi
%
% \iffalse
diff --git a/Master/texmf-dist/source/latex/filehook/filehook.ins b/Master/texmf-dist/source/latex/filehook/filehook.ins
index 0d381c3b77a..baead816375 100644
--- a/Master/texmf-dist/source/latex/filehook/filehook.ins
+++ b/Master/texmf-dist/source/latex/filehook/filehook.ins
@@ -5,6 +5,8 @@
\askforoverwritefalse
\generate{%
\file{filehook.sty}{\nopreamble\from{filehook.dtx}{filehook.sty}}%
+ \file{filehook-2019.sty}{\nopreamble\from{filehook.dtx}{filehook-2019.sty}}%
+ \file{filehook-2020.sty}{\nopreamble\from{filehook.dtx}{filehook-2020.sty}}%
\file{filehook-scrlfile.sty}{\nopreamble\from{filehook.dtx}{filehook-scrlfile.sty}}%
\file{filehook-memoir.sty}{\nopreamble\from{filehook.dtx}{filehook-memoir.sty}}%
\file{filehook-listings.sty}{\nopreamble\from{filehook.dtx}{filehook-listings.sty}}%
diff --git a/Master/texmf-dist/tex/latex/filehook/filehook-2019.sty b/Master/texmf-dist/tex/latex/filehook/filehook-2019.sty
new file mode 100644
index 00000000000..a0a5c327770
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/filehook/filehook-2019.sty
@@ -0,0 +1,379 @@
+%% Copyright (C) 2011-2020 by Martin Scharrer <martin@scharrer-online.de>
+%% ----------------------------------------------------------------------
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Martin Scharrer.
+%%
+%% This work consists of the files filehook.dtx and filehook.ins
+%% and the derived files filehook.sty, filehook-fink.sty,
+%% filehook-listings.sty, filehook-memoir.sty, filehook-scrlfile.sty
+%% and pgf-filehook.sty
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{filehook-2019}[%
+ 2020/09/27
+ v0.8
+ Hooks for input files]
+\newif\iffilehook@force
+\DeclareOption{force}{\filehook@forcetrue}
+\ProcessOptions\relax
+\newif\iffilehook@newfmt
+\@ifl@t@r\fmtversion{2019/10/01}{\filehook@newfmttrue}{\filehook@newfmtfalse}
+\def\filehook@let#1#2{%
+ \expandafter\ifx\csname #2\space\endcsname\relax
+ \expandafter\let\csname #1\expandafter\endcsname\csname #2\endcsname
+ \else
+ \expandafter\def\csname #1\expandafter\endcsname\expandafter{\expandafter\protect\csname #1\space\endcsname}%
+ \expandafter\let\csname #1\space\expandafter\endcsname\csname #2\space\endcsname
+ \fi
+}
+\def\filehook@glet#1#2{%
+ \expandafter\ifx\csname #2\space\endcsname\relax
+ \expandafter\global\expandafter\let\csname #1\expandafter\endcsname\csname #2\endcsname
+ \else
+ \expandafter\global\expandafter\def\csname #1\expandafter\endcsname\expandafter{\expandafter\protect\csname #1\space\endcsname}%
+ \expandafter\global\expandafter\let\csname #1\space\expandafter\endcsname\csname #2\space\endcsname
+ \fi
+}
+\def\filehook@cmp#1#2{%
+ \expandafter\ifx\csname #2\space\endcsname\relax
+ \expandafter\ifx\csname #1\expandafter\endcsname\csname #2\endcsname
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \else
+ \expandafter\ifx\csname #1\space\expandafter\endcsname\csname #2\space\endcsname
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \fi
+}
+\begingroup
+\gdef\filehook@csuse#1{\ifcsname #1\endcsname\csname #1\expandafter\endcsname\fi}
+\expandafter\ifx\csname csuse\endcsname\relax
+ \expandafter\ifx\csname ifcsname\endcsname\relax
+ \gdef\filehook@csuse#1{\expandafter\ifx\csname #1\endcsname\relax\else\csname #1\expandafter\endcsname\fi}
+ \fi
+\else
+ \global\let\filehook@csuse\csuse
+\fi
+\endgroup
+\def\filehook@include@atbegin#1{%
+ \filehook@let{InputIfFileExists}{filehook@@InputIfFileExists}%
+ \filehook@csuse{\filehook@include@atbegin@#1}%
+ \filehook@include@@atbegin
+}
+\def\filehook@include@@atbegin{}
+\def\filehook@include@atend#1{%
+ \filehook@include@@atend
+ \filehook@csuse{\filehook@include@atend@#1}%
+}
+\def\filehook@include@@atend{}
+\def\filehook@include@after#1{%
+ \filehook@include@@after
+ \filehook@csuse{\filehook@include@after@#1}%
+}
+\def\filehook@include@@after{}
+\def\filehook@input@atbegin#1{%
+ \filehook@let{InputIfFileExists}{filehook@@InputIfFileExists}%
+ \filehook@csuse{\filehook@input@atbegin@\filehook@ensureext{#1}}%
+ \filehook@input@@atbegin
+}
+\def\filehook@input@@atbegin{}
+\def\filehook@input@atend#1{%
+ \filehook@input@@atend
+ \filehook@csuse{\filehook@input@atend@\filehook@ensureext{#1}}%
+}
+\def\filehook@input@@atend{}
+\def\filehook@atbegin#1{%
+ \filehook@csuse{\filehook@atbegin@\filehook@ensureext{#1}}%
+ \filehook@@atbegin
+}
+\def\filehook@@atbegin{}
+\def\filehook@atend#1{%
+ \filehook@@atend
+ \filehook@csuse{\filehook@atend@\filehook@ensureext{#1}}%
+}
+\def\filehook@@atend{}
+\def\filehook@every@atbegin#1{%
+ \filehook@every@@atbegin
+}
+\def\filehook@every@@atbegin{}
+\def\filehook@every@atend#1{%
+ \filehook@every@@atend
+}
+\def\filehook@every@@atend{}
+\def\filehook@include@atbegin@{filehook@include@atbegin@}
+\def\filehook@include@atend@{filehook@include@atend@}
+\def\filehook@include@after@{filehook@include@after@}
+\def\filehook@input@atbegin@{filehook@input@atbegin@}
+\def\filehook@input@atend@{filehook@input@atend@}
+\def\filehook@input@after@{filehook@input@after@}
+\def\filehook@atbegin@{filehook@atbegin@}
+\def\filehook@atend@{filehook@atend@}
+\def\filehook@after@{filehook@after@}
+\def\filehook@append{\g@addto@macro}
+\long\def\filehook@appendwarg#1#2{%
+ \begingroup
+ \toks@\expandafter{#1{##1}#2}%
+ \edef\@tempa{\the\toks@}%
+ \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
+ \endgroup
+}
+\long\def\filehook@prefix#1#2{%
+ \begingroup
+ \@temptokena{#2}%
+ \toks@\expandafter{#1}%
+ \xdef#1{\the\@temptokena\the\toks@}%
+ \endgroup
+}
+\long\def\filehook@prefixwarg#1#2{%
+ \begingroup
+ \@temptokena{#2}%
+ \toks@\expandafter{#1{##1}}%
+ \edef\@tempa{\the\@temptokena\the\toks@}%
+ \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
+ \endgroup
+}
+\def\filehook@addtohook#1#2#3{%
+ \begingroup
+ \edef\@tempa{#3}%
+ \edef\@tempa{#2\filehook@ensureext{\@tempa}}%
+ \@ifundefined{\@tempa}{\global\@namedef{\@tempa}{}}{}%
+ \expandafter\endgroup
+ \expandafter#1\csname\@tempa\endcsname
+}
+\newcommand*\AtBeginOfIncludes{%
+ \filehook@append\filehook@include@@atbegin
+}
+\newcommand*\AtEndOfIncludes{%
+ \filehook@prefix\filehook@include@@atend
+}
+\newcommand*\AfterIncludes{%
+ \filehook@prefix\filehook@include@@after
+}
+\newcommand*\AtBeginOfIncludeFile[1]{%
+ \filehook@addtohook\filehook@append\filehook@include@atbegin@{\filehook@ensuretex{#1}}%
+}
+\newcommand*\AtEndOfIncludeFile[1]{%
+ \filehook@addtohook\filehook@prefix\filehook@include@atend@{\filehook@ensuretex{#1}}%
+}
+\newcommand*\AfterIncludeFile[1]{%
+ \filehook@addtohook\filehook@prefix\filehook@include@after@{\filehook@ensuretex{#1}}%
+}
+\newcommand*\AtBeginOfInputs{%
+ \filehook@append\filehook@input@@atbegin
+}
+\newcommand*\AtEndOfInputs{%
+ \filehook@prefix\filehook@input@@atend
+}
+\newcommand*\AtBeginOfInputFile{%
+ \filehook@addtohook\filehook@append\filehook@input@atbegin@
+}
+\newcommand*\AtEndOfInputFile{%
+ \filehook@addtohook\filehook@prefix\filehook@input@atend@
+}
+\newcommand*\AtBeginOfFiles{%
+ \filehook@append\filehook@@atbegin
+}
+\newcommand*\AtEndOfFiles{%
+ \filehook@prefix\filehook@@atend
+}
+\newcommand*\AtBeginOfEveryFile{%
+ \filehook@append\filehook@every@@atbegin
+}
+\newcommand*\AtEndOfEveryFile{%
+ \filehook@prefix\filehook@every@@atend
+}
+\newcommand*\AtBeginOfFile{%
+ \filehook@addtohook\filehook@append\filehook@atbegin@
+}
+\newcommand*\AtEndOfFile{%
+ \filehook@addtohook\filehook@prefix\filehook@atend@
+}
+\newcommand*\AtBeginOfClassFile{%
+ \@ifnextchar*
+ {\AtBeginOfXFile@star\@clsextension}%
+ {\AtBeginOfXFile@normal\@clsextension}%
+}
+\newcommand*\AtBeginOfPackageFile{%
+ \@ifnextchar*
+ {\AtBeginOfXFile@star\@pkgextension}%
+ {\AtBeginOfXFile@normal\@pkgextension}%
+}
+\def\AtBeginOfXFile@star#1*#2{%
+ \@ifl@aded{#1}{#2}%
+ {\@firstofone}%
+ {\AtBeginOfXFile@normal{#1}{#2}}%
+}
+\def\AtBeginOfXFile@normal#1#2{%
+ \AtBeginOfFile{#2.#1}%
+}
+\newcommand*\AtEndOfClassFile{%
+ \@ifnextchar*
+ {\AtEndOfXFile@star\@clsextension}%
+ {\AtEndOfXFile@normal\@clsextension}%
+}
+\newcommand*\AtEndOfPackageFile{%
+ \@ifnextchar*
+ {\AtEndOfXFile@star\@pkgextension}%
+ {\AtEndOfXFile@normal\@pkgextension}%
+}
+\def\AtEndOfXFile@star#1*#2{%
+ \@ifl@aded{#1}{#2}%
+ {\@firstofone}%
+ {\AtEndOfXFile@normal{#1}{#2}}%
+}
+\long\def\AtEndOfXFile@normal#1#2#3{%
+ \AtEndOfFile{#2.#1}{\AtEndOfPackage{#3}}%
+}
+\newcommand*\ClearHook{%
+ \begingroup
+ \def\filehook@prefix##1##2{%
+ \gdef##1{}%
+ \endgroup
+ }%
+ \let\filehook@append\filehook@prefix
+}
+\let\filehook@orig@@input@\@input@
+\let\filehook@orig@@iinput\@iinput
+\def\@input@#1{%
+ \@ifnextchar\clearpage
+ {%
+ \filehook@every@atbegin{#1}%
+ \filehook@include@atbegin{#1}%
+ \filehook@orig@@input@{#1}%
+ \filehook@include@atend{#1}%
+ \clearpage
+ \filehook@include@after{#1}%
+ \filehook@every@atend{#1}%
+ \@gobble
+ }%
+ {\filehook@orig@@input@{#1}}%
+}
+\def\filehook@@iinput#1{%
+ \filehook@every@atbegin{#1}%
+ \filehook@input@atbegin{#1}%
+ \filehook@orig@@iinput{#1}%
+ \filehook@input@atend{#1}%
+ \filehook@every@atend{#1}%
+}
+\let\@iinput\filehook@@iinput
+\def\filehook@swap#1#2{#2#1}
+\def\filehook@ensureext#1{%
+ \expandafter\filehook@@ensureext#1\empty.tex\empty\empty
+}
+\def\filehook@@ensureext#1.#2\empty#3\empty{#1.#2}
+\def\filehook@ensuretex#1{%
+ \expandafter\filehook@@ensuretex#1\empty.tex\empty\empty
+}
+\def\filehook@@ensuretex#1.tex\empty#2\empty{#1.tex}
+\iffilehook@newfmt
+\expandafter\def\expandafter\latex@InputIfFileExists\expandafter{%
+ \expandafter\protect\csname InputIfFileExists\space\endcsname
+}
+\expandafter\long\expandafter\def\csname latex@InputIfFileExists\space\endcsname#1#2{%
+ \IfFileExists{#1}%
+ {%
+ \expandafter\@swaptwoargs\expandafter
+ {\@filef@und}{#2\@addtofilelist{#1}\@@input}}}
+\else
+\long\def\latex@InputIfFileExists#1#2{%
+ \IfFileExists{#1}%
+ {#2\@addtofilelist{#1}%
+ \@@input\@filef@und
+ }%
+}
+\fi
+\DeclareRobustCommand\filehook@default@InputIfFileExists[2]{%
+ \IfFileExists{#1}%
+ {\expandafter\filehook@swap
+ \expandafter{\@filef@und}%
+ {#2\@addtofilelist{#1}%
+ \filehook@every@atbegin{#1}%
+ \filehook@atbegin{#1}%
+ \@@input}%
+ \filehook@atend{#1}%
+ \filehook@every@atend{#1}%
+ }%
+}
+\filehook@glet{filehook@default@InputIfFileExists}{filehook@default@InputIfFileExists}%
+\DeclareRobustCommand\filehook@@default@InputIfFileExists[2]{%
+ \filehook@let{InputIfFileExists}{filehook@InputIfFileExists}%
+ \IfFileExists{#1}%
+ {\expandafter\filehook@swap
+ \expandafter{\@filef@und}%
+ {#2\@addtofilelist{#1}%
+ \filehook@atbegin{#1}%
+ \@@input}%
+ \filehook@atend{#1}%
+ }%
+}
+\filehook@glet{filehook@@default@InputIfFileExists}{filehook@@default@InputIfFileExists}%
+\AtBeginOfPackageFile{scrlfile}{%
+ \filehook@glet{InputIfFileExists}{latex@InputIfFileExists}%
+}%
+\AtEndOfPackageFile*{scrlfile}{%
+ \RequirePackage{filehook-scrlfile}%
+}%
+\AtBeginOfPackageFile*{fink}{%
+ \RequirePackage{kvoptions}%
+ \begingroup
+ \filehook@let{InputIfFileExists}{latex@InputIfFileExists}%
+}%
+\AtEndOfPackageFile*{fink}{%
+ \edef\@tempa{\noexpand\PassOptionsToPackage{mainext=\fnk@mainext,maindir=\fnk@maindir}{currfile}}%
+ \expandafter\endgroup\@tempa
+ \RequirePackage{filehook-fink}%
+}%
+\AtBeginOfClassFile{memoir}{%
+ \filehook@let{InputIfFileExists}{latex@InputIfFileExists}%
+ \let\@iinput\filehook@orig@@iinput
+}%
+\AtEndOfClassFile*{memoir}{%
+ \let\@iinput\filehook@@iinput
+ \RequirePackage{filehook-memoir}%
+}%
+\filehook@cmp{InputIfFileExists}{filehook@InputIfFileExists}%
+ {}% already set up
+ {%
+ \filehook@cmp{InputIfFileExists}{latex@InputIfFileExists}%
+ {%
+ \filehook@let{filehook@InputIfFileExists}{filehook@default@InputIfFileExists}%
+ \filehook@let{filehook@@InputIfFileExists}{filehook@@default@InputIfFileExists}%
+ \filehook@let{InputIfFileExists}{filehook@InputIfFileExists}%
+ }%
+ {%
+ \iffilehook@force
+ \filehook@let{filehook@InputIfFileExists}{filehook@default@InputIfFileExists}%
+ \filehook@let{filehook@@InputIfFileExists}{filehook@@default@InputIfFileExists}%
+ \filehook@let{InputIfFileExists}{filehook@InputIfFileExists}%
+ \PackageWarning{filehook}{Detected unknown definition of \string\InputIfFileExists.^^J%
+ The 'force' option of 'filehook' is in effect. Macro is overwritten with default!}%
+ \else
+ \PackageError{filehook}{Detected unknown definition of \string\InputIfFileExists.^^J%
+ Use the 'force' option of 'filehook' to overwrite it.}{}%
+ \fi
+ }%
+ }%
+\AtBeginDocument{%
+ % Check if definition got changed again. For the new LaTeX format we check again \InputIfFileExists<space>,
+ % for the old format to \InputIfFileExists directly.
+ \filehook@cmp{InputIfFileExists}{filehook@InputIfFileExists}{}{%
+ \PackageWarning{filehook}{Macro \string\InputIfFileExists\space got redefined after 'filehook' was loaded.^^J%
+ Certain file hooks might now be dysfunctional!}%
+ }%
+}
+\endinput
+%%
+%% End of file `filehook-2019.sty'.
diff --git a/Master/texmf-dist/tex/latex/filehook/filehook-2020.sty b/Master/texmf-dist/tex/latex/filehook/filehook-2020.sty
new file mode 100644
index 00000000000..fa5f7fd328e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/filehook/filehook-2020.sty
@@ -0,0 +1,280 @@
+%% Copyright (C) 2011-2020 by Martin Scharrer <martin@scharrer-online.de>
+%% ----------------------------------------------------------------------
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Martin Scharrer.
+%%
+%% This work consists of the files filehook.dtx and filehook.ins
+%% and the derived files filehook.sty, filehook-fink.sty,
+%% filehook-listings.sty, filehook-memoir.sty, filehook-scrlfile.sty
+%% and pgf-filehook.sty
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{filehook-2020}[%
+ 2020/09/27
+ v0.8
+ Hooks for input files]
+\DeclareOption{force}{}
+\ProcessOptions\relax
+\begingroup
+\gdef\filehook@csuse#1{\ifcsname #1\endcsname\csname #1\expandafter\endcsname\fi}
+\expandafter\ifx\csname csuse\endcsname\relax
+ \expandafter\ifx\csname ifcsname\endcsname\relax
+ \gdef\filehook@csuse#1{\expandafter\ifx\csname #1\endcsname\relax\else\csname #1\expandafter\endcsname\fi}
+ \fi
+\else
+ \global\let\filehook@csuse\csuse
+\fi
+\endgroup
+\def\filehook@include@atbegin#1{%
+ \filehook@csuse{\filehook@include@atbegin@#1}%
+ \filehook@include@@atbegin
+}
+\def\filehook@include@@atbegin{}
+\def\filehook@include@atend#1{%
+ \filehook@include@@atend
+ \filehook@csuse{\filehook@include@atend@#1}%
+}
+\def\filehook@include@@atend{}
+\def\filehook@include@after#1{%
+ \filehook@include@@after
+ \filehook@csuse{\filehook@include@after@#1}%
+}
+\def\filehook@include@@after{}
+\def\filehook@input@atbegin#1{%
+ \filehook@csuse{\filehook@input@atbegin@\filehook@ensureext{#1}}%
+ \filehook@input@@atbegin
+}
+\def\filehook@input@@atbegin{}
+\def\filehook@input@atend#1{%
+ \filehook@input@@atend
+ \filehook@csuse{\filehook@input@atend@\filehook@ensureext{#1}}%
+}
+\def\filehook@input@@atend{}
+\def\filehook@atbegin#1{%
+ \filehook@csuse{\filehook@atbegin@\filehook@ensureext{#1}}%
+ \filehook@@atbegin
+}
+\def\filehook@@atbegin{}
+\def\filehook@atend#1{%
+ \filehook@@atend
+ \filehook@csuse{\filehook@atend@\filehook@ensureext{#1}}%
+}
+\def\filehook@@atend{}
+\def\filehook@every@atbegin#1{%
+ \filehook@every@@atbegin
+}
+\def\filehook@every@@atbegin{}
+\def\filehook@every@atend#1{%
+ \filehook@every@@atend
+}
+\def\filehook@every@@atend{}
+\def\filehook@include@atbegin@{filehook@include@atbegin@}
+\def\filehook@include@atend@{filehook@include@atend@}
+\def\filehook@include@after@{filehook@include@after@}
+\def\filehook@input@atbegin@{filehook@input@atbegin@}
+\def\filehook@input@atend@{filehook@input@atend@}
+\def\filehook@input@after@{filehook@input@after@}
+\def\filehook@atbegin@{filehook@atbegin@}
+\def\filehook@atend@{filehook@atend@}
+\def\filehook@after@{filehook@after@}
+\def\filehook@append{\g@addto@macro}
+\long\def\filehook@appendwarg#1#2{%
+ \begingroup
+ \toks@\expandafter{#1{##1}#2}%
+ \edef\@tempa{\the\toks@}%
+ \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
+ \endgroup
+}
+\long\def\filehook@prefix#1#2{%
+ \begingroup
+ \@temptokena{#2}%
+ \toks@\expandafter{#1}%
+ \xdef#1{\the\@temptokena\the\toks@}%
+ \endgroup
+}
+\long\def\filehook@prefixwarg#1#2{%
+ \begingroup
+ \@temptokena{#2}%
+ \toks@\expandafter{#1{##1}}%
+ \edef\@tempa{\the\@temptokena\the\toks@}%
+ \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
+ \endgroup
+}
+\def\filehook@addtohook#1#2#3{%
+ \begingroup
+ \edef\@tempa{#3}%
+ \edef\@tempa{#2\filehook@ensureext{\@tempa}}%
+ \@ifundefined{\@tempa}{\global\@namedef{\@tempa}{}}{}%
+ \expandafter\endgroup
+ \expandafter#1\csname\@tempa\endcsname
+}
+\newcommand*\AtBeginOfIncludes{%
+ \filehook@append\filehook@include@@atbegin
+}
+\newcommand*\AtEndOfIncludes{%
+ \filehook@prefix\filehook@include@@atend
+}
+\newcommand*\AfterIncludes{%
+ \filehook@prefix\filehook@include@@after
+}
+\newcommand*\AtBeginOfIncludeFile[1]{%
+ \filehook@addtohook\filehook@append\filehook@include@atbegin@{\filehook@ensuretex{#1}}%
+}
+\newcommand*\AtEndOfIncludeFile[1]{%
+ \filehook@addtohook\filehook@prefix\filehook@include@atend@{\filehook@ensuretex{#1}}%
+}
+\newcommand*\AfterIncludeFile[1]{%
+ \filehook@addtohook\filehook@prefix\filehook@include@after@{\filehook@ensuretex{#1}}%
+}
+\newcommand*\AtBeginOfInputs{%
+ \filehook@append\filehook@input@@atbegin
+}
+\newcommand*\AtEndOfInputs{%
+ \filehook@prefix\filehook@input@@atend
+}
+\newcommand*\AtBeginOfInputFile{%
+ \filehook@addtohook\filehook@append\filehook@input@atbegin@
+}
+\newcommand*\AtEndOfInputFile{%
+ \filehook@addtohook\filehook@prefix\filehook@input@atend@
+}
+\newcommand*\AtBeginOfFiles{%
+ \filehook@append\filehook@@atbegin
+}
+\newcommand*\AtEndOfFiles{%
+ \filehook@prefix\filehook@@atend
+}
+\newcommand*\AtBeginOfEveryFile{%
+ \filehook@append\filehook@every@@atbegin
+}
+\newcommand*\AtEndOfEveryFile{%
+ \filehook@prefix\filehook@every@@atend
+}
+\newcommand*\AtBeginOfFile{%
+ \filehook@addtohook\filehook@append\filehook@atbegin@
+}
+\newcommand*\AtEndOfFile{%
+ \filehook@addtohook\filehook@prefix\filehook@atend@
+}
+\newcommand*\AtBeginOfClassFile{%
+ \@ifnextchar*
+ {\AtBeginOfXFile@star\@clsextension}%
+ {\AtBeginOfXFile@normal\@clsextension}%
+}
+\newcommand*\AtBeginOfPackageFile{%
+ \@ifnextchar*
+ {\AtBeginOfXFile@star\@pkgextension}%
+ {\AtBeginOfXFile@normal\@pkgextension}%
+}
+\def\AtBeginOfXFile@star#1*#2{%
+ \@ifl@aded{#1}{#2}%
+ {\@firstofone}%
+ {\AtBeginOfXFile@normal{#1}{#2}}%
+}
+\def\AtBeginOfXFile@normal#1#2{%
+ \AtBeginOfFile{#2.#1}%
+}
+\newcommand*\AtEndOfClassFile{%
+ \@ifnextchar*
+ {\AtEndOfXFile@star\@clsextension}%
+ {\AtEndOfXFile@normal\@clsextension}%
+}
+\newcommand*\AtEndOfPackageFile{%
+ \@ifnextchar*
+ {\AtEndOfXFile@star\@pkgextension}%
+ {\AtEndOfXFile@normal\@pkgextension}%
+}
+\def\AtEndOfXFile@star#1*#2{%
+ \@ifl@aded{#1}{#2}%
+ {\@firstofone}%
+ {\AtEndOfXFile@normal{#1}{#2}}%
+}
+\long\def\AtEndOfXFile@normal#1#2#3{%
+ \AtEndOfFile{#2.#1}{\AtEndOfPackage{#3}}%
+}
+\newcommand*\ClearHook{%
+ \begingroup
+ \def\filehook@prefix##1##2{%
+ \gdef##1{}%
+ \endgroup
+ }%
+ \let\filehook@append\filehook@prefix
+}
+\def\DEPRECATED@input@#1{%
+ \@ifnextchar\clearpage
+ {%
+ \filehook@every@atbegin{#1}%
+ \filehook@include@atbegin{#1}%
+ \filehook@orig@@input@{#1}%
+ \filehook@include@atend{#1}%
+ \clearpage
+ \filehook@include@after{#1}%
+ \filehook@every@atend{#1}%
+ \@gobble
+ }%
+ {\filehook@orig@@input@{#1}}%
+}
+\def\filehook@@iinput#1{%
+ \filehook@every@atbegin{#1}%
+ \filehook@input@atbegin{#1}%
+ \filehook@orig@@iinput{#1}%
+ \filehook@input@atend{#1}%
+ \filehook@every@atend{#1}%
+}
+\def\filehook@ensureext#1{%
+ \expandafter\filehook@@ensureext#1\empty.tex\empty\empty
+}
+\def\filehook@@ensureext#1.#2\empty#3\empty{#1.#2}
+\def\filehook@ensuretex#1{%
+ \expandafter\filehook@@ensuretex#1\empty.tex\empty\empty
+}
+\def\filehook@@ensuretex#1.tex\empty#2\empty{#1.tex}
+\AddToHook{include/before}{%
+ \filehook@include@atbegin{\CurrentFile}%
+}
+\AddToHook{include/end}{%
+ \filehook@include@atend{\CurrentFile}%
+}
+\AddToHook{include/after}{%
+ \filehook@include@after{\CurrentFile}%
+}
+\begingroup
+\edef\dottex{\expandafter\expandafter\expandafter\@gobble\expandafter\string\csname.tex\endcsname}
+\expandafter
+\gdef\expandafter\filehook@istexfile\expandafter#\expandafter1\expandafter{%
+ \expandafter\expandafter\expandafter\filehook@istexfile@\expandafter#\expandafter1\expandafter\empty\dottex\empty\empty\@nil
+}
+\expandafter\gdef\expandafter\filehook@istexfile@\expandafter#\expandafter1\dottex\empty#2\empty#3\@nil{%
+ \begingroup
+ \def\@tempa{#2}%
+ \ifx\@tempa\empty
+ \endgroup
+ \expandafter\@secondoftwo
+ \else
+ \endgroup
+ \expandafter\@firstoftwo
+ \fi
+}
+\endgroup
+\AddToHook{file/before}{%
+ \filehook@every@atbegin{\CurrentFile}%
+ \filehook@istexfile\CurrentFile{\filehook@input@atbegin{\CurrentFile}}{}%
+ \filehook@atbegin{\CurrentFile}%
+}
+\AddToHook{file/after}{%
+ \filehook@atend{\CurrentFile}%
+ \filehook@istexfile\CurrentFile{\filehook@input@atend{\CurrentFile}}{}%
+ \filehook@every@atend{\CurrentFile}%
+}
+\endinput
+%%
+%% End of file `filehook-2020.sty'.
diff --git a/Master/texmf-dist/tex/latex/filehook/filehook.sty b/Master/texmf-dist/tex/latex/filehook/filehook.sty
index d71145b6007..dc2e9336143 100644
--- a/Master/texmf-dist/tex/latex/filehook/filehook.sty
+++ b/Master/texmf-dist/tex/latex/filehook/filehook.sty
@@ -19,361 +19,12 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{filehook}[%
- 2020/02/03
- v0.7
+ 2020/09/27
+ v0.8
Hooks for input files]
-\newif\iffilehook@force
-\DeclareOption{force}{\filehook@forcetrue}
+\DeclareOption{force}{\PassOptionsToPackage{forse}{filehook-2019}}
\ProcessOptions\relax
-\newif\iffilehook@newfmt
-\@ifl@t@r\fmtversion{2019/10/01}{\filehook@newfmttrue}{\filehook@newfmtfalse}
-\def\filehook@let#1#2{%
- \expandafter\ifx\csname #2\space\endcsname\relax
- \expandafter\let\csname #1\expandafter\endcsname\csname #2\endcsname
- \else
- \expandafter\def\csname #1\expandafter\endcsname\expandafter{\expandafter\protect\csname #1\space\endcsname}%
- \expandafter\let\csname #1\space\expandafter\endcsname\csname #2\space\endcsname
- \fi
-}
-\def\filehook@glet#1#2{%
- \expandafter\ifx\csname #2\space\endcsname\relax
- \expandafter\global\expandafter\let\csname #1\expandafter\endcsname\csname #2\endcsname
- \else
- \expandafter\global\expandafter\def\csname #1\expandafter\endcsname\expandafter{\expandafter\protect\csname #1\space\endcsname}%
- \expandafter\global\expandafter\let\csname #1\space\expandafter\endcsname\csname #2\space\endcsname
- \fi
-}
-\def\filehook@cmp#1#2{%
- \expandafter\ifx\csname #2\space\endcsname\relax
- \expandafter\ifx\csname #1\expandafter\endcsname\csname #2\endcsname
- \expandafter\expandafter\expandafter\@firstoftwo
- \else
- \expandafter\expandafter\expandafter\@secondoftwo
- \fi
- \else
- \expandafter\ifx\csname #1\space\expandafter\endcsname\csname #2\space\endcsname
- \expandafter\expandafter\expandafter\@firstoftwo
- \else
- \expandafter\expandafter\expandafter\@secondoftwo
- \fi
- \fi
-}
-\begingroup
-\gdef\filehook@csuse#1{\ifcsname #1\endcsname\csname #1\expandafter\endcsname\fi}
-\expandafter\ifx\csname csuse\endcsname\relax
- \expandafter\ifx\csname ifcsname\endcsname\relax
- \gdef\filehook@csuse#1{\expandafter\ifx\csname #1\endcsname\relax\else\csname #1\expandafter\endcsname\fi}
- \fi
-\else
- \global\let\filehook@csuse\csuse
-\fi
-\endgroup
-\def\filehook@include@atbegin#1{%
- \filehook@let{InputIfFileExists}{filehook@@InputIfFileExists}%
- \filehook@csuse{\filehook@include@atbegin@#1}%
- \filehook@include@@atbegin
-}
-\def\filehook@include@@atbegin{}
-\def\filehook@include@atend#1{%
- \filehook@include@@atend
- \filehook@csuse{\filehook@include@atend@#1}%
-}
-\def\filehook@include@@atend{}
-\def\filehook@include@after#1{%
- \filehook@include@@after
- \filehook@csuse{\filehook@include@after@#1}%
-}
-\def\filehook@include@@after{}
-\def\filehook@input@atbegin#1{%
- \filehook@let{InputIfFileExists}{filehook@@InputIfFileExists}%
- \filehook@csuse{\filehook@input@atbegin@\filehook@ensureext{#1}}%
- \filehook@input@@atbegin
-}
-\def\filehook@input@@atbegin{}
-\def\filehook@input@atend#1{%
- \filehook@input@@atend
- \filehook@csuse{\filehook@input@atend@\filehook@ensureext{#1}}%
-}
-\def\filehook@input@@atend{}
-\def\filehook@atbegin#1{%
- \filehook@csuse{\filehook@atbegin@\filehook@ensureext{#1}}%
- \filehook@@atbegin
-}
-\def\filehook@@atbegin{}
-\def\filehook@atend#1{%
- \filehook@@atend
- \filehook@csuse{\filehook@atend@\filehook@ensureext{#1}}%
-}
-\def\filehook@@atend{}
-\def\filehook@every@atbegin#1{%
- \filehook@every@@atbegin
-}
-\def\filehook@every@@atbegin{}
-\def\filehook@every@atend#1{%
- \filehook@every@@atend
-}
-\def\filehook@every@@atend{}
-\def\filehook@include@atbegin@{filehook@include@atbegin@}
-\def\filehook@include@atend@{filehook@include@atend@}
-\def\filehook@include@after@{filehook@include@after@}
-\def\filehook@input@atbegin@{filehook@input@atbegin@}
-\def\filehook@input@atend@{filehook@input@atend@}
-\def\filehook@input@after@{filehook@input@after@}
-\def\filehook@atbegin@{filehook@atbegin@}
-\def\filehook@atend@{filehook@atend@}
-\def\filehook@after@{filehook@after@}
-\def\filehook@append{\g@addto@macro}
-\long\def\filehook@appendwarg#1#2{%
- \begingroup
- \toks@\expandafter{#1{##1}#2}%
- \edef\@tempa{\the\toks@}%
- \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
- \endgroup
-}
-\long\def\filehook@prefix#1#2{%
- \begingroup
- \@temptokena{#2}%
- \toks@\expandafter{#1}%
- \xdef#1{\the\@temptokena\the\toks@}%
- \endgroup
-}
-\long\def\filehook@prefixwarg#1#2{%
- \begingroup
- \@temptokena{#2}%
- \toks@\expandafter{#1{##1}}%
- \edef\@tempa{\the\@temptokena\the\toks@}%
- \expandafter\gdef\expandafter#1\expandafter##\expandafter1\expandafter{\@tempa}%
- \endgroup
-}
-\def\filehook@addtohook#1#2#3{%
- \begingroup
- \edef\@tempa{#3}%
- \edef\@tempa{#2\filehook@ensureext{\@tempa}}%
- \@ifundefined{\@tempa}{\global\@namedef{\@tempa}{}}{}%
- \expandafter\endgroup
- \expandafter#1\csname\@tempa\endcsname
-}
-\newcommand*\AtBeginOfIncludes{%
- \filehook@append\filehook@include@@atbegin
-}
-\newcommand*\AtEndOfIncludes{%
- \filehook@prefix\filehook@include@@atend
-}
-\newcommand*\AfterIncludes{%
- \filehook@prefix\filehook@include@@after
-}
-\newcommand*\AtBeginOfIncludeFile[1]{%
- \filehook@addtohook\filehook@append\filehook@include@atbegin@{\filehook@ensuretex{#1}}%
-}
-\newcommand*\AtEndOfIncludeFile[1]{%
- \filehook@addtohook\filehook@prefix\filehook@include@atend@{\filehook@ensuretex{#1}}%
-}
-\newcommand*\AfterIncludeFile[1]{%
- \filehook@addtohook\filehook@prefix\filehook@include@after@{\filehook@ensuretex{#1}}%
-}
-\newcommand*\AtBeginOfInputs{%
- \filehook@append\filehook@input@@atbegin
-}
-\newcommand*\AtEndOfInputs{%
- \filehook@prefix\filehook@input@@atend
-}
-\newcommand*\AtBeginOfInputFile{%
- \filehook@addtohook\filehook@append\filehook@input@atbegin@
-}
-\newcommand*\AtEndOfInputFile{%
- \filehook@addtohook\filehook@prefix\filehook@input@atend@
-}
-\newcommand*\AtBeginOfFiles{%
- \filehook@append\filehook@@atbegin
-}
-\newcommand*\AtEndOfFiles{%
- \filehook@prefix\filehook@@atend
-}
-\newcommand*\AtBeginOfEveryFile{%
- \filehook@append\filehook@every@@atbegin
-}
-\newcommand*\AtEndOfEveryFile{%
- \filehook@prefix\filehook@every@@atend
-}
-\newcommand*\AtBeginOfFile{%
- \filehook@addtohook\filehook@append\filehook@atbegin@
-}
-\newcommand*\AtEndOfFile{%
- \filehook@addtohook\filehook@prefix\filehook@atend@
-}
-\newcommand*\AtBeginOfClassFile{%
- \@ifnextchar*
- {\AtBeginOfXFile@star\@clsextension}%
- {\AtBeginOfXFile@normal\@clsextension}%
-}
-\newcommand*\AtBeginOfPackageFile{%
- \@ifnextchar*
- {\AtBeginOfXFile@star\@pkgextension}%
- {\AtBeginOfXFile@normal\@pkgextension}%
-}
-\def\AtBeginOfXFile@star#1*#2{%
- \@ifl@aded{#1}{#2}%
- {\@firstofone}%
- {\AtBeginOfXFile@normal{#1}{#2}}%
-}
-\def\AtBeginOfXFile@normal#1#2{%
- \AtBeginOfFile{#2.#1}%
-}
-\newcommand*\AtEndOfClassFile{%
- \@ifnextchar*
- {\AtEndOfXFile@star\@clsextension}%
- {\AtEndOfXFile@normal\@clsextension}%
-}
-\newcommand*\AtEndOfPackageFile{%
- \@ifnextchar*
- {\AtEndOfXFile@star\@pkgextension}%
- {\AtEndOfXFile@normal\@pkgextension}%
-}
-\def\AtEndOfXFile@star#1*#2{%
- \@ifl@aded{#1}{#2}%
- {\@firstofone}%
- {\AtEndOfXFile@normal{#1}{#2}}%
-}
-\long\def\AtEndOfXFile@normal#1#2#3{%
- \AtEndOfFile{#2.#1}{\AtEndOfPackage{#3}}%
-}
-\newcommand*\ClearHook{%
- \begingroup
- \def\filehook@prefix##1##2{%
- \gdef##1{}%
- \endgroup
- }%
- \let\filehook@append\filehook@prefix
-}
-\let\filehook@orig@@input@\@input@
-\let\filehook@orig@@iinput\@iinput
-\def\@input@#1{%
- \@ifnextchar\clearpage
- {%
- \filehook@every@atbegin{#1}%
- \filehook@include@atbegin{#1}%
- \filehook@orig@@input@{#1}%
- \filehook@include@atend{#1}%
- \clearpage
- \filehook@include@after{#1}%
- \filehook@every@atend{#1}%
- \@gobble
- }%
- {\filehook@orig@@input@{#1}}%
-}
-\def\filehook@@iinput#1{%
- \filehook@every@atbegin{#1}%
- \filehook@input@atbegin{#1}%
- \filehook@orig@@iinput{#1}%
- \filehook@input@atend{#1}%
- \filehook@every@atend{#1}%
-}
-\let\@iinput\filehook@@iinput
-\def\filehook@swap#1#2{#2#1}
-\def\filehook@ensureext#1{%
- \expandafter\filehook@@ensureext#1\empty.tex\empty\empty
-}
-\def\filehook@@ensureext#1.#2\empty#3\empty{#1.#2}
-\def\filehook@ensuretex#1{%
- \expandafter\filehook@@ensuretex#1\empty.tex\empty\empty
-}
-\def\filehook@@ensuretex#1.tex\empty#2\empty{#1.tex}
-\iffilehook@newfmt
-\expandafter\def\expandafter\latex@InputIfFileExists\expandafter{%
- \expandafter\protect\csname InputIfFileExists\space\endcsname
-}
-\expandafter\long\expandafter\def\csname latex@InputIfFileExists\space\endcsname#1#2{%
- \IfFileExists{#1}%
- {%
- \expandafter\@swaptwoargs\expandafter
- {\@filef@und}{#2\@addtofilelist{#1}\@@input}}}
-\else
-\long\def\latex@InputIfFileExists#1#2{%
- \IfFileExists{#1}%
- {#2\@addtofilelist{#1}%
- \@@input\@filef@und
- }%
-}
-\fi
-\DeclareRobustCommand\filehook@default@InputIfFileExists[2]{%
- \IfFileExists{#1}%
- {\expandafter\filehook@swap
- \expandafter{\@filef@und}%
- {#2\@addtofilelist{#1}%
- \filehook@every@atbegin{#1}%
- \filehook@atbegin{#1}%
- \@@input}%
- \filehook@atend{#1}%
- \filehook@every@atend{#1}%
- }%
-}
-\filehook@glet{filehook@default@InputIfFileExists}{filehook@default@InputIfFileExists}%
-\DeclareRobustCommand\filehook@@default@InputIfFileExists[2]{%
- \filehook@let{InputIfFileExists}{filehook@InputIfFileExists}%
- \IfFileExists{#1}%
- {\expandafter\filehook@swap
- \expandafter{\@filef@und}%
- {#2\@addtofilelist{#1}%
- \filehook@atbegin{#1}%
- \@@input}%
- \filehook@atend{#1}%
- }%
-}
-\filehook@glet{filehook@@default@InputIfFileExists}{filehook@@default@InputIfFileExists}%
-\AtBeginOfPackageFile{scrlfile}{%
- \filehook@glet{InputIfFileExists}{latex@InputIfFileExists}%
-}%
-\AtEndOfPackageFile*{scrlfile}{%
- \RequirePackage{filehook-scrlfile}%
-}%
-\AtBeginOfPackageFile*{fink}{%
- \RequirePackage{kvoptions}%
- \begingroup
- \filehook@let{InputIfFileExists}{latex@InputIfFileExists}%
-}%
-\AtEndOfPackageFile*{fink}{%
- \edef\@tempa{\noexpand\PassOptionsToPackage{mainext=\fnk@mainext,maindir=\fnk@maindir}{currfile}}%
- \expandafter\endgroup\@tempa
- \RequirePackage{filehook-fink}%
-}%
-\AtBeginOfClassFile{memoir}{%
- \filehook@let{InputIfFileExists}{latex@InputIfFileExists}%
- \let\@iinput\filehook@orig@@iinput
-}%
-\AtEndOfClassFile*{memoir}{%
- \let\@iinput\filehook@@iinput
- \RequirePackage{filehook-memoir}%
-}%
-\filehook@cmp{InputIfFileExists}{filehook@InputIfFileExists}%
- {}% already set up
- {%
- \filehook@cmp{InputIfFileExists}{latex@InputIfFileExists}%
- {%
- \filehook@let{filehook@InputIfFileExists}{filehook@default@InputIfFileExists}%
- \filehook@let{filehook@@InputIfFileExists}{filehook@@default@InputIfFileExists}%
- \filehook@let{InputIfFileExists}{filehook@InputIfFileExists}%
- }%
- {%
- \iffilehook@force
- \filehook@let{filehook@InputIfFileExists}{filehook@default@InputIfFileExists}%
- \filehook@let{filehook@@InputIfFileExists}{filehook@@default@InputIfFileExists}%
- \filehook@let{InputIfFileExists}{filehook@InputIfFileExists}%
- \PackageWarning{filehook}{Detected unknown definition of \string\InputIfFileExists.^^J%
- The 'force' option of 'filehook' is in effect. Macro is overwritten with default!}%
- \else
- \PackageError{filehook}{Detected unknown definition of \string\InputIfFileExists.^^J%
- Use the 'force' option of 'filehook' to overwrite it.}{}%
- \fi
- }%
- }%
-\AtBeginDocument{%
- % Check if definition got changed again. For the new LaTeX format we check again \InputIfFileExists<space>,
- % for the old format to \InputIfFileExists directly.
- \filehook@cmp{InputIfFileExists}{filehook@InputIfFileExists}{}{%
- \PackageWarning{filehook}{Macro \string\InputIfFileExists\space got redefined after 'filehook' was loaded.^^J%
- Certain file hooks might now be dysfunctional!}%
- }%
-}
+\@ifl@t@r\fmtversion{2020/10/01}{\RequirePackage{filehook-2020}}{\RequirePackage{filehook-2019}}
\endinput
%%
%% End of file `filehook.sty'.