summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/luacolor/luacolor.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/luacolor/luacolor.lua')
-rw-r--r--Master/texmf-dist/tex/latex/luacolor/luacolor.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/luacolor/luacolor.lua b/Master/texmf-dist/tex/latex/luacolor/luacolor.lua
index e95192a2fef..851b72c5190 100644
--- a/Master/texmf-dist/tex/latex/luacolor/luacolor.lua
+++ b/Master/texmf-dist/tex/latex/luacolor/luacolor.lua
@@ -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 @@ oberdiek = oberdiek or {}
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 = 1
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 @@ local node_types = {
[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 @@ local function traverse(list, color, dry)
end
end
end
+ elseif t == NOCOLOR then
+ color = ''
end
end
if get_type(list) == LIST then
@@ -216,6 +223,13 @@ function luacolor.process(box)
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)