summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/luacolor.dtx')
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/luacolor.dtx99
1 files changed, 84 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx b/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx
index 8ba6eaa1f0d..c714e3cc79e 100644
--- a/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% File: luacolor.dtx
-% Version: 2011/04/22 v1.5
+% Version: 2011/04/23 v1.6
%
% Copyright (C) 2007, 2009-2011 by
% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
@@ -84,7 +84,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: luacolor 2011/04/22 v1.5 Coloring based on LuaTeX's node attributes (HO)}
+\Msg{* Package: luacolor 2011/04/23 v1.6 Coloring based on LuaTeX's node attributes (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -96,7 +96,7 @@
This is a generated file.
Project: luacolor
-Version: 2011/04/22 v1.5
+Version: 2011/04/23 v1.6
Copyright (C) 2007, 2009-2011 by
Heiko Oberdiek <heiko.oberdiek at googlemail.com>
@@ -178,17 +178,22 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{luacolor.drv}%
- [2011/04/22 v1.5 Coloring based on LuaTeX's node attributes (HO)]%
+ [2011/04/23 v1.6 Coloring based on LuaTeX's node attributes (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}[2011/02/04]
\usepackage{paralist}
+\makeatletter
+\g@addto@macro\MakePrivateLetters{%
+ \@makeother\_%
+}
+\makeatother
\begin{document}
\DocInput{luacolor.dtx}%
\end{document}
%</driver>
% \fi
%
-% \CheckSum{454}
+% \CheckSum{473}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -209,7 +214,7 @@ and the derived files
% \GetFileInfo{luacolor.drv}
%
% \title{The \xpackage{luacolor} package}
-% \date{2011/04/22 v1.5}
+% \date{2011/04/23 v1.6}
% \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}}
%
% \maketitle
@@ -351,7 +356,7 @@ and the derived files
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luacolor}%
- [2011/04/22 v1.5 Coloring based on LuaTeX's node attributes (HO)]
+ [2011/04/23 v1.6 Coloring based on LuaTeX's node attributes (HO)]
% \end{macrocode}
%
% \subsection{Check for \LuaTeX}
@@ -404,12 +409,37 @@ and the derived files
\fi%
% \end{macrocode}
%
-% \subsection{Find driver}
+% \subsection{Load module and check version}
%
% \begin{macrocode}
\LuaCol@directlua{%
require("oberdiek.luacolor\ifnum\luatexversion<65 -pre065\fi")%
}
+% \end{macrocode}
+% \begin{macrocode}
+\begingroup
+ \edef\x{\LuaCol@directlua{tex.write("2011/04/23 v1.6")}}%
+ \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
+% \end{macrocode}
+%
+% \subsection{Find driver}
+%
+% \begin{macrocode}
\ifpdf
\else
\begingroup
@@ -560,6 +590,13 @@ and the derived files
% \begin{macrocode}
module("oberdiek.luacolor", package.seeall)
% \end{macrocode}
+% \begin{macro}{getversion()}
+% \begin{macrocode}
+function getversion()
+ tex.write("2011/04/23 v1.6")
+end
+% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Driver detection}
%
@@ -589,6 +626,7 @@ local patterns = {
["^ps::"] = "pctexps",
}
% \end{macrocode}
+% \begin{macro}{info()}
% \begin{macrocode}
local function info(msg, term)
local target = "log"
@@ -599,6 +637,8 @@ local function info(msg, term)
texio.write_nl(target, "")
end
% \end{macrocode}
+% \end{macro}
+% \begin{macro}{dvidetect()}
% \begin{macrocode}
function dvidetect()
local v = tex.box[0]
@@ -621,6 +661,7 @@ function dvidetect()
info("Missing \\special", true)
end
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Color strings}
%
@@ -628,6 +669,9 @@ end
local map = {
n = 0,
}
+% \end{macrocode}
+% \begin{macro}{get()}
+% \begin{macrocode}
function get(color)
local n = map[color]
if not n then
@@ -639,15 +683,18 @@ function get(color)
tex.write("" .. n)
end
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Attribute register}
%
+% \begin{macro}{setattribute()}
% \begin{macrocode}
local attribute
function setattribute(attr)
attribute = attr
end
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Whatsit insertion}
%
@@ -678,6 +725,9 @@ local node_types = {
end
end,
}
+% \end{macrocode}
+% \begin{macro}{get_type()}
+% \begin{macrocode}
local function get_type(n)
local ret = node_types[n.id]
if type(ret) == 'table' then
@@ -688,13 +738,17 @@ local function get_type(n)
end
return ret
end
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
local mode = 2 -- luatex.pdfliteral.direct
local WHATSIT = node.id("whatsit")
local SPECIAL = 3
local PDFLITERAL = 8
-local DRY_FALSE = 0
-local DRY_TRUE = 1
+local DRY_FALSE = false
+local DRY_TRUE = true
% \end{macrocode}
+% \begin{macro}{traverse()}
% \begin{macrocode}
local function traverse(list, color, dry)
if not list then
@@ -711,13 +765,16 @@ local function traverse(list, color, dry)
%<debug>texio.write_nl(" node: " .. node.type(n.id))
local t = get_type(n)
if t == LIST then
- color = traverse(n, color, DRY_FALSE)
+ color = traverse(n, color, dry)
elseif t == LIST_LEADERS then
local color_after = traverse(n.leader, color, DRY_TRUE)
if color == color_after then
- traverse(n.leader, color, DRY_FALSE)
+ traverse(n.leader, color, DRY_FALSE or dry)
else
- traverse(n.leader, '', DRY_FALSE)
+ traverse(n.leader, '', DRY_FALSE or dry)
+% The color status is unknown here, because the leader box
+% will or will not be set.
+ color = ''
end
elseif t == COLOR then
local v = node.has_attribute(n, attribute)
@@ -759,7 +816,9 @@ local function traverse(list, color, dry)
return color
end
% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{process()}
% \begin{macrocode}
function process(box)
local color = ""
@@ -767,6 +826,7 @@ function process(box)
traverse(list, color, DRY_FALSE)
end
% \end{macrocode}
+% \end{macro}
%
% \begin{macrocode}
%</lua>
@@ -898,7 +958,7 @@ end
\pdfoutput=0 %
\fi
\documentclass{minimal}
-\usepackage{luacolor}[2011/04/22]
+\usepackage{luacolor}[2011/04/23]
\csname @@end\endcsname
\end
%</test2>
@@ -910,7 +970,7 @@ end
% \end{macrocode}
% \begin{macrocode}
\documentclass{minimal}
-\usepackage{luacolor}[2011/04/22]
+\usepackage{luacolor}[2011/04/23]
\usepackage{qstest}
\IncludeTests{*}
\LogTests{log}{*}{*}
@@ -1155,6 +1215,15 @@ end
% removed for the version after \hologo{LuaTeX} 0.65, because
% bug was fixed in 0.27. (Thanks Manuel P\'egouri\'e-Gonnard.)
% \end{Version}
+% \begin{Version}{2011/04/23 v1.6}
+% \item
+% Bug fix for nested leader boxes.
+% \item
+% Bug fix for leader boxes that change color, but
+% are not set because of missing place.
+% \item
+% Version check for Lua module added.
+% \end{Version}
% \end{History}
%
% \PrintIndex