summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex48
1 files changed, 39 insertions, 9 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
index ed7ed14b624..2b79d042e58 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
@@ -23,21 +23,23 @@
The first use of this library is to make the following key available:
-\begin{key}{/tikz/on background layer}
- This key can be used with a |{scope}|. It will cause everything
- inside the scope to be typeset on a background layer. Note that the
- scope should not be ``deeply nested'' inside the picture since
- changes to the graphic state (like the color or the transformation
- matrix) ``do not survive a layer switch.'' For more details on
- layers see Section~\ref{section-layers}.
+\begin{key}{/tikz/on background layer=\meta{options}}
+ This key can (only) be used with a |{scope}| or |\scoped|. It will
+ cause everything inside the scope to be typeset on a background
+ layer.
+
+ The \meta{options} will be executed \emph{inside} background
+ scope. This is useful since \emph{other} options passed to the
+ |{scope}| environment will be executed \emph{before} the actual
+ background material starts and, thus, will have no effect on it.
\begin{codeexample}[]
\begin{tikzpicture}
% On main layer:
\fill[blue] (0,0) circle (1cm);
- \begin{scope}[on background layer]
- \fill[yellow] (-1,-1) rectangle (1,1);
+ \begin{scope}[on background layer={color=yellow}]
+ \fill (-1,-1) rectangle (1,1);
\end{scope}
\begin{scope}[on background layer]
@@ -48,6 +50,34 @@ The first use of this library is to make the following key available:
\fill[blue!50] (-.5,-1) rectangle (.5,1);
\end{tikzpicture}
\end{codeexample}
+
+ A scope with this option set should not be ``deeply nested'' inside
+ the picture since changes to the graphic state (like the color or
+ the transformation matrix) ``do not survive a layer switch,'' see
+ also Section~\ref{section-layers} for details. In particular,
+ setting, say, the line width at the beginning of a picture will not
+ have an effect on the background picture.
+
+ For this reason, it may be useful to setup the following style:
+ \begin{stylekey}{/tikz/every on background layer}
+ This style is executed at the beginning of each background
+ layer. If you have a global setup in |every picture|, you should
+ consider putting that part of it that concerns the graphics state
+ into this style.
+
+\begin{codeexample}[]
+\tikzset{
+ every picture/.style={line width=1ex},
+ every on background layer/.style={every picture}
+}
+\begin{tikzpicture}
+ \draw [->] (0,0) -- (2,1);
+
+ \scoped[on background layer]
+ \draw[red] (0,1) -- (2,0);
+\end{tikzpicture}
+\end{codeexample}
+ \end{stylekey}
\end{key}
When this package is loaded, the following styles become available: