summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/luacolor/luacolor.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/luacolor/luacolor.sty')
-rw-r--r--Master/texmf-dist/tex/latex/luacolor/luacolor.sty98
1 files changed, 28 insertions, 70 deletions
diff --git a/Master/texmf-dist/tex/latex/luacolor/luacolor.sty b/Master/texmf-dist/tex/latex/luacolor/luacolor.sty
index 08c38b5f543..bad536ceae4 100644
--- a/Master/texmf-dist/tex/latex/luacolor/luacolor.sty
+++ b/Master/texmf-dist/tex/latex/luacolor/luacolor.sty
@@ -9,11 +9,11 @@
%% This is a generated file.
%%
%% Project: luacolor
-%% Version: 2019/11/29 v1.13
+%% Version: 2020-02-22 v1.14
%%
%% Copyright (C)
%% 2007, 2009-2011 Heiko Oberdiek
-%% 2016-2019 Oberdiek Package Support Group
+%% 2016-2020 Oberdiek Package Support Group
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -35,7 +35,6 @@
%% This work consists of the main source file luacolor.dtx
%% and the derived files
%% luacolor.sty, luacolor.pdf, luacolor.ins, luacolor.drv,
-%% luacolor-test1.tex, luacolor-test2.tex, luacolor-test3.tex,
%% luacolor.lua,
%%
\begingroup\catcode61\catcode48\catcode32=10\relax%
@@ -90,25 +89,17 @@
\edef\LuaCol@AtEnd{\LuaCol@AtEnd\noexpand\endinput}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luacolor}%
- [2019/11/29 v1.13 Color support via LuaTeX's attributes (HO)]
-\RequirePackage{infwarerr}[2010/04/08]%
-\RequirePackage{iftex}[2019/11/07]%
-\RequirePackage{ltxcmds}[2011/04/18]%
+ [2020-02-22 v1.14 Color support via LuaTeX's attributes (HO)]
\RequirePackage{color}
-\ifluatex
- \ifx\newattribute\@undefined
- \RequirePackage{ltluatex}%
- \fi
-\else
- \@PackageError{luacolor}{%
+\ifx\directlua\@undefined
+ \PackageError{luacolor}{%
This package may only be run using LuaTeX%
}\@ehc
\expandafter\LuaCol@AtEnd
\fi%
- \let\LuaCol@directlua\directlua
\ifcolors@
\else
- \@PackageWarningNoLine{luacolor}{%
+ \PackageWarningNoLine{luacolor}{%
Colors are disabled by option `monochrome'%
}%
\def\set@color{}%
@@ -117,13 +108,13 @@
\def\define@color#1#2{}%
\expandafter\LuaCol@AtEnd
\fi%
-\LuaCol@directlua{%
+\directlua{%
require("luacolor")%
}
\begingroup
- \edef\x{\LuaCol@directlua{tex.write("2019/11/29 v1.13")}}%
+ \edef\x{\directlua{tex.write("2020-02-22 v1.14")}}%
\edef\y{%
- \LuaCol@directlua{%
+ \directlua{%
if oberdiek.luacolor.getversion then %
oberdiek.luacolor.getversion()%
end%
@@ -131,14 +122,14 @@
}%
\ifx\x\y
\else
- \@PackageError{luacolor}{%
+ \PackageError{luacolor}{%
Wrong version of lua module.\MessageBreak
Package version: \x\MessageBreak
Lua module: \y
}\@ehc
\fi
\endgroup
-\ifpdf
+\ifnum\outputmode=\@ne
\else
\begingroup
\def\current@color{}%
@@ -149,47 +140,39 @@
\endgroup
}%
\edef\reserved@a{%
- \LuaCol@directlua{%
+ \directlua{%
oberdiek.luacolor.dvidetect()%
}%
}%
\ifx\reserved@a\@empty
- \@PackageError{luacolor}{%
+ \PackageError{luacolor}{%
DVI driver detection failed because of\MessageBreak
unrecognized color \string\special
}\@ehc
\endgroup
\expandafter\expandafter\expandafter\LuaCol@AtEnd
\else
- \@PackageInfoNoLine{luacolor}{%
+ \PackageInfo{luacolor}{%
Type of color \string\special: \reserved@a
- }%
+ \@gobble}%
\fi%
\endgroup
\fi
-\ltx@IfUndefined{newluatexattribute}{%
- \newattribute\LuaCol@Attribute
-}{%
- \newluatexattribute\LuaCol@Attribute
-}
-\ltx@IfUndefined{setluatexattribute}{%
- \let\LuaCol@setattribute\setattribute
-}{%
- \let\LuaCol@setattribute\setluatexattribute
-}
-\LuaCol@directlua{%
+\newattribute\LuaCol@Attribute
+\let\LuaCol@setattribute\setattribute
+\directlua{%
oberdiek.luacolor.setattribute(\number\allocationnumber)%
}
\protected\def\set@color{%
\LuaCol@setattribute\LuaCol@Attribute{%
- \LuaCol@directlua{%
+ \directlua{%
oberdiek.luacolor.get("\luaescapestring{\current@color}")%
}%
}%
}
\def\reset@color{}
\def\luacolorProcessBox#1{%
- \LuaCol@directlua{%
+ \directlua{%
oberdiek.luacolor.process(\number#1)%
}%
}
@@ -198,41 +181,16 @@
\luacolorProcessBox\AtBeginShipoutBox
}
\set@color
-\ifpdf
- \ifx\pdfxform\@undefined
- \let\pdfxform\saveboxresource
- \fi
- \ltx@IfUndefined{pdfxform}{%
- \directlua{%
- tex.enableprimitives('',{%
- 'pdfxform','pdflastxform','pdfrefxform'%
- })%
+\ifnum\outputmode=\@ne
+ \let\LuaCol@org@pdfxform\saveboxresource
+ \protected\def\saveboxresource{%
+ \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'))
}%
- }{}%
- \ltx@IfUndefined{protected}{%
- \directlua{tex.enableprimitives('',{'protected'})}%
- }{}%
- \ltx@IfUndefined{pdfxform}{%
- \@PackageWarning{luacolor}{\string\pdfxform\space not found}%
- }{%
- \let\LuaCol@org@pdfxform\pdfxform
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname protected\endcsname\relax
- \@PackageWarning{luacolor}{\string\protected\space not found}%
- \else
- \expandafter\protected
- \fi
- \def\pdfxform{%
- \begingroup
- \afterassignment\LuaCol@pdfxform
- \count@=%
}%
- \def\LuaCol@pdfxform{%
- \luacolorProcessBox\count@
- \LuaCol@org@pdfxform\count@
- \endgroup
- }%
- }%
+ \let\pdfxform\saveboxresource
\fi
\LuaCol@AtEnd%
\endinput