summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-02 21:57:49 +0000
committerKarl Berry <karl@freefriends.org>2016-04-02 21:57:49 +0000
commit54e58adfc76118f03b1bd2f7dedfb2140dce7696 (patch)
treeb6e6de658f1e2ec5f28638af1a2f29111e6eaee5 /Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
parent736d573263d6969c828cadd202b3f248d8cc604e (diff)
luamplib (2apr16)
git-svn-id: svn://tug.org/texlive/trunk@40217 c570f23f-e606-0410-a88d-b1316a301751
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##")