Skip to content

Commit

Permalink
add \kernel@after@shipout@background hook
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jan 8, 2021
1 parent 4fdc9cb commit 3df8677
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion base/ltfilehook.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%%
%% File: ltfilehook.dtx (C) Copyright 2020,2021 Frank Mittelbach,
%% File: ltfilehook.dtx (C) Copyright 2020-2021 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
%
% This file is part of the LaTeX base system.
Expand Down
2 changes: 1 addition & 1 deletion base/lthooks.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%%
%% File: lthooks.dtx (C) Copyright 2020,2021 Frank Mittelbach,
%% File: lthooks.dtx (C) Copyright 2020-2021 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
%
% This file is part of the LaTeX base system.
Expand Down
16 changes: 12 additions & 4 deletions base/ltshipout.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%%
%% File: ltshipout.dtx (C) Copyright 2020,2021 Frank Mittelbach, LaTeX Team
%% File: ltshipout.dtx (C) Copyright 2020-2021 Frank Mittelbach, LaTeX Team
%%
%
% This file is part of the LaTeX base system.
Expand Down Expand Up @@ -31,8 +31,8 @@
%%% From File: ltshipout.dtx
%
% \begin{macrocode}
\providecommand\ltshipoutversion{v1.0d}
\providecommand\ltshipoutdate{2020/12/06}
\providecommand\ltshipoutversion{v1.0f}
\providecommand\ltshipoutdate{2021/01/08}
% \end{macrocode}
%
%<*driver>
Expand Down Expand Up @@ -753,14 +753,22 @@
{ \hook_use:n {shipout/foreground} } }
% \end{macrocode}
% If there is no user hook, there might still code in the kernel hook.
% We only test for the \cs{@kernel@before@shipout@background}
% though. If the \cs{@kernel@after@shipout@background} needs
% executing even if the user hook is empty then we can add another
% test (or the kernel could put something into the before hook.
%
% \changes{v1.0d}{2020/11/23}{Check for both kernel and user hook (gh/431)}
% \changes{v1.0f}{2021/01/08}{Added another kernel hook for more
% flexibility (cf \texttt{https://github.com/pgf-tikz/pgf/issues/960}}
% \begin{macrocode}
\bool_lazy_and:nnF
{ \hook_if_empty_p:n {shipout/background} }
{ \tl_if_empty_p:N \@kernel@before@shipout@background }
{ \@@_add_background_picture:n
{ \@kernel@before@shipout@background
\hook_use:n {shipout/background} } }
\hook_use:n {shipout/background}
\@kernel@after@shipout@background } }
% \end{macrocode}
% We then run \cs{@@_execute_firstpage_hook:} that adds
% the content of the hook \hook{shipout/firstpage} to the
Expand Down

0 comments on commit 3df8677

Please sign in to comment.