Hi there! The following document contains SVG. Save the SVG as "problem.svg" and run the document through LMTX version 2023.05.08 17:39: % SOF \startbuffer[csvg] <svg viewBox="0 0 100 100" version="1.1"> <path d="M0 0h100v100H0z" /> <path fill="#2d514e" d="M 72.474,42.6 33.073,42.8 51.872,-26.7 Z" /> </svg> \stopbuffer \starttext % honours viewbox \placefigure[none]{}{\includesvgbuffer[csvg]} \page % dishonours viewbox \externalfigure[problem.svg] \stoptext % EOF The ViewBox is ignored when run through Inkscape. Is this because the --export-area-page option is not being passed when invoked? Given identical inputs, would it make sense for placefigure and externalfigure to produce identical results? Cheers!
Hi again, I changed tex/texmf-context/tex/context/base/mkiv/grph-con.lua to replace "" with "--export-area-page" in the inkscapecrop function: local function inkscapecrop(specification) return (specification and specification.crop == v_yes) and "--export-area-drawing" or "--export-area-page" end This produces the desired results. Any ideas on how to force that setting without modifying grph-con.lua? Thank you!
Hi,
Any ideas on how to force that setting without modifying grph-con.lua?
This seems to work: \startluacode function figures.converters.svg.pdf(oldname, newname) figures.programs.inkscape.runner { format = "filename", resolution = "600", crop = "--export-area-page", newname = dir.expandname(newname), oldname = dir.expandname(oldname), } end \stopluacode I mostly just copied that from grph-con.lua, but the CLD manual has a few more details: https://www.pragma-ade.com/general/manuals/cld-mkiv.pdf#%5B%7B%22num%22%3A89... -- Max
participants (2)
-
Max Chernoff
-
Thangalin