summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.lua19
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.sty22
2 files changed, 22 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
index db75e0d90c0..5030c708e47 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
@@ -18,8 +18,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.",
}
@@ -704,6 +704,8 @@ end
luamplib.protecttextextVerbatim = protecttextextVerbatim
+luamplib.mpxcolors = {}
+
local function protecttextext(data)
data = protect_tex_text_common(data)
@@ -718,13 +720,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)
data = data:gsub("([^`\\])#","%1##")
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
index 3cfeb24912b..e9eb69dbd00 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
@@ -14,7 +14,7 @@
\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
@@ -70,13 +70,13 @@
\long\def\mplibdocode#1\endmplibcode{%
\endgroup
\ifdefined\mplibverbatimYes
- \directlua{luamplib.tempdata = luamplib.protecttextextVerbatim([===[\detokenize{#1}]===])}%
- \directlua{luamplib.processwithTEXboxes(luamplib.tempdata)}%
+ \directlua{luamplib.tempdata\the\currentgrouplevel=luamplib.protecttextextVerbatim([===[\detokenize{#1}]===])}%
+ \directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\else
\edef\mplibtemp{\directlua{luamplib.protecttextext([===[\unexpanded{#1}]===])}}%
- \directlua{ tex.sprint(luamplib.mpxcolors) }%
- \directlua{luamplib.tempdata = luamplib.makeTEXboxes([===[\mplibtemp]===])}%
- \directlua{luamplib.processwithTEXboxes(luamplib.tempdata)}%
+ \directlua{ tex.sprint(luamplib.mpxcolors[\the\currentgrouplevel]) }%
+ \directlua{luamplib.tempdata\the\currentgrouplevel=luamplib.makeTEXboxes([===[\mplibtemp]===])}%
+ \directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\fi
\endgroup
\ifnum\mplibstartlineno<\inputlineno\expandafter\mplibreplacenewlinecs\fi
@@ -97,13 +97,13 @@
\toks@\expandafter{\the\toks@#1}%
\def\mplibtemp@a{#2}\ifx\mplib@mplibcode\mplibtemp@a
\ifdefined\mplibverbatimYes
- \directlua{luamplib.tempdata = luamplib.protecttextextVerbatim([===[\the\toks@]===])}%
- \directlua{luamplib.processwithTEXboxes(luamplib.tempdata)}%
+ \directlua{luamplib.tempdata\the\currentgrouplevel=luamplib.protecttextextVerbatim([===[\the\toks@]===])}%
+ \directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\else
\edef\mplibtemp{\directlua{luamplib.protecttextext([===[\the\toks@]===])}}%
- \directlua{ tex.sprint(luamplib.mpxcolors) }%
- \directlua{luamplib.tempdata=luamplib.makeTEXboxes([===[\mplibtemp]===])}%
- \directlua{luamplib.processwithTEXboxes(luamplib.tempdata)}%
+ \directlua{ tex.sprint(luamplib.mpxcolors[\the\currentgrouplevel]) }%
+ \directlua{luamplib.tempdata\the\currentgrouplevel=luamplib.makeTEXboxes([===[\mplibtemp]===])}%
+ \directlua{luamplib.processwithTEXboxes(luamplib.tempdata\the\currentgrouplevel)}%
\fi
\end{mplibcode}%
\ifnum\mplibstartlineno<\inputlineno