summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/filehook
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-30 03:03:53 +0000
committerNorbert Preining <norbert@preining.info>2020-09-30 03:03:53 +0000
commit36f406d8d1fc994af516d837e6a87c68839cdb2d (patch)
tree64ab03e1fa0a9576ceacca93a7750ddbbd422fc7 /macros/latex/contrib/filehook
parentd043a18e288914d3c46a1b10af1f30ce2df00588 (diff)
CTAN sync 202009300303
Diffstat (limited to 'macros/latex/contrib/filehook')
-rw-r--r--macros/latex/contrib/filehook/filehook.dtx68
-rw-r--r--macros/latex/contrib/filehook/filehook.pdfbin301526 -> 304009 bytes
2 files changed, 52 insertions, 16 deletions
diff --git a/macros/latex/contrib/filehook/filehook.dtx b/macros/latex/contrib/filehook/filehook.dtx
index 07cb49537f..eee04bd9af 100644
--- a/macros/latex/contrib/filehook/filehook.dtx
+++ b/macros/latex/contrib/filehook/filehook.dtx
@@ -26,10 +26,10 @@
%<*driver>
\ProvidesFile{filehook.dtx}[%
%<=*DATE>
- 2020/09/27
+ 2020/09/29
%<=/DATE>
%<=*VERSION>
- v0.8
+ v0.8a
%<=/VERSION>
Hooks for input files]
\documentclass{ydoc}
@@ -57,7 +57,7 @@
%</driver>
% \fi
%
-% \CheckSum{1478}
+% \CheckSum{1494}
%
% \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
@@ -100,6 +100,8 @@
% \changes{v0.5e}{2019/08/19}{Fix for new LaTeX format.}
% \changes{v0.6}{2019/10/03}{Fix for InputIfFileExists for LaTeX format 2019/10/01.}
% \changes{v0.7}{2020/02/03}{Further fixes for InputIfFileExists for LaTeX format 2019/10/01.}
+% \changes{v0.8}{2020/09/27}{Support for LaTeX format 2020/10/01.}
+% \changes{v0.8a}{2020/09/29}{Further fixes for LaTeX format 2020/10/01.}
%
% \GetFileInfo{filehook.dtx}
%
@@ -114,9 +116,24 @@
% execute code at begin or the end of specific or all input files.
% \end{abstract}
%
+% \section{Changes due to new \LaTeX\ core hooks}
+% With the \LaTeX\ release 2020/10/01 file hooks are now provided by the \LaTeX\ core. This package has been adjusted to use these hooks
+% while trying to provide the same interface and behaviour than before. Simpler usages should work without any differences but advanced
+% usages which rely on the exact hook order and position might see some unwanted changes.
+% Users should try to use the \LaTeX\ hooks instead for new documents.
+% Please see \LaTeX\ core filehook documentation
+% \href{http://mirrors.ctan.org/macros/latex-dev/base/ltfilehook-doc.pdf}{\texttt{ltfilehook-doc}} for
+% the new hook system.
+%
+% Support of other hooking systems in other packages and classes has been dropped as this package no longer installs own hooks.
+%
+% If this package is run under a \LaTeX\ release prior to 2020/10/01 the old implementation will be loaded.
+% For this switch two sub-packages \pkg{filehook-2019} and \pkg{filehook-2020} are used and loaded according to the \LaTeX\ release version.
+% Please do not load these packages directly as they might be changes or disappear on later releases.
+%
%
% \section{Introduction}
-% These package changes some internal \LaTeX{} macros used to load input files so that they include `hooks'.
+% These package (under \LaTeX\ prior 2020/10/01) changes some internal \LaTeX{} macros used to load input files so that they include `hooks'.
% A hook is an (internal) macro executed at specific points. Normally it is initially empty, but can be extended using
% an user level macro. The most common hook in \LaTeX{} is the `At-Begin-Document' hook. Code can be added to this hook
% using \Macro\AtBeginDocument{<\TeX\ code>}.
@@ -528,7 +545,7 @@
%
% \subsection{Options}
% \begin{macrocode}
-\DeclareOption{force}{\PassOptionsToPackage{forse}{filehook-2019}}
+\DeclareOption{force}{\PassOptionsToPackage{force}{filehook-2019}}
\ProcessOptions\relax
% \end{macrocode}
%
@@ -547,7 +564,7 @@
% \begin{macrocode}
%<!COPYRIGHT>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{filehook-2019}[%
+\ProvidesPackage{filehook-2019}[% filehook subpackage, do not load directly
%<!DATE>
%<!VERSION>
%<*DRIVER>
@@ -1353,7 +1370,7 @@
% \begin{macrocode}
%<!COPYRIGHT>
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{filehook-2020}[%
+\ProvidesPackage{filehook-2020}[% filehook subpackage, do not load directly
%<!DATE>
%<!VERSION>
%<*DRIVER>
@@ -1917,10 +1934,25 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\filehook@set@CurrentFile}
+% \begin{macrocode}
+\def\filehook@set@CurrentFile{%
+ \edef\filehook@CurrentFile{%
+ \ifx\CurrentFilePath\empty
+ \else
+ \CurrentFilePath/%
+ \fi
+ \CurrentFile
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\Hook}
% \begin{macrocode}
\AddToHook{include/before}{%
- \filehook@include@atbegin{\CurrentFile}%
+ \filehook@set@CurrentFile
+ \filehook@include@atbegin{\filehook@CurrentFile}%
}
% \end{macrocode}
% \end{macro}
@@ -1928,7 +1960,8 @@
% \begin{macro}{\Hook}
% \begin{macrocode}
\AddToHook{include/end}{%
- \filehook@include@atend{\CurrentFile}%
+ \filehook@set@CurrentFile
+ \filehook@include@atend{\filehook@CurrentFile}%
}
% \end{macrocode}
% \end{macro}
@@ -1936,7 +1969,8 @@
% \begin{macro}{\Hook}
% \begin{macrocode}
\AddToHook{include/after}{%
- \filehook@include@after{\CurrentFile}%
+ \filehook@set@CurrentFile
+ \filehook@include@after{\filehook@CurrentFile}%
}
% \end{macrocode}
% \end{macro}
@@ -1973,9 +2007,10 @@
% \begin{macro}{\Hook}
% \begin{macrocode}
\AddToHook{file/before}{%
- \filehook@every@atbegin{\CurrentFile}%
- \filehook@istexfile\CurrentFile{\filehook@input@atbegin{\CurrentFile}}{}%
- \filehook@atbegin{\CurrentFile}%
+ \filehook@set@CurrentFile
+ \filehook@every@atbegin{\filehook@CurrentFile}%
+ \filehook@istexfile\filehook@CurrentFile{\filehook@input@atbegin{\filehook@CurrentFile}}{}%
+ \filehook@atbegin{\filehook@CurrentFile}%
}
% \end{macrocode}
% \end{macro}
@@ -1983,9 +2018,10 @@
% \begin{macro}{\Hook}
% \begin{macrocode}
\AddToHook{file/after}{%
- \filehook@atend{\CurrentFile}%
- \filehook@istexfile\CurrentFile{\filehook@input@atend{\CurrentFile}}{}%
- \filehook@every@atend{\CurrentFile}%
+ \filehook@set@CurrentFile
+ \filehook@atend{\filehook@CurrentFile}%
+ \filehook@istexfile\filehook@CurrentFile{\filehook@input@atend{\filehook@CurrentFile}}{}%
+ \filehook@every@atend{\filehook@CurrentFile}%
}
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/filehook/filehook.pdf b/macros/latex/contrib/filehook/filehook.pdf
index dcd978b5f2..bd94ed1a66 100644
--- a/macros/latex/contrib/filehook/filehook.pdf
+++ b/macros/latex/contrib/filehook/filehook.pdf
Binary files differ