summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luamplib/luamplib.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.lua19
1 files changed, 11 insertions, 8 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##")