summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/grph-con.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-10-28 20:03:50 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-10-28 20:03:50 +0100
commitf58a2cb5d22c5931581274db1f0ec85ac903b747 (patch)
treeba324713b8c0f2ee9465238d3cf867de3fb41dc5 /tex/context/base/mkiv/grph-con.lua
parent24f6f7de245bdff10f21984a9a3c6af3d31fa1f1 (diff)
downloadcontext-f58a2cb5d22c5931581274db1f0ec85ac903b747.tar.gz
2019-10-28 18:22:00
Diffstat (limited to 'tex/context/base/mkiv/grph-con.lua')
-rw-r--r--tex/context/base/mkiv/grph-con.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/grph-con.lua b/tex/context/base/mkiv/grph-con.lua
index ab6651f97..788136f6d 100644
--- a/tex/context/base/mkiv/grph-con.lua
+++ b/tex/context/base/mkiv/grph-con.lua
@@ -420,3 +420,25 @@ do -- png | jpg | profiles
end
end
+
+if CONTEXTLMTXMODE > 0 then
+
+ -- This might also work ok in mkiv but is yet untested. Anyway, it's experimental as we
+ -- go through TeX which is is inefficient. I'll improve the buffer trick.
+
+ local function remap(specification)
+ local fullname = specification.fullname
+ if fullname then
+ local only = file.nameonly(fullname)
+ local name = formatters["svg-%s-inclusion"](only)
+ local code = formatters["\\includesvgfile[%s]\\resetbuffer[%s]"](fullname,name)
+ buffers.assign(name,code)
+ specification.format = "buffer"
+ specification.fullname = name
+ end
+ return specification
+ end
+
+ figures.remappers.svg = { mp = remap }
+
+end