diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-10-28 20:03:50 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-10-28 20:03:50 +0100 |
commit | f58a2cb5d22c5931581274db1f0ec85ac903b747 (patch) | |
tree | ba324713b8c0f2ee9465238d3cf867de3fb41dc5 /tex/context/base/mkiv/grph-con.lua | |
parent | 24f6f7de245bdff10f21984a9a3c6af3d31fa1f1 (diff) | |
download | context-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.lua | 22 |
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 |