summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/oberdiek/luacolor.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/luacolor.sty')
-rw-r--r--Master/texmf-dist/tex/latex/oberdiek/luacolor.sty123
1 files changed, 93 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/luacolor.sty b/Master/texmf-dist/tex/latex/oberdiek/luacolor.sty
index 7492c2ee620..ef1b85c3829 100644
--- a/Master/texmf-dist/tex/latex/oberdiek/luacolor.sty
+++ b/Master/texmf-dist/tex/latex/oberdiek/luacolor.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2007, 2009, 2010 by
+%% Copyright (C) 2007, 2009-2011 by
%% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%%
%% This work may be distributed and/or modified under the
@@ -29,30 +29,40 @@
%% and the derived files
%% luacolor.sty, luacolor.pdf, luacolor.ins, luacolor.drv,
%% luacolor-test1.tex, luacolor-test2.tex, luacolor-test3.tex,
-%% oberdiek.luacolor.lua, luacolor.lua.
+%% oberdiek.luacolor.lua, luacolor.lua,
+%% oberdiek.luacolor-pre065.lua, luacolor-pre065.lua.
%%
-\begingroup
- \catcode123 1 % {
- \catcode125 2 % }
+\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{%
- \catcode35 \the\catcode35\relax
- \catcode64 \the\catcode64\relax
- \catcode123 \the\catcode123\relax
- \catcode125 \the\catcode125\relax
+ \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
-\catcode35 6 % #
-\catcode64 11 % @
-\catcode123 1 % {
-\catcode125 2 % }
+\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=\the\catcode#1\relax
}%
- \catcode#1 #2\relax
+ \catcode#1=#2\relax
}
\TMP@EnsureCode{34}{12}% "
\TMP@EnsureCode{39}{12}% '
@@ -66,28 +76,31 @@
\TMP@EnsureCode{47}{12}% /
\TMP@EnsureCode{58}{12}% :
\TMP@EnsureCode{60}{12}% <
-\TMP@EnsureCode{61}{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
-}
+\edef\LuaCol@AtEnd{\LuaCol@AtEnd\noexpand\endinput}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luacolor}%
- [2010/03/09 v1.2 Coloring based on LuaTeX's node attributes (HO)]
+ [2011/03/29 v1.4 Coloring based on LuaTeX's node attributes (HO)]
\RequirePackage{infwarerr}[2007/09/09]%
\RequirePackage{ifluatex}[2009/04/10]%
+\RequirePackage{ifpdf}[2010/01/28]%
+\RequirePackage{ltxcmds}[2010/04/26]%
\RequirePackage{color}
\ifluatex
- \RequirePackage{luatex}[2010/03/09]%
+ \ltx@ifpackageloaded{luatexbase-attr}{%
+ }{%
+ \RequirePackage{luatex}[2010/03/09]%
+ }%
\else
\@PackageError{luacolor}{%
This package may only be run using LuaTeX%
}\@ehc
\expandafter\LuaCol@AtEnd
-\fi
+\fi%
\ifnum\luatexversion<36 %
\def\LuaCol@directlua{\directlua0 }%
\else
@@ -98,10 +111,14 @@
\@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
+\fi%
\LuaCol@directlua{%
- require("oberdiek.luacolor")%
+ require("oberdiek.luacolor\ifnum\luatexversion<65 -pre065\fi")%
}
\RequirePackage{ifpdf}[2007/09/09]
\ifpdf
@@ -130,15 +147,24 @@
\@PackageInfoNoLine{luacolor}{%
Type of color \string\special: \reserved@a
}%
- \fi
+ \fi%
\endgroup
\fi
-\newattribute\LuaCol@Attribute
+\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{%
- \setattribute\LuaCol@Attribute{%
+ \LuaCol@setattribute\LuaCol@Attribute{%
\LuaCol@directlua{%
oberdiek.luacolor.get("\luatexluaescapestring{\current@color}")%
}%
@@ -155,7 +181,44 @@
\luacolorProcessBox\AtBeginShipoutBox
}
\set@color
-\LuaCol@AtEnd
+\ifpdf
+ \ltx@IfUndefined{pdfxform}{%
+ \ifnum\luatexversion>36 %
+ \directlua{%
+ tex.enableprimitives('',{%
+ 'pdfxform','pdflastxform','pdfrefxform'%
+ })%
+ }%
+ \fi
+ }{}%
+ \ltx@IfUndefined{protected}{%
+ \ifnum\luatexversion>36 %
+ \directlua{tex.enableprimitives('',{'protected'})}%
+ \fi
+ }{}%
+ \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'.