summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/grph-con.lua
diff options
context:
space:
mode:
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