summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/luacolor
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-11-30 22:18:23 +0000
committerKarl Berry <karl@freefriends.org>2019-11-30 22:18:23 +0000
commit4b5127164d0e1d685bfd39748c2df3dd613040e1 (patch)
tree90694ae7975d2ced844b8912c6101013cd058ae9 /Master/texmf-dist/tex/latex/luacolor
parent08ba638847461b32675823280b8f14cd17d99860 (diff)
luacolor (30nov19)
git-svn-id: svn://tug.org/texlive/trunk@52984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/luacolor')
-rw-r--r--Master/texmf-dist/tex/latex/luacolor/luacolor.sty240
1 files changed, 240 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/luacolor/luacolor.sty b/Master/texmf-dist/tex/latex/luacolor/luacolor.sty
new file mode 100644
index 00000000000..08c38b5f543
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/luacolor/luacolor.sty
@@ -0,0 +1,240 @@
+%%
+%% This is file `luacolor.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% luacolor.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Project: luacolor
+%% Version: 2019/11/29 v1.13
+%%
+%% Copyright (C)
+%% 2007, 2009-2011 Heiko Oberdiek
+%% 2016-2019 Oberdiek Package Support Group
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/luacolor/issues
+%%
+%%
+%% 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%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
+ \def\x{\endgroup
+ \expandafter\edef\csname LuaCol@AtEnd\endcsname{%
+ \endlinechar=\the\endlinechar\relax
+ \catcode13=\the\catcode13\relax
+ \catcode32=\the\catcode32\relax
+ \catcode35=\the\catcode35\relax
+ \catcode61=\the\catcode61\relax
+ \catcode64=\the\catcode64\relax
+ \catcode123=\the\catcode123\relax
+ \catcode125=\the\catcode125\relax
+ }%
+ }%
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
+\def\TMP@EnsureCode#1#2{%
+ \edef\LuaCol@AtEnd{%
+ \LuaCol@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{95}{12}% _ (other!)
+\TMP@EnsureCode{96}{12}% `
+\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]%
+\RequirePackage{color}
+\ifluatex
+ \ifx\newattribute\@undefined
+ \RequirePackage{ltluatex}%
+ \fi
+\else
+ \@PackageError{luacolor}{%
+ This package may only be run using LuaTeX%
+ }\@ehc
+ \expandafter\LuaCol@AtEnd
+\fi%
+ \let\LuaCol@directlua\directlua
+\ifcolors@
+\else
+ \@PackageWarningNoLine{luacolor}{%
+ Colors are disabled by option `monochrome'%
+ }%
+ \def\set@color{}%
+ \def\reset@color{}%
+ \def\set@page@color{}%
+ \def\define@color#1#2{}%
+ \expandafter\LuaCol@AtEnd
+\fi%
+\LuaCol@directlua{%
+ require("luacolor")%
+}
+\begingroup
+ \edef\x{\LuaCol@directlua{tex.write("2019/11/29 v1.13")}}%
+ \edef\y{%
+ \LuaCol@directlua{%
+ if oberdiek.luacolor.getversion then %
+ oberdiek.luacolor.getversion()%
+ end%
+ }%
+ }%
+ \ifx\x\y
+ \else
+ \@PackageError{luacolor}{%
+ Wrong version of lua module.\MessageBreak
+ Package version: \x\MessageBreak
+ Lua module: \y
+ }\@ehc
+ \fi
+\endgroup
+\ifpdf
+\else
+ \begingroup
+ \def\current@color{}%
+ \def\reset@color{}%
+ \setbox\z@=\hbox{%
+ \begingroup
+ \set@color
+ \endgroup
+ }%
+ \edef\reserved@a{%
+ \LuaCol@directlua{%
+ oberdiek.luacolor.dvidetect()%
+ }%
+ }%
+ \ifx\reserved@a\@empty
+ \@PackageError{luacolor}{%
+ DVI driver detection failed because of\MessageBreak
+ unrecognized color \string\special
+ }\@ehc
+ \endgroup
+ \expandafter\expandafter\expandafter\LuaCol@AtEnd
+ \else
+ \@PackageInfoNoLine{luacolor}{%
+ Type of color \string\special: \reserved@a
+ }%
+ \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{%
+ oberdiek.luacolor.setattribute(\number\allocationnumber)%
+}
+\protected\def\set@color{%
+ \LuaCol@setattribute\LuaCol@Attribute{%
+ \LuaCol@directlua{%
+ oberdiek.luacolor.get("\luaescapestring{\current@color}")%
+ }%
+ }%
+}
+\def\reset@color{}
+\def\luacolorProcessBox#1{%
+ \LuaCol@directlua{%
+ oberdiek.luacolor.process(\number#1)%
+ }%
+}
+\RequirePackage{atbegshi}[2011/01/30]
+\AtBeginShipout{%
+ \luacolorProcessBox\AtBeginShipoutBox
+}
+\set@color
+\ifpdf
+ \ifx\pdfxform\@undefined
+ \let\pdfxform\saveboxresource
+ \fi
+ \ltx@IfUndefined{pdfxform}{%
+ \directlua{%
+ tex.enableprimitives('',{%
+ 'pdfxform','pdflastxform','pdfrefxform'%
+ })%
+ }%
+ }{}%
+ \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
+ }%
+ }%
+\fi
+\LuaCol@AtEnd%
+\endinput
+%%
+%% End of file `luacolor.sty'.