Open stertooy opened 2 months ago
First of all, there's no need to apologize. Feel free to report any problems regarding dvisvgm here.
But in this case it's actually an issue with TikZ. It's the same as in #272. The letter a
is positioned with DVI commands but also wrapped by literal SVG elements that shift it to the lower left. Since dvisvgm doesn't evaluate literal SVG fragments embedded in the DVI file, it doesn't know the final position and doesn't adapt the bounding box either. That's why it's too big.
When omitting option dvisvgm
, TikZ embeds PostScript code which dvisvgm evaluates and therefore allows to compute a thight bounding box.
Long story short, this issue has to be fixed by the TikZ team.
I'm not certain whether this is a bug with dvisvgm or with the
standalone
class, apologies if this does not belong here.When using dvisvgm to make an SVG from the tex-code below, something odd happens: the svg gains a lot of whitespace to the left and to the bottom - as if dvisvgm draws it from the (0,0)-coordinate in TikZ, instead of where the actual image starts.
This does not happen when the
[dvisvgm]
option is omitted from the standalone document class:Unfortunately, I've also run into instances before where this option is required to create a correct svg, so I can't just omit it entirely. Curiously enough, this only happens when a
node
is present in the TikZ-figure. If I comment out the line with the node, it works correctly whether or not thedvisvgm
-option is present.