On 10/18/2021 6:06 PM, mf via ntg-context wrote:
Il 18/10/21 17:15, Jason Ross via ntg-context ha scritto:
The following MWE fails to render the text in the attached SVG properly:
\starttext \externalfigure[test.svg][conversion=mp] \stoptext
The axis labels, tick labels, and title are all incorrect. This file was generated with Matplotlib.
If you open test.svg with Inkscape, ungroup and then save, you get a SVG that is typeset right with LMTX.
Looking at the differences between the two SVGs, I can see that Inkscape changes all the transform="translate(...)scale(...)" attributes into transform="matrix(...)".
Now focus on the "y = sin(x)" text. In the attachment I modified the transform attributes of that text, from "translate(...)scale(...)" to "matrix(...)", taking the values from the version obtained from Inkscape.
Use that SVG with your MWE and you'll see "y = sin(x)" appearing in the right place in the PDF.
I would say the "translate(...)scale(...)" specification is not supported in LMTX (yet). it is supported; i'll send you a snippet to test (as it was not really a minimal example)
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 -----------------------------------------------------------------