texlive[57829] Master/texmf-dist: luacolor

commits+karl at tug.org commits+karl at tug.org
Sun Feb 21 23:09:56 CET 2021


Revision: 57829
          http://tug.org/svn/texlive?view=revision&revision=57829
Author:   karl
Date:     2021-02-21 23:09:56 +0100 (Sun, 21 Feb 2021)
Log Message:
-----------
luacolor

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/luacolor/luacolor.pdf
    trunk/Master/texmf-dist/source/latex/luacolor/luacolor.dtx
    trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.lua
    trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.sty

Modified: trunk/Master/texmf-dist/doc/latex/luacolor/luacolor.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/luacolor/luacolor.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/luacolor/luacolor.dtx	2021-02-21 21:07:39 UTC (rev 57828)
+++ trunk/Master/texmf-dist/source/latex/luacolor/luacolor.dtx	2021-02-21 22:09:56 UTC (rev 57829)
@@ -1,12 +1,12 @@
 % \iffalse meta-comment
 %
 % File: luacolor.dtx
-% Version: 2020-02-24 v1.15
+% Version: 2021-02-17 v1.17
 % Info: Color support via LuaTeX's attributes
 %
 % Copyright (C)
 %    2007, 2009-2011 Heiko Oberdiek
-%    2016-2020 Oberdiek Package Support Group
+%    2016-2021 Oberdiek Package Support Group
 %    https://github.com/ho-tex/luacolor/issues
 %
 % This work may be distributed and/or modified under the
@@ -80,7 +80,7 @@
 \input docstrip.tex
 \Msg{************************************************************************}
 \Msg{* Installation}
-\Msg{* Package: luacolor 2020-02-24 v1.15 Color support via LuaTeX's attributes (HO)}
+\Msg{* Package: luacolor 2021-02-17 v1.17 Color support via LuaTeX's attributes (HO)}
 \Msg{************************************************************************}
 
 \keepsilent
@@ -92,11 +92,11 @@
 This is a generated file.
 
 Project: luacolor
-Version: 2020-02-24 v1.15
+Version: 2021-02-17 v1.17
 
 Copyright (C)
    2007, 2009-2011 Heiko Oberdiek
-   2016-2020 Oberdiek Package Support Group
+   2016-2021 Oberdiek Package Support Group
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either
@@ -169,7 +169,7 @@
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{luacolor.drv}%
-  [2020-02-24 v1.15 Color support via LuaTeX's attributes (HO)]%
+  [2021-02-17 v1.17 Color support via LuaTeX's attributes (HO)]%
 \documentclass{ltxdoc}
 \usepackage{holtxdoc}[2011/11/22]
 \usepackage{paralist}
@@ -189,7 +189,7 @@
 % \GetFileInfo{luacolor.drv}
 %
 % \title{The \xpackage{luacolor} package}
-% \date{2020-02-24 v1.15}
+% \date{2021-02-17 v1.17}
 % \author{Heiko Oberdiek\thanks
 % {Please report any issues at \url{https://github.com/ho-tex/luacolor/issues}}}
 %
@@ -332,7 +332,7 @@
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{luacolor}%
-  [2020-02-24 v1.15 Color support via LuaTeX's attributes (HO)]
+  [2021-02-17 v1.17 Color support via LuaTeX's attributes (HO)]
 %    \end{macrocode}
 %
 % \subsection{Check for \LuaTeX}
@@ -376,7 +376,7 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 \begingroup
-  \edef\x{\directlua{tex.write("2020-02-24 v1.15")}}%
+  \edef\x{\directlua{tex.write("2021-02-17 v1.17")}}%
   \edef\y{%
     \directlua{%
       if oberdiek.luacolor.getversion then %
@@ -471,9 +471,15 @@
 %    \end{macro}
 %
 %    \begin{macrocode}
-\RequirePackage{atbegshi}[2011/01/30]
-\AtBeginShipout{%
-  \luacolorProcessBox\AtBeginShipoutBox
+\directlua{%
+  if luatexbase.callbacktypes.pre_shipout_filter then
+    token.get_next()
+  end
+}\@secondoftwo\@gobble{
+  \RequirePackage{atbegshi}[2011/01/30]
+  \AtBeginShipout{%
+    \luacolorProcessBox\AtBeginShipoutBox
+  }
 }
 %    \end{macrocode}
 %
@@ -608,7 +614,7 @@
 %    \begin{macro}{getversion()}
 %    \begin{macrocode}
 function luacolor.getversion()
-  tex.write("2020-02-24 v1.15")
+  tex.write("2021-02-17 v1.17")
 end
 %    \end{macrocode}
 %    \end{macro}
@@ -727,6 +733,7 @@
 local LIST_LEADERS = 2
 local LIST_DISC = 3
 local COLOR = 4
+local NOCOLOR = 5
 local RULE = node.id("rule")
 local node_types = {
   [node.id("hlist")] = LIST,
@@ -735,6 +742,10 @@
   [node.id("glyph")] = COLOR,
   [node.id("disc")]  = LIST_DISC,
   [node.id("whatsit")] = {
+    [node.subtype("pdf_colorstack")] =
+      function(n)
+        return n.stack == 0 and NOCOLOR or nil
+      end,
     [node.subtype("special")] = COLOR,
     [node.subtype("pdf_literal")] = COLOR,
     [node.subtype("pdf_save")] = COLOR,
@@ -829,6 +840,8 @@
           end
         end
       end
+    elseif t == NOCOLOR then
+      color = ''
     end
   end
   if get_type(list) == LIST then
@@ -848,6 +861,13 @@
   local list = tex.getbox(box)
   traverse(list, color, DRY_FALSE)
 end
+
+if luatexbase.callbacktypes.pre_shipout_filter then
+  luatexbase.add_to_callback("pre_shipout_filter", function(list)
+    traverse(list, "", DRY_FALSE)
+    return true
+  end, "luacolor.process")
+end
 %    \end{macrocode}
 %    \end{macro}
 % For recent versions of luaotfload, we can register a callback to
@@ -1129,6 +1149,13 @@
 %   \begin{Version}{2020-02-24 v1.15}
 %   \item Grab all possible arguments for \verb|\saveboxresource|\slash \verb|\pdfxform|
 %   \end{Version}
+%   \begin{Version}{2020-04-04 v1.16}
+%   \item Reset color after \verb|pdf_colorstack| whatsits.
+%   \end{Version}
+%   \begin{Version}{2021-02-17 v1.17}
+%   \item Use \LaTeXe's new \verb|pre_shipout_filter| callback if it's available to
+%         allow coloring background and foregrund layer material
+%   \end{Version}
 % \end{History}
 %
 % \PrintIndex

Modified: trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.lua	2021-02-21 21:07:39 UTC (rev 57828)
+++ trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.lua	2021-02-21 22:09:56 UTC (rev 57829)
@@ -9,11 +9,11 @@
 --  This is a generated file.
 --  
 --  Project: luacolor
---  Version: 2020-02-24 v1.15
+--  Version: 2021-02-17 v1.17
 --  
 --  Copyright (C)
 --     2007, 2009-2011 Heiko Oberdiek
---     2016-2020 Oberdiek Package Support Group
+--     2016-2021 Oberdiek Package Support Group
 --  
 --  This work may be distributed and/or modified under the
 --  conditions of the LaTeX Project Public License, either
@@ -41,7 +41,7 @@
 local luacolor = oberdiek.luacolor or {}
 oberdiek.luacolor = luacolor
 function luacolor.getversion()
-  tex.write("2020-02-24 v1.15")
+  tex.write("2021-02-17 v1.17")
 end
 local ifpdf = tonumber(tex.outputmode or tex.pdfoutput) > 0
 local prefix
@@ -116,6 +116,7 @@
 local LIST_LEADERS = 2
 local LIST_DISC = 3
 local COLOR = 4
+local NOCOLOR = 5
 local RULE = node.id("rule")
 local node_types = {
   [node.id("hlist")] = LIST,
@@ -124,6 +125,10 @@
   [node.id("glyph")] = COLOR,
   [node.id("disc")]  = LIST_DISC,
   [node.id("whatsit")] = {
+    [node.subtype("pdf_colorstack")] =
+      function(n)
+        return n.stack == 0 and NOCOLOR or nil
+      end,
     [node.subtype("special")] = COLOR,
     [node.subtype("pdf_literal")] = COLOR,
     [node.subtype("pdf_save")] = COLOR,
@@ -202,6 +207,8 @@
           end
         end
       end
+    elseif t == NOCOLOR then
+      color = ''
     end
   end
   if get_type(list) == LIST then
@@ -216,6 +223,13 @@
   local list = tex.getbox(box)
   traverse(list, color, DRY_FALSE)
 end
+
+if luatexbase.callbacktypes.pre_shipout_filter then
+  luatexbase.add_to_callback("pre_shipout_filter", function(list)
+    traverse(list, "", DRY_FALSE)
+    return true
+  end, "luacolor.process")
+end
 if luaotfload.set_colorhandler then
   local set_attribute = node.direct.set_attribute
   luaotfload.set_colorhandler(function(head, n, color)

Modified: trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.sty	2021-02-21 21:07:39 UTC (rev 57828)
+++ trunk/Master/texmf-dist/tex/latex/luacolor/luacolor.sty	2021-02-21 22:09:56 UTC (rev 57829)
@@ -9,11 +9,11 @@
 %% This is a generated file.
 %% 
 %% Project: luacolor
-%% Version: 2020-02-24 v1.15
+%% Version: 2021-02-17 v1.17
 %% 
 %% Copyright (C)
 %%    2007, 2009-2011 Heiko Oberdiek
-%%    2016-2020 Oberdiek Package Support Group
+%%    2016-2021 Oberdiek Package Support Group
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either
@@ -89,7 +89,7 @@
 \edef\LuaCol at AtEnd{\LuaCol at AtEnd\noexpand\endinput}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{luacolor}%
-  [2020-02-24 v1.15 Color support via LuaTeX's attributes (HO)]
+  [2021-02-17 v1.17 Color support via LuaTeX's attributes (HO)]
 \RequirePackage{color}
 \ifx\directlua\@undefined
   \PackageError{luacolor}{%
@@ -112,7 +112,7 @@
   require("luacolor")%
 }
 \begingroup
-  \edef\x{\directlua{tex.write("2020-02-24 v1.15")}}%
+  \edef\x{\directlua{tex.write("2021-02-17 v1.17")}}%
   \edef\y{%
     \directlua{%
       if oberdiek.luacolor.getversion then %
@@ -176,9 +176,15 @@
     oberdiek.luacolor.process(\number#1)%
   }%
 }
-\RequirePackage{atbegshi}[2011/01/30]
-\AtBeginShipout{%
-  \luacolorProcessBox\AtBeginShipoutBox
+\directlua{%
+  if luatexbase.callbacktypes.pre_shipout_filter then
+    token.get_next()
+  end
+}\@secondoftwo\@gobble{
+  \RequirePackage{atbegshi}[2011/01/30]
+  \AtBeginShipout{%
+    \luacolorProcessBox\AtBeginShipoutBox
+  }
 }
 \set at color
 \ifnum\outputmode=\@ne



More information about the tex-live-commits mailing list.