TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One of the problems with patterns is that you never know how individual tiles are going to be laid over the area. E.g. if you use star pattern, sometimes stars on the left side of the area shall be broken in half, and sometimes they shall be whole. Is there any way to control how tiles are laid over the area?

share|improve this question
up vote 16 down vote accepted

The patterns are not drawn at tikz/pgf level, but instead they are "passed" to the driver language (pdf, postscript), which uses its own pattern procedures, for the sake of efficiency.

You can imagine those patterns as "already drawn" in a invisible bottom layer and covering all the page. When you fill a shape with that pattern, you merely are cutting a "hole" with that shape, through which the udnerlying pattern can be seen. This MWE should clarify what I mean. Note how the pattern appears to be "continued" from one rectangle to another, even if they belong to different tikz figures.


\draw[pattern=fivepointed stars] (0,0) rectangle (2,1);
\draw[pattern=fivepointed stars] (0,0) rectangle (2,1);

\draw[pattern=fivepointed stars] (0,0) rectangle (2,1);
\draw[pattern=fivepointed stars] (0,0) rectangle (2,1);


Even worse, the "underlying pattern" is different depending on the final driver (PostScript, PDF or SVG). Quoting TikZ manual:

the phase of patterns is not well-defined, that is, it is not clear where origin of the “first” tile is. To be more precise, PostScript and pdf on the one hand and svg on the other hand define the origin differently. PostScript and pdf define a fixed origin that is independent of where the path lies.

So the answer apparently is that you cannot affect this mapping from tikz/pgf.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.