Hi, I uploaded a beta. In lmtx there is now a bit more advanced support for svg. A preliminary manual is included that explains a few things. As a teaser ... it is also possible to embed svg code, as in: \startbuffer[svgtest] <svg> <circle cx="50" cy="50" r="40" stroke="green" stroke-width="10" stroke-opacity="0.3" fill="red" fill-opacity="0.3" /> <circle cx="150" cy="50" r="40" stroke="green" stroke-width="10" fill="red" opacity="0.3" /> </svg> \stopbuffer \startTEXpage \includesvgbuffer[svgtest] \stopTEXpage \startTEXpage \includesvgbuffer[svgtest][offset=2bp] \stopTEXpage or in metapost disguise: \startMPpage vardef svg expr c = lmt_svg [ code = c ] enddef ; draw svg "<svg> <circle cx='50' cy='50' r='40' stroke='green' stroke-width='10' stroke-opacity='0.3' fill='red' fill-opacity='0.3' /> <circle cx='150' cy='50' r='40' stroke='green' stroke-width='10' fill='red' opacity='0.3' /> </svg>" ; \stopMPpage It is not a replacement for metapost (which is more efficient runtime anbyway) but for artistic images a mixture might work out ok. In principle inclusion with externalfigure also works when conversion=mps is set but, although I have some 1500 test images, not all might work out well. There can be a lot of crap be hidden in svg files and angle brackets are no guarantee for properly structured images. Especially fonts can be troublesome. On the other hand, if one has very structured input, text labels can be swapped for propertly typeset ones (like math), but that's for later to explain (experimental stuff). We'll see. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 28-10-2019 19:20, Hans Hagen wrote:
As a teaser ... it is also possible to embed svg code, as in:
\startbuffer[svgtest] <svg> <circle cx="50" cy="50" r="40" stroke="green" stroke-width="10" stroke-opacity="0.3" fill="red" fill-opacity="0.3" /> <circle cx="150" cy="50" r="40" stroke="green" stroke-width="10" fill="red" opacity="0.3" /> </svg> \stopbuffer
\startTEXpage \includesvgbuffer[svgtest] \stopTEXpage
\startTEXpage \includesvgbuffer[svgtest][offset=2bp] \stopTEXpage
Nice ! It seems that it does not retains the <g> grouping and layering in place. e.g. everything ends up in one layer and one group. .Floris
On 10/28/2019 10:00 PM, Floris van Manen wrote:
On 28-10-2019 19:20, Hans Hagen wrote:
As a teaser ... it is also possible to embed svg code, as in:
\startbuffer[svgtest] <svg> <circle cx="50" cy="50" r="40" stroke="green" stroke-width="10" stroke-opacity="0.3" fill="red" fill-opacity="0.3" /> <circle cx="150" cy="50" r="40" stroke="green" stroke-width="10" fill="red" opacity="0.3" /> </svg> \stopbuffer
\startTEXpage \includesvgbuffer[svgtest] \stopTEXpage
\startTEXpage \includesvgbuffer[svgtest][offset=2bp] \stopTEXpage
Nice ! It seems that it does not retains the <g> grouping and layering in place. e.g. everything ends up in one layer and one group.
You mean: produce pdf layers? Well, imo usage of <g> is so messy and inconsistent that it doesn't pay off, apart from overhead. But grouping as way of combining properties is supported. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 29-10-2019 14:21, Hans Hagen wrote:
You mean: produce pdf layers? Well, imo usage of <g> is so messy and inconsistent that it doesn't pay off, apart from overhead. But grouping as way of combining properties is supported.
the cause might be outside context. e.g. it might be that the layers/grouping are dropped by inkscape while importing the pdf. if i export the original svg as a pdf within inkscape, then re-import it again, the layers/grouping are gone too. not urgent, as many other paths exist ;-) .F
participants (2)
-
Floris van Manen
-
Hans Hagen