michal-h21 / dvisvgm4ht

TikZ driver for tex4ht which uses dvisvgm for the SVG production
10 stars 1 forks source link

\pgfuseshading should not leave vertical mode #2

Closed dcpurton closed 4 years ago

dcpurton commented 5 years ago

\pgfuseshading leaves vertical mode leading to differing output from the TeX drivers.

See https://github.com/pgf-tikz/pgf/issues/655

But note that @hmenke reverted his fix for the dvisvgm and tex4ht drivers because it broke other things, so I'm not sure if you want to do anything about this or not. It was rightly pointed out that generally \pgfuseshading probably isn't used outside a pgfpicture or tikzpicture environment very often.

MWE

\documentclass{article}
\def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
\usepackage{pgf}
\begin{document}
Filler text.

\pgfdeclarehorizontalshading{myshadingA}
{1cm}{rgb(0cm)=(1,0,0); color(2cm)=(green); color(4cm)=(blue)}
\pgfuseshading{myshadingA}

Filler text.
\end{document}
michal-h21 commented 5 years ago

Both of your issues should be fixed by a094e6540609bf3b068978b4a0942da0368121cd. It checks if it is in a vertical mode and use a correct command accordingly.