Skip to content

Commit

Permalink
Merge pull request #65 from dohyunkim/master
Browse files Browse the repository at this point in the history
v2.11.3
  • Loading branch information
dohyunkim committed Mar 31, 2016
2 parents 38c8028 + 776943d commit 05b330c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
History of the luamplib package

2016/03/31 2.11.3
* fix a bug regarding nested mplibcode environments (issue #63)

2016/01/02 2.11.2
* updates for luatex 0.87

Expand Down
29 changes: 16 additions & 13 deletions luamplib.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ See source file '\inFileName' for licencing and contact information.
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{luamplib.drv}%
[2016/01/02 v2.11.2 Interface for using the mplib library]%
[2016/03/31 v2.11.3 Interface for using the mplib library]%
\documentclass{ltxdoc}
\usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace}
\usepackage[x11names]{xcolor}
Expand Down Expand Up @@ -153,7 +153,7 @@ See source file '\inFileName' for licencing and contact information.
% \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\
% Maintainer: LuaLaTeX Maintainers ---
% Support: \email{[email protected]}}
% \date{2016/01/02 v2.11.2}
% \date{2016/03/31 v2.11.3}
%
% \maketitle
%
Expand Down Expand Up @@ -369,8 +369,8 @@ luamplib.lastlog = ""

luatexbase.provides_module {
name = "luamplib",
version = "2.11.2",
date = "2016/01/02",
version = "2.11.3",
date = "2016/03/31",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}

Expand Down Expand Up @@ -1136,6 +1136,8 @@ end
luamplib.protecttextextVerbatim = protecttextextVerbatim
luamplib.mpxcolors = {}
local function protecttextext(data)
data = protect_tex_text_common(data)
Expand All @@ -1150,13 +1152,14 @@ local function protecttextext(data)
data = data:gsub("%%.-\n", "")
luamplib.mpxcolors = {}
local grouplevel = tex.currentgrouplevel
luamplib.mpxcolors[grouplevel] = {}
data = data:gsub("\\mpcolor"..endname.."(.-){(.-)}", function(opt,str)
local cnt = #luamplib.mpxcolors + 1
luamplib.mpxcolors[cnt] = format(
"\\expandafter\\mplibcolor\\csname mpxcolor%i\\endcsname%s{%s}",
cnt,opt,str)
return format("\\csname mpxcolor%i\\endcsname",cnt)
local cnt = #luamplib.mpxcolors[grouplevel] + 1
luamplib.mpxcolors[grouplevel][cnt] = format(
"\\expandafter\\mplibcolor\\csname mpxcolor%i:%i\\endcsname%s{%s}",
grouplevel,cnt,opt,str)
return format("\\csname mpxcolor%i:%i\\endcsname",grouplevel,cnt)
end)
% \end{macrocode}
Expand Down Expand Up @@ -1705,7 +1708,7 @@ luamplib.colorconverter = colorconverter
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luamplib}
[2016/01/02 v2.11.2 mplib package for LuaTeX]
[2016/03/31 v2.11.3 mplib package for LuaTeX]
\ifx\newluafunction\@undefined
\input ltluatex
\fi
Expand Down Expand Up @@ -1796,7 +1799,7 @@ luamplib.colorconverter = colorconverter
\directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\else
\edef\mplibtemp{\directlua{luamplib.protecttextext([===[\unexpanded{#1}]===])}}%
\directlua{ tex.sprint(luamplib.mpxcolors) }%
\directlua{ tex.sprint(luamplib.mpxcolors[\the\currentgrouplevel]) }%
\directlua{luamplib.tempdata\the\currentgrouplevel=luamplib.makeTEXboxes([===[\mplibtemp]===])}%
\directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\fi
Expand Down Expand Up @@ -1828,7 +1831,7 @@ luamplib.colorconverter = colorconverter
\directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\else
\edef\mplibtemp{\directlua{luamplib.protecttextext([===[\the\toks@]===])}}%
\directlua{ tex.sprint(luamplib.mpxcolors) }%
\directlua{ tex.sprint(luamplib.mpxcolors[\the\currentgrouplevel]) }%
\directlua{luamplib.tempdata\the\currentgrouplevel=luamplib.makeTEXboxes([===[\mplibtemp]===])}%
\directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\fi
Expand Down

0 comments on commit 05b330c

Please sign in to comment.