Skip to content

Commit

Permalink
make sure /firstpage hook code is executed before /lastpage hook code
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jan 18, 2021
1 parent e46fbda commit 148b2b6
Show file tree
Hide file tree
Showing 5 changed files with 439 additions and 11,932 deletions.
16 changes: 8 additions & 8 deletions base/ltshipout.dtx
Expand Up @@ -33,7 +33,7 @@
%
% \begin{macrocode}
\providecommand\ltshipoutversion{v1.0g}
\providecommand\ltshipoutdate{2021/01/12}
\providecommand\ltshipoutdate{2021/01/18}
% \end{macrocode}
%
%<*driver>
Expand Down Expand Up @@ -903,6 +903,13 @@
% \begin{macrocode}
#3
% \end{macrocode}
% We then run \cs{@@_add_firstpage_hook:} that adds
% the content of the hook \hook{shipout/firstpage} to the
% start of the first page (if non-empty). It is then redefined to
% do nothing on later pages.
% \begin{macrocode}
\@@_add_firstpage_hook:
% \end{macrocode}
% Then we check if we have to add the \hook{shipout/lastpage} hook
% or the corresponding kernel hook
% because we have reached the last page. This test will be false for
Expand All @@ -921,13 +928,6 @@
\bool_gset_true:N \g_@@_lastpage_handled_bool
}
% \end{macrocode}
% We then run \cs{@@_add_firstpage_hook:} that adds
% the content of the hook \hook{shipout/firstpage} to the
% start of the first page (if non-empty). It is then redefined to
% do nothing on later pages.
% \begin{macrocode}
\@@_add_firstpage_hook:
% \end{macrocode}
% Finally we run the actual \TeX{} primitive for shipout. As that will
% expand delayed \cs{write} statements inside the page in which
% protected commands should not expand we first change \cs{protect}
Expand Down

0 comments on commit 148b2b6

Please sign in to comment.