From 4556d09d2f5c1941ae8691aa0cdb19c674ba350c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 26 Feb 2020 22:10:25 +0000 Subject: luacolor (26feb20) git-svn-id: svn://tug.org/texlive/trunk@53933 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/luacolor/luacolor.lua | 4 +- Master/texmf-dist/tex/latex/luacolor/luacolor.sty | 83 ++++++++++++++++++++--- 2 files changed, 77 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/luacolor/luacolor.lua b/Master/texmf-dist/tex/latex/luacolor/luacolor.lua index d1075136a73..e95192a2fef 100644 --- a/Master/texmf-dist/tex/latex/luacolor/luacolor.lua +++ b/Master/texmf-dist/tex/latex/luacolor/luacolor.lua @@ -9,7 +9,7 @@ -- This is a generated file. -- -- Project: luacolor --- Version: 2020-02-22 v1.14 +-- Version: 2020-02-24 v1.15 -- -- Copyright (C) -- 2007, 2009-2011 Heiko Oberdiek @@ -41,7 +41,7 @@ oberdiek = oberdiek or {} local luacolor = oberdiek.luacolor or {} oberdiek.luacolor = luacolor function luacolor.getversion() - tex.write("2020-02-22 v1.14") + tex.write("2020-02-24 v1.15") end local ifpdf = tonumber(tex.outputmode or tex.pdfoutput) > 0 local prefix diff --git a/Master/texmf-dist/tex/latex/luacolor/luacolor.sty b/Master/texmf-dist/tex/latex/luacolor/luacolor.sty index bad536ceae4..af5de64684d 100644 --- a/Master/texmf-dist/tex/latex/luacolor/luacolor.sty +++ b/Master/texmf-dist/tex/latex/luacolor/luacolor.sty @@ -9,7 +9,7 @@ %% This is a generated file. %% %% Project: luacolor -%% Version: 2020-02-22 v1.14 +%% Version: 2020-02-24 v1.15 %% %% Copyright (C) %% 2007, 2009-2011 Heiko Oberdiek @@ -89,7 +89,7 @@ \edef\LuaCol@AtEnd{\LuaCol@AtEnd\noexpand\endinput} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luacolor}% - [2020-02-22 v1.14 Color support via LuaTeX's attributes (HO)] + [2020-02-24 v1.15 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-22 v1.14")}}% + \edef\x{\directlua{tex.write("2020-02-24 v1.15")}}% \edef\y{% \directlua{% if oberdiek.luacolor.getversion then % @@ -183,13 +183,80 @@ \set@color \ifnum\outputmode=\@ne \let\LuaCol@org@pdfxform\saveboxresource - \protected\def\saveboxresource{% + \def\LuaCol@iii@i@ii#1#2#3{#3{#1}{#2}} + \def\LuaCol@ii@i#1#2{{#2#1}} + \def\LuaCol@if@keyword#1#2#3{% + \expanded{\unexpanded{\LuaCol@iii@i@ii{#2}{#3}}\expandafter}% + \directlua{% + token.put_next(token.create(token.scan_keyword(token.scan_string()) + and '@firstoftwo' + or '@secondoftwo')) + }{#1}% + } + \def\LuaCol@scan@number{% \directlua{ - local c = token.scan_int() - oberdiek.luacolor.process(c) - token.put_next(token.create'LuaCol@org@pdfxform', token.new(c, token.command_id'char_given')) + token.put_next(token.new(token.scan_int(), token.command_id'char_given')) }% - }% + } + \def\LuaCol@scan@tobrace{% + \directlua{ + local relax, space = token.command_id'relax', token.command_id'spacer' + local t + repeat + t = token.scan_token() + until not (t.command == relax or t.command == space) + token.put_next(t) + }% + } + \def\LuaCol@scan@boxresource@i#1#2{% + \LuaCol@if@keyword{attr}{% + \expanded{\unexpanded{\LuaCol@scan@boxresource@iI{#1#2attr}}% + \expandafter\expandafter\expandafter}% + \LuaCol@scan@tobrace + }{% + \LuaCol@scan@boxresource@ii{#1#2}% + }% + } + \def\LuaCol@scan@boxresource@iI#1#2{\LuaCol@scan@boxresource@ii{#1{#2}}} + \def\LuaCol@scan@boxresource@ii#1{% + \LuaCol@if@keyword{resources}{% + \expanded{\unexpanded{\LuaCol@scan@boxresource@iiI{#1resources}}% + \expandafter\expandafter\expandafter}% + \LuaCol@scan@tobrace + }{% + \LuaCol@scan@boxresource@iii{#1}% + }% + } + \def\LuaCol@scan@boxresource@iiI#1#2{\LuaCol@scan@boxresource@iii{#1{#2}}} + \def\LuaCol@scan@boxresource@iii#1{% + \LuaCol@if@keyword{margin}{% + \expanded{\unexpanded{\LuaCol@scan@boxresource@iv{#1margin }}% + \expandafter\expandafter\expandafter}% + \LuaCol@scan@number + }{% + \LuaCol@scan@boxresource@iv{#1}{}% + }% + } + \def\LuaCol@scan@boxresource@iv#1#2{% + \expanded{\unexpanded{\LuaCol@scan@boxresource@v{#1#2}}% + \expandafter\expandafter\expandafter}% + \LuaCol@scan@number + } + \def\LuaCol@scan@boxresource@v#1#2{% + \luacolorProcessBox{#2}% + \LuaCol@org@pdfxform#1#2% + } + + \protected\def\saveboxresource{% + \LuaCol@if@keyword{type}{% + \expandafter + \expanded{\unexpanded{\LuaCol@scan@boxresource@i{type }}% + \expandafter\expandafter\expandafter}% + \LuaCol@scan@number + }{% + \LuaCol@scan@boxresource@i{}{}% + }% + } \let\pdfxform\saveboxresource \fi \LuaCol@AtEnd% -- cgit v1.2.3