[latex3-commits] [git/LaTeX3-latex3-latex2e] pre_shipout: Housekeeping (a2776476)

Marcel Fabian Krüger tex at 2krueger.de
Fri Jan 22 14:14:40 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : pre_shipout
Link       : https://github.com/latex3/latex2e/commit/a2776476e8f3a283607ccafaf037e17f62957fd7

>---------------------------------------------------------------

commit a2776476e8f3a283607ccafaf037e17f62957fd7
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Wed Jan 6 11:15:17 2021 +0100

    Housekeeping


>---------------------------------------------------------------

a2776476e8f3a283607ccafaf037e17f62957fd7
 base/changes.txt      |  5 +++++
 base/doc/ltnews33.tex | 11 +++++++++++
 base/ltshipout.dtx    | 15 +++++++++------
 3 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 32b162ef..1259b9f6 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-01-22  Marcel Krüger  <Marcel.Krueger at latex-project.org>
+
+	* ltshipout.dtx:
+	Define and call Lua callback pre_shipout_filter.
+
 2021-01-19  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltshipout.dtx: Reordered execution of shipout hooks so that code
diff --git a/base/doc/ltnews33.tex b/base/doc/ltnews33.tex
index b44acfc6..6929cb43 100644
--- a/base/doc/ltnews33.tex
+++ b/base/doc/ltnews33.tex
@@ -139,6 +139,17 @@ the name. The coding has now been slightly altered to allow for this.
 \githubissue{427}
 
 
+\subsection{Add a Lua callback to ltshipout to provide a uniform location for applying custom attributes}
+
+Just before shipping out a page, a new \LuaTeX{} callback
+``\texttt{pre\_shipout\_filter}'' is now called to allow final
+adjustments to the box to be shipped out. This is particularly for
+Lua\TeX\ packages which flag certain elements of the page (e.g. using
+attributes or properties) in order to apply certain effects to these
+elements at shipout. An example for this is the \pkg{luacolor}
+package which could insert the color commands using this callback.
+
+
 
 \subsection{Provide hook in \cs{selectfont}}
 
diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx
index 94a923c9..ac66c68e 100644
--- a/base/ltshipout.dtx
+++ b/base/ltshipout.dtx
@@ -32,8 +32,8 @@
 %%% From File: ltshipout.dtx
 %
 %    \begin{macrocode}
-\providecommand\ltshipoutversion{v1.0h}
-\providecommand\ltshipoutdate{2021/01/19}
+\providecommand\ltshipoutversion{v1.0i}
+\providecommand\ltshipoutdate{2021/01/22}
 %    \end{macrocode}
 %
 %<*driver>
@@ -367,14 +367,16 @@
 % \subsection{Provided Lua\TeX\ callbacks}
 % 
 %  \begin{variable}{pre_shipout_filter}
-%    Under Lua\TeX, additionally the \texttt{pre_shipout_filter} callback is
-%    provided. The signature is
+%    Under Lua\TeX{} the \texttt{pre\_shipout\_filter} Lua callback is
+%    provided which gets called immediately before the shipout primitive gets invoked.
+%    The signature is
 %    \begin{verbatim}
 %     function(<node> head)
-%       return true | false | <node> newhead
+%       return true
 %     end
 %    \end{verbatim}
-%    This callback is invoked after all \TeX-level hooks described above.
+%    The \texttt{head} is the list node corresponding to the box to be shipped out.
+%    The return value should always be \texttt{true}.
 %  \end{variable}
 %
 % \subsection{Information counters}
@@ -707,6 +709,7 @@
 %
 %  \begin{macro}{\@@_finalize_box:}
 %    For Lua\TeX{} invoke the \texttt{pre\_shipout\_filter} callback.
+%  \changes{v1.0i}{2021/01/22}{Add \texttt{pre\_shipout\_filter} Lua callback}
 %    \begin{macrocode}
 \sys_if_engine_luatex:TF
   {





More information about the latex3-commits mailing list.