diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-09-21 21:43:12 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-09-21 21:43:12 +0200 |
commit | f7ee609d470a08a16e5cdaad14582fc8ed993c5e (patch) | |
tree | 56f85523ff7b19d926d026f470bb2c75d192e23b /tex/generic/context/luatex/luatex-mplib.lua | |
parent | 772472f057060460c83828cf7fd1631298165e37 (diff) | |
download | context-f7ee609d470a08a16e5cdaad14582fc8ed993c5e.tar.gz |
2017-09-21 21:10:00
Diffstat (limited to 'tex/generic/context/luatex/luatex-mplib.lua')
-rw-r--r-- | tex/generic/context/luatex/luatex-mplib.lua | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tex/generic/context/luatex/luatex-mplib.lua b/tex/generic/context/luatex/luatex-mplib.lua index 976bb59f9..785bc707c 100644 --- a/tex/generic/context/luatex/luatex-mplib.lua +++ b/tex/generic/context/luatex/luatex-mplib.lua @@ -230,7 +230,14 @@ else return "" end - function metapost.load(name) + local modes = { + scaled = true, + decimal = true, + binary = true, + double = true, + } + + function metapost.load(name,mode) local mpd = { buffer = { }, verbatim = { } @@ -241,6 +248,7 @@ else make_text = function(...) return metapost.maketext (mpd,...) end, run_script = function(...) return metapost.runscript(mpd,...) end, extensions = 1, + math_mode = mode and modes[mode] and mode or "scaled", } local result if not mpx then @@ -283,9 +291,9 @@ else return true end - function metapost.process(mpx, data) + function metapost.process(format,data,mode) local converted, result = false, {} - mpx = metapost.load(mpx) + local mpx = metapost.load(format,mode) if mpx and data then local result = mpx:execute(data) if not result then @@ -300,6 +308,8 @@ else else metapost.report("mp error: unknown error, maybe no beginfig/endfig") end +-- mpx:finish() +-- mpx = nil else metapost.report("mp error: mem file not found") end |