pgf icon indicating copy to clipboard operation
pgf copied to clipboard

Documented `tikz` option `dvisvgm` is not supported

Open muzimuzhi opened this issue 2 years ago • 1 comments

Brief outline of the bug

Current state:

  • In sec. 10.2.4 "Producing SVG Output", the pgfmanual reads

    If the option dvisvgm is given to the tikz package, this driver gets selected (normally, the driver selected by graphics would be used).

  • But tikz.sty declares no options.
  • As a package option, dvisvgm is only known to pgfsys.sty. https://github.com/pgf-tikz/pgf/blob/6e5fd71581ab04351a89553a259b57988bc28140/tex/latex/pgf/systemlayer/pgfsys.sty#L12
  • Hence currently to use dvisvgm driver (for tikz or pgf LaTeX package), one has to either defining \def\pgfsysdriver{pgfsys-dvisvgm.def} or using it as a class option. (LaTeX packages won't throw errors for unknown global/class options.)

Some history:

  • Commit 10624dcc (*** empty log message ***, 2013-08-23) added package option dvisvgm for pgf.sty and the corresponding doc mentioned above. (Yes, the option was added to pgf.sty, but documented for tikz.sty.)
  • Commit ab8bbb59 (fixed Vertex.lua anchoring problem, 2013-12-18) moved option dvisvgm from pgf.sty to pgfsys.sty.

Proposal:

  • Add tikz package option dvisvgm (how to treat the same option in pgfsys?)
  • Revise related doc since graphicx package now supports dvisvgm driver (hence \PassOptionsToPackage{dvisvgm}{graphicx} is another possibility).

Minimal working example (MWE)

% !TeX program = latex
\documentclass{article}
\usepackage[dvisvgm]{tikz}

\begin{document}
\end{document}

muzimuzhi avatar Sep 23 '23 16:09 muzimuzhi

  • Add tikz package option dvisvgm (how to treat the same option in pgfsys?)

One possibility is to add dummy option dvisvgm to both tikz.sty and pgf.sty.

\DeclareOption{dvisvgm}{} % will be used later in pgfsys.sty

\ProcessOptions % tikz.sty needs this

muzimuzhi avatar Sep 24 '23 05:09 muzimuzhi