summaryrefslogtreecommitdiff
path: root/tex/context/base/mlib-pdf.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mlib-pdf.lua')
-rw-r--r--tex/context/base/mlib-pdf.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/tex/context/base/mlib-pdf.lua b/tex/context/base/mlib-pdf.lua
index 5e60999c1..4fa97a7c7 100644
--- a/tex/context/base/mlib-pdf.lua
+++ b/tex/context/base/mlib-pdf.lua
@@ -291,12 +291,19 @@ metapost.lly = 0
metapost.urx = 0
metapost.ury = 0
-function commands.mprunvar(key)
+function commands.mprunvar(key,n)
local value = metapost.variables[key]
if value ~= nil then
local tvalue = type(value)
if tvalue == "table" then
- context(concat(value," "))
+ local ntype = type(n)
+ if ntype == "number" then
+ context(value[n])
+ elseif ntype == "string" then
+ context(concat(value,n))
+ else
+ context(concat(value," "))
+ end
elseif tvalue == "number" or tvalue == "boolean" then
context(tostring(value))
elseif tvalue == "string" then