You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the patterns.meta library some strange things happen when one uses an edge path construction. In a standalone document this leads to the creation of an extra empty page. This is mainly to bring this up, I'll be happy to do further research on why this happens and how this can be fixed.
Here is a minimal working example. I just took one of the patterns from the manual, the flower pattern from p. 736 of pgfmanual v3.1.5, and embedded it in a standalone document. Then I added an edge. (I also added braces around the arguments of the \foreach loops but this is irrelevant for the present discussion.)
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{patterns.meta}
\tikzdeclarepattern{name=flower,
type=colored,
bottom left={(-.1pt,-.1pt)}, top right={(10.1pt,10.1pt)}, tile size={(10pt,10pt)}, code={
\tikzset{x=1pt,y=1pt}
\path [draw=green] (5,2.5) -- (5, 7.5) edge (5,2.5); %<-edge\foreach\i in {0,60,...,300}
{\path [fill=pink, shift={(5,7.5)}, rotate=-\i]
(0,0) .. controls ++(120:4) and ++(60:4) .. (0,0);}
\path [fill=red] (5,7.5) circle [radius=1];
\foreach\i in {-45,45}
{\path [fill=green, shift={(5,2.5)}, rotate=-\i] (0,0) .. controls ++(120:4) and
++(60:4) .. (0,0);}
} }
\begin{document}
\begin{tikzpicture}
\draw[pattern=flower] circle [radius=1];
\end{tikzpicture}
\end{document}
As soon as the edge is in the pattern, I get an unwanted empty page on my standalone document. Removing the edge leads to just one page, as expected from the input.
P.S. I do not know how to add tags to an issue, otherwise I'd have added patterns.
The text was updated successfully, but these errors were encountered:
I guess in theory edge could be supported because it is “just” drawing a path asynchronously. However, I have the suspicion that the complexity of the implementation will be enormous. Normally edges (and nodes) are added to a temporary box which is flushed out in \tikz@finish (Step 13) but the code in the pattern is not a proper picture, so \tikz@finish isn't called for it.
@hmenke I like the idea from your first comment. Please note also that, according to what I find, the more complex the picture underlying the pattern becomes, the more likely it is that there are viewer-dependent issues, i.e. artifacts. This is in particular true if you stack them (e.g. with postaction). So I think telling the user that one should not do too complex things is a great idea.
hmenke
added a commit
to hmenke/pgf
that referenced
this issue
May 18, 2020
When using the
patterns.meta
library some strange things happen when one uses anedge
path construction. In a standalone document this leads to the creation of an extra empty page. This is mainly to bring this up, I'll be happy to do further research on why this happens and how this can be fixed.Here is a minimal working example. I just took one of the patterns from the manual, the
flower
pattern from p. 736 of pgfmanual v3.1.5, and embedded it in a standalone document. Then I added anedge
. (I also added braces around the arguments of the\foreach
loops but this is irrelevant for the present discussion.)As soon as the
edge
is in the pattern, I get an unwanted empty page on my standalone document. Removing theedge
leads to just one page, as expected from the input.P.S. I do not know how to add tags to an issue, otherwise I'd have added
patterns
.The text was updated successfully, but these errors were encountered: