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.lua21
1 files changed, 14 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
index 430d2991efa..a0bdce00e70 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
@@ -11,8 +11,8 @@
luatexbase.provides_module {
name = "luamplib",
- version = "2.21.1",
- date = "2021/11/23",
+ version = "2.22.0",
+ date = "2022/01/09",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
@@ -346,11 +346,18 @@ end
luamplib.codeinherit = false
local mplibinstances = {}
-local function process (data)
- local standalone = not luamplib.codeinherit
- local currfmt = currentformat .. (luamplib.numbersystem or "scaled")
+local function process (data, instancename)
+ local defaultinstancename = currentformat .. (luamplib.numbersystem or "scaled")
.. tostring(luamplib.textextlabel) .. tostring(luamplib.legacy_verbatimtex)
+ local currfmt = instancename or defaultinstancename
+ if #currfmt == 0 then
+ currfmt = defaultinstancename
+ end
local mpx = mplibinstances[currfmt]
+ local standalone = false
+ if currfmt == defaultinstancename then
+ standalone = not luamplib.codeinherit
+ end
if mpx and standalone then
mpx:finish()
end
@@ -635,7 +642,7 @@ local function unprotect_expansion (str)
end
end
-local function process_mplibcode (data)
+local function process_mplibcode (data, instancename)
legacy_mplibcode_reset()
local everymplib = texgettoks'everymplibtoks' or ''
@@ -675,7 +682,7 @@ local function process_mplibcode (data)
end)
end
- process(data)
+ process(data, instancename)
end
luamplib.process_mplibcode = process_mplibcode