-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arrow tips in animated path not always working #876
Labels
Milestone
Comments
Possible patch, please test. diff --git a/tex/generic/pgf/systemlayer/pgfsys-common-svg.def b/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
index 6e825f09..f1d27290 100644
--- a/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
+++ b/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
@@ -891,7 +891,7 @@
\let\pgf@sys@svg@marker@id@start\pgfutil@empty%
\else%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount m}%
\edef\pgf@sys@svg@add@code{%
\noexpand\pgf@sys@svg@ref@defs{pgfs\pgf@svg@anim@marker@start}%
\noexpand\pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible">
@@ -904,7 +904,7 @@
\let\pgf@sys@svg@marker@id@end\pgfutil@empty%
\else%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount m}%
\edef\pgf@sys@svg@add@code@{%
\noexpand\pgf@sys@svg@ref@defs{pgfs\pgf@svg@anim@marker@end}%
\noexpand\pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible"> The underlying problem is that the object ids collide. Both the object and the marker at the start of the path have <g id='pgf1'>
<marker id='pgf1' markerUnits='userSpaceOnUse' orient='auto' overflow='visible'> <use transform='scale(-1,-1)' xlink:href='#pgfs2'/> </marker>
<marker id='pgf2' markerUnits='userSpaceOnUse' orient='auto' overflow='visible'> <use xlink:href='#pgfs3'/> </marker>
<path d='M 0.0 2.27997 C 0.0 12.45241 1.77396 28.45274 14.22636 28.45274 C 19.77419 28.45274 14.22636 19.77419 14.22636 14.68636' fill='none' id='pgf1p' marker-end='url(#pgf2)' marker-start='url(#pgf1)'/>
</g> The patch works around this collision by just appending the letter <g id='pgf1'>
<marker id='pgf1m' markerUnits='userSpaceOnUse' orient='auto' overflow='visible'> <use transform='scale(-1,-1)' xlink:href='#pgfs2'/> </marker>
<marker id='pgf2m' markerUnits='userSpaceOnUse' orient='auto' overflow='visible'> <use xlink:href='#pgfs3'/> </marker>
<path d='M 0.0 2.27997 C 0.0 12.45241 1.77396 28.45274 14.22636 28.45274 C 19.77419 28.45274 14.22636 19.77419 14.22636 14.68636' fill='none' id='pgf1p' marker-end='url(#pgf2m)' marker-start='url(#pgf1m)'/>
</g> |
hmenke
added a commit
to hmenke/pgf
that referenced
this issue
Jun 17, 2020
Hitherto the markers were given simply ids à la `pgf1' but this clashes with other objects which are also numbered consecutively. To this end I'm simply adding a suffix `m' to the id to make is distinct from other objects.
hmenke
added a commit
to hmenke/pgf
that referenced
this issue
Jun 17, 2020
Hitherto the markers were given simply ids à la `pgf1' but this clashes with other objects which are also numbered consecutively. To this end I'm simply adding a suffix `m' to the id to make is distinct from other objects.
I can reproduce your solution! |
This isn't merged yet. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While testing out the example of the manual (page 398), I noticed that the arrows only show when the code is at the beginning of the document.
To produce the output of the MWE below, I use
latex minimal.tex && dvisvgm --exact minimal.dvi && chromium minimal.svg
Strangely enough, in the MWE only one of the arrow tips disappears.
To produce the correct arrows, simply swap out the tikzpicture environment for the \tikz statement.
Minimal working example (MWE)
The text was updated successfully, but these errors were encountered: