diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/luacolor.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/luacolor.dtx | 118 |
1 files changed, 91 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx b/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx index c714e3cc79e..4d4d4386e84 100644 --- a/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/luacolor.dtx @@ -1,11 +1,12 @@ % \iffalse meta-comment -% +% % File: luacolor.dtx -% Version: 2011/04/23 v1.6 -% +% Version: 2011/11/01 v1.8 +% Info: Color support via LuaTeX's attributes +% % Copyright (C) 2007, 2009-2011 by % Heiko Oberdiek <heiko.oberdiek at googlemail.com> -% +% % 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 @@ -15,22 +16,22 @@ % http://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". -% +% % This Current Maintainer of this work is Heiko Oberdiek. -% +% % 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, % oberdiek.luacolor.lua, luacolor.lua, % oberdiek.luacolor-pre065.lua, luacolor-pre065.lua. -% +% % Distribution: % CTAN:macros/latex/contrib/oberdiek/luacolor.dtx % CTAN:macros/latex/contrib/oberdiek/luacolor.pdf -% +% % Unpacking: % (a) If luacolor.ins is present: % tex luacolor.ins @@ -39,7 +40,7 @@ % (c) If you insist on using LaTeX % latex \let\install=y\input{luacolor.dtx} % (quote the arguments according to the demands of your shell) -% +% % Documentation: % (a) If luacolor.drv is present: % latex luacolor.drv @@ -49,14 +50,14 @@ % if available. Here you can specify further options, e.g. % use A4 as paper format: % \PassOptionsToClass{a4paper}{article} -% +% % Programm calls to get the documentation (example): % pdflatex luacolor.dtx % makeindex -s gind.ist luacolor.idx % pdflatex luacolor.dtx % makeindex -s gind.ist luacolor.idx % pdflatex luacolor.dtx -% +% % Installation: % TDS:tex/latex/oberdiek/luacolor.sty % TDS:scripts/oberdiek/oberdiek.luacolor.lua @@ -84,7 +85,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luacolor 2011/04/23 v1.6 Coloring based on LuaTeX's node attributes (HO)} +\Msg{* Package: luacolor 2011/11/01 v1.8 Color support via LuaTeX's attributes (HO)} \Msg{************************************************************************} \keepsilent @@ -96,7 +97,7 @@ This is a generated file. Project: luacolor -Version: 2011/04/23 v1.6 +Version: 2011/11/01 v1.8 Copyright (C) 2007, 2009-2011 by Heiko Oberdiek <heiko.oberdiek at googlemail.com> @@ -134,6 +135,10 @@ and the derived files \file{luacolor-test1.tex}{\from{luacolor.dtx}{test1}}% \file{luacolor-test2.tex}{\from{luacolor.dtx}{test2}}% \file{luacolor-test3.tex}{\from{luacolor.dtx}{test3}}% + \nopreamble + \nopostamble + \usedir{source/latex/oberdiek/catalogue}% + \file{luacolor.xml}{\from{luacolor.dtx}{catalogue}}% } \def\MetaPrefix{-- } \def\defaultpostamble{% @@ -178,9 +183,9 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luacolor.drv}% - [2011/04/23 v1.6 Coloring based on LuaTeX's node attributes (HO)]% + [2011/11/01 v1.8 Color support via LuaTeX's attributes (HO)]% \documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/02/04] +\usepackage{holtxdoc}[2011/11/22] \usepackage{paralist} \makeatletter \g@addto@macro\MakePrivateLetters{% @@ -214,7 +219,7 @@ and the derived files % \GetFileInfo{luacolor.drv} % % \title{The \xpackage{luacolor} package} -% \date{2011/04/23 v1.6} +% \date{2011/11/01 v1.8} % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}} % % \maketitle @@ -356,7 +361,7 @@ and the derived files % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luacolor}% - [2011/04/23 v1.6 Coloring based on LuaTeX's node attributes (HO)] + [2011/11/01 v1.8 Color support via LuaTeX's attributes (HO)] % \end{macrocode} % % \subsection{Check for \LuaTeX} @@ -418,7 +423,7 @@ and the derived files % \end{macrocode} % \begin{macrocode} \begingroup - \edef\x{\LuaCol@directlua{tex.write("2011/04/23 v1.6")}}% + \edef\x{\LuaCol@directlua{tex.write("2011/11/01 v1.8")}}% \edef\y{% \LuaCol@directlua{% if oberdiek.luacolor.getversion then % @@ -593,7 +598,7 @@ module("oberdiek.luacolor", package.seeall) % \begin{macro}{getversion()} % \begin{macrocode} function getversion() - tex.write("2011/04/23 v1.6") + tex.write("2011/11/01 v1.8") end % \end{macrocode} % \end{macro} @@ -645,7 +650,7 @@ function dvidetect() assert(v.id == node.id("hlist")) %<!pre065> for v in node.traverse_id(node.id("whatsit"), v.head) do %<pre065> for v in node.traverse_id(node.id("whatsit"), v.list) do - if v and v.subtype == 3 then -- special + if v and v.subtype == node.subtype("special") then local data = v.data for pattern, driver in pairs(patterns) do if string.find(data, pattern) then @@ -673,6 +678,13 @@ local map = { % \begin{macro}{get()} % \begin{macrocode} function get(color) + tex.write("" .. getvalue(color)) +end +% \end{macrocode} +% \end{macro} +% \begin{macro}{getvalue()} +% \begin{macrocode} +function getvalue(color) local n = map[color] if not n then n = map.n + 1 @@ -680,7 +692,7 @@ function get(color) map[n] = color map[color] = n end - tex.write("" .. n) + return n end % \end{macrocode} % \end{macro} @@ -696,6 +708,14 @@ end % \end{macrocode} % \end{macro} % +% \begin{macro}{getattribute()} +% \begin{macrocode} +function getattribute() + return attribute +end +% \end{macrocode} +% \end{macro} +% % \subsubsection{Whatsit insertion} % % \begin{macrocode} @@ -710,9 +730,9 @@ local node_types = { [node.id("glyph")] = COLOR, [node.id("disc")] = COLOR, [node.id("whatsit")] = { - [3] = COLOR, -- special - [8] = COLOR, -- pdf_literal - [14] = COLOR, -- pdf_refximage + [node.subtype("special")] = COLOR, + [node.subtype("pdf_literal")] = COLOR, + [node.subtype("pdf_refximage")] = COLOR, }, [node.id("glue")] = function(n) @@ -958,7 +978,7 @@ end \pdfoutput=0 % \fi \documentclass{minimal} -\usepackage{luacolor}[2011/04/23] +\usepackage{luacolor}[2011/11/01] \csname @@end\endcsname \end %</test2> @@ -970,7 +990,7 @@ end % \end{macrocode} % \begin{macrocode} \documentclass{minimal} -\usepackage{luacolor}[2011/04/23] +\usepackage{luacolor}[2011/11/01] \usepackage{qstest} \IncludeTests{*} \LogTests{log}{*}{*} @@ -1169,6 +1189,40 @@ end %\end{verbatim} % \end{quote} % +% \section{Catalogue} +% +% The following XML file can be used as source for the +% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}. +% The elements \texttt{caption} and \texttt{description} are imported +% from the original XML file from the Catalogue. +% The name of the XML file in the Catalogue is \xfile{luacolor.xml}. +% \begin{macrocode} +%<*catalogue> +<?xml version='1.0' encoding='us-ascii'?> +<!DOCTYPE entry SYSTEM 'catalogue.dtd'> +<entry datestamp='$Date$' modifier='$Author$' id='luacolor'> + <name>luacolor</name> + <caption>Color support based on LuaTeX's node attributes.</caption> + <authorref id='auth:oberdiek'/> + <copyright owner='Heiko Oberdiek' year='2007,2009-2011'/> + <license type='lppl1.3'/> + <version number='1.8'/> + <description> + This package implements color support based on LuaTeX's node + attributes. + <p/> + The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle. + </description> + <documentation details='Package documentation' + href='ctan:/macros/latex/contrib/oberdiek/luacolor.pdf'/> + <ctan file='true' path='/macros/latex/contrib/oberdiek/luacolor.dtx'/> + <miktex location='oberdiek'/> + <texlive location='oberdiek'/> + <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/> +</entry> +%</catalogue> +% \end{macrocode} +% % \begin{History} % \begin{Version}{2007/12/12 v1.0} % \item @@ -1224,6 +1278,16 @@ end % \item % Version check for Lua module added. % \end{Version} +% \begin{Version}{2011/10/22 v1.7} +% \item +% Lua functions \texttt{getattribute} and \texttt{getvalue} +% added to tell other external Lua functions +% the attribute register number for coloring. +% \end{Version} +% \begin{Version}{2011/11/01 v1.8} +% \item +% Use of \texttt{node.subtype} instead of magic numbers. +% \end{Version} % \end{History} % % \PrintIndex |