TransWikia.com

why does dvisvgm fail on this tikz figure?

TeX - LaTeX Asked by ea42_gh on September 24, 2020

documentclass[tikz]{standalone}

begin{document}
begin{tikzpicture}[scale=1.3]
draw[help lines] grid (5, 5);
draw[fill=magenta!10] (1, 1) rectangle (2, 2);
draw[fill=magenta!10] (2, 1) rectangle (3, 2);
draw[fill=magenta!10] (3, 1) rectangle (4, 2);
draw[fill=magenta!10] (3, 2) rectangle (4, 3);
draw[fill=magenta!10] (2, 3) rectangle (3, 4);

end{tikzpicture}
end{document}

I ran

latexmk -xelatex -etex sample.tex
dvisvgm --font-format=woff2 --exact sample.xdv sample.svg

and got an empty output.
Using pdf2svg instead succeeds.

Why does my dvisvg command fail?

One Answer

By default, TikZ creates PDF specials when used together with xelatex -no-pdf. dvisvgm doesn't support these specials and therefore the generated SVG contains no graphics. In order to create proper specials, either process the .tex file with latex instead of xelatex, or add document class option dvisvgm:

documentclass[tikz,dvisvgm]{standalone}

Correct answer by Martin on September 24, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP