TikZ - bug in \pgfarrowsdeclarecombine*?
Can someone tell me if the following is a bug? MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\pgfarrowsdeclarecombine{onetwo}{onetwo}{triangle 45}{triangle 45}{open
triangle 90}{open triangle 90}
\pgfarrowsdeclarecombine*{twothree}{twothree}{open triangle 90}{open
triangle 90}{triangle 45}{triangle 45}
\pgfarrowsdeclarecombine*{onetwo three}{onetwo
three}{onetwo}{onetwo}{triangle 45}{triangle 45}
\pgfarrowsdeclarecombine{one twothree}{one twothree}{triangle 45}{triangle
45}{twothree}{twothree}
\begin{document}
\begin{tikzpicture}
\draw[-onetwo] (0,3) -- (2,3);
\draw[-twothree] (0,2) -- (2,2);
\draw[-onetwo three] (0,1) -- (2,1);
\draw[-one twothree] (0,0) -- (2,0);
\end{tikzpicture}
\end{document}
The third and fourth combinations differ even though they are the same up
to associativity. In the fourth combination, a gap appears between the
leftmost triangle and the middle (open) triangle. I don't think this gap
should be there.
I believe the problem is in the definition of the second combination,
twothree, specifically that its "left extend" (cf. manual section 74.2
under "The left and right extend") is wrong.
According to the manual, \pgfarrowsdeclarecombine* should make the line
end before the inner arrow tip, which in this case is open triangle 90. So
the left extend should be that of the inner tip.
AFAICT, in pgfcorearrows.code.tex, the left extend is stored in
\pgf@arrow@left@<name of arrow tip>. So I added the following code to the
end of the above document:
\makeatletter
\texttt{\expandafter\meaning\csname pgf@arrow@left@open triangle
90\endcsname}\par
\texttt{\expandafter\meaning\csname pgf@arrow@left@triangle 45\endcsname}\par
\texttt{\expandafter\meaning\csname pgf@arrow@left@twothree\endcsname}\par
The result shows that the second and third lines are the same, i.e. the
left extend of twothree is that of the outer tip, namely triangle 45.
Does it look like a genuine bug, and if so, has anyone run into/worked
around it before?
No comments:
Post a Comment