Menu

#272 SVG parser error after close path

v1.0 (example)
closed-fixed
nobody
None
5
2013-09-23
2013-09-21
Mark Wibrow
No

When using the svg library the following code where the path continues after a close path 'Z' or 'z' results in the following error:

Package pgf Error: Unexpected character 'blank space ' in parser 'svgpath'

\documentclass[border=0.5cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{svg.path}

\begin{document}

\begin{tikzpicture}
\draw svg "M 0.0 0.0 l 5.0 10.0 5.0 -10.0 Z M 3.0 2.0 l 5.0 10.0 5.0 -10.0 z";
\end{tikzpicture}

\end{document}

Removing the space between the Z and the M makes the error go away.

Assuming the it should be possible to continue the path after 'Z' or'z', I cannot find a way to fix this except by using the following:

\pgfparserdef{svgpath}{all}{blank space \space}{}

I quite don't understand from the svg and parser code why this is necessary, and am not sure if it would have any 'side effects', so haven't added it as a fix in the CVS.

Discussion

  • Till Tantau

    Till Tantau - 2013-09-23

    Fixed in CVs. Thanks, your fix was exactly right.

     
  • Till Tantau

    Till Tantau - 2013-09-23
    • status: open --> closed-fixed