Possible Duplicate:
“Z-level” in TikZ

When using layers in tikz I usually do the following:

    \draw[red] (0,0)--(1,0);

Is there a way of using the layers inline? e.g.:

\draw[layer=background, red] (0,0) -- (1,0);

I don’t know a way for this. My workaround is creating new commands for layers:



    \fill (0,0) rectangle (2,2);
    \bglayer{\fill [gray] (1,1) rectangle (3,3);}

It’s not as comfortable as your inline version but better (shorter) than using the pgfonlayer environment …

Edit Another way is shown in "Z-level" in TikZ

| improve this answer | |
  • Accepted because of "Another way is shown in "Z-level" in TikZ" – romeovs Jan 2 '12 at 10:17

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