diff options
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.tex | 143 |
1 files changed, 79 insertions, 64 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 30440107846..8144d8aec42 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 @@ -22,8 +22,7 @@ \end{tikzlibrary} When this package is loaded, the following styles become available: -\begin{itemize} - \itemstyle{show background rectangle} +\begin{stylekey}{/tikz/show background rectangle} This style causes a rectangle to be drawn behind your graphic. This style option must be given to the |{tikzpicture}| environment or to the |\tikz| command. @@ -37,55 +36,62 @@ When this package is loaded, the following styles become available: separator distance is added on the sides. This distance can be different for the $x$- and $y$-directions and can be set using the following options: - \begin{itemize} - \itemoption{inner frame xsep}|=|\meta{dimension} + \begin{key}{/tikz/inner frame xsep=\meta{dimension} (initially 1ex)} Sets the additional horizontal separator distance for the - background rectangle. The default is |1ex|. - \itemoption{inner frame ysep}|=|\meta{dimension} + background rectangle. + \end{key} + \begin{key}{/tikz/inner frame ysep=\meta{dimension} (initially 1ex)} Same for the vertical separator distance. - \itemoption{inner frame sep}|=|\meta{dimension} - sets the horizontal and vertical separator distances + \end{key} + \begin{key}{/tikz/inner frame sep=\meta{dimension}} + Sets the horizontal and vertical separator distances simultaneously. - \end{itemize} + \end{key} The following two styles make setting the inner separator a bit easier to remember: - \begin{itemize} - \itemstyle{tight background} Sets the inner frame separator to - 0pt. The background rectangle will have the size of the bounding - box. - \itemstyle{loose background} Sets the inner frame separator to 2ex. - \end{itemize} - + \begin{stylekey}{/tikz/tight background} + Sets the inner frame separator to 0pt. The background rectangle + will have the size of the bounding box. + \end{stylekey} + \begin{stylekey}{/tikz/loose background} + Sets the inner frame separator to 2ex. + \end{stylekey} + You can influence how the background rectangle is rendered by setting the following style: - \begin{itemize} - \itemstyle{background rectangle} + \begin{stylekey}{/tikz/background rectangle (initially draw)} This style dictates how the background rectangle is drawn or - filled. By default this style is set to |draw|, which causes the - path of the background rectangle to be drawn in the usual + filled. The default setting causes the path of the background + rectangle to be drawn in the usual way. Setting this style to, say, |fill=blue!20| causes a light blue background to be added to the picture. You can also use more fancy settings as shown in the following example: \begin{codeexample}[] -\tikzstyle{background rectangle}= - [double,ultra thick,draw=red,top color=blue,rounded corners] -\begin{tikzpicture}[show background rectangle] +\begin{tikzpicture} + [background rectangle/.style= + {double,ultra thick,draw=red,top color=blue,rounded corners}, + show background rectangle] \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} Naturally, no one in their right mind would use the above, but here is a nice background: \begin{codeexample}[] -\tikzstyle{background rectangle}= - [draw=blue!50,fill=blue!20,rounded corners=1ex] -\begin{tikzpicture}[show background rectangle] +\begin{tikzpicture} + [background rectangle/.style= + {draw=blue!50,fill=blue!20,rounded corners=1ex}, + show background rectangle] \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} -\end{itemize} - \itemstyle{framed} + \end{stylekey} +\end{stylekey} + +\begin{stylekey}{/tikz/framed} This is a shorthand for |show background rectangle|. - \itemstyle{show background grid} +\end{stylekey} + +\begin{stylekey}{/tikz/show background grid} This style behaves similarly to the |show background rectangle| style, but it will not use a rectangle path, but a grid. The lower left and upper right corner of the grid is computed in the same way @@ -97,59 +103,67 @@ When this package is loaded, the following styles become available: \end{codeexample} You can influence the background grid by setting the following style: - \begin{itemize} - \itemstyle{background grid} - This style dictates how the background grid path is drawn. The - default is |draw,help lines|. + \begin{stylekey}{/tikz/background grid (initially draw,help lines)} + This style dictates how the background grid path is drawn. \begin{codeexample}[] -\tikzstyle{background grid}=[thick,draw=red,step=.5cm] -\begin{tikzpicture}[show background grid] +\begin{tikzpicture} + [background grid/.style={thick,draw=red,step=.5cm}, + show background grid] \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} + \end{stylekey} This option can be combined with the |framed| option (use the |framed| option first): \begin{codeexample}[] -\tikzstyle{background grid}=[thick,draw=red,step=.5cm] -\tikzstyle{background rectangle}=[rounded corners,fill=yellow] +\tikzset{background grid/.style={thick,draw=red,step=.5cm}, + background rectangle/.style={rounded corners,fill=yellow}} \begin{tikzpicture}[framed,gridded] \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} - \itemstyle{gridded} +\end{stylekey} + +\begin{stylekey}{/tikz/gridded} This is a shorthand for |show background grid|. - \end{itemize} - \itemstyle{show background top} +\end{stylekey} + +\begin{stylekey}{/tikz/show background top} This style causes a single line to be drawn at the top of the background rectangle. Normally, the line coincides exactly with the top line of the background rectangle: \begin{codeexample}[] -\tikzstyle{background rectangle}=[fill=yellow] -\begin{tikzpicture}[framed,show background top] +\begin{tikzpicture}[ + background rectangle/.style={fill=yellow}, + framed,show background top] \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} The following option allows you to lengthen (or shorten) the line: - \begin{itemize} - \itemoption{outer frame xsep}|=|\meta{dimension} + \begin{key}{/tikz/outer frame xsep=\meta{dimension} (initially 0pt)} The \meta{dimension} is added at the left and right side of the line. \begin{codeexample}[] -\tikzstyle{background rectangle}=[fill=yellow] \begin{tikzpicture} - [framed,show background top,outer frame xsep=1ex] + [background rectangle/.style={fill=yellow}, + framed, + show background top, + outer frame xsep=1ex] \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} - \itemoption{outer frame ysep}|=|\meta{dimension} + \end{key} + \begin{key}{/tikz/outer frame ysep=\meta{dimension} (initially 0pt)} This option does not apply to the top line, but to the left and right lines, see below. - \itemoption{outer frame sep}|=|\meta{dimension} + \end{key} + \begin{key}{/tikz/outer frame sep=\meta{dimension}} Sets both the $x$- and $y$-separation. + \end{key} \begin{codeexample}[] -\tikzstyle{background rectangle}=[fill=blue!20] \begin{tikzpicture} - [outer frame sep=1ex,% + [background rectangle={fill=blue!20}, + outer frame sep=1ex,% show background top,% show background bottom,% show background left,% @@ -157,27 +171,28 @@ When this package is loaded, the following styles become available: \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} - \end{itemize} You can influence how the line is drawn grid by setting the following style: - \begin{itemize} - \itemstyle{background top} - Default is |draw|. + \begin{stylekey}{/tikz/background top (initially draw)} \begin{codeexample}[] -\tikzstyle{background rectangle}=[fill=blue!20] -\tikzstyle{background top}=[draw=blue!50,line width=1ex] +\tikzset{background rectangle/.style={fill=blue!20}, + background top/.style={draw=blue!50,line width=1ex}} \begin{tikzpicture}[framed,show background top] \draw (0,0) ellipse (10mm and 5mm); \end{tikzpicture} \end{codeexample} - \end{itemize} - \itemstyle{show background bottom} - works like the style for the top line. - \itemstyle{show background left} - works like the style for the top line. - \itemstyle{show background right} - works like the style for the top line. -\end{itemize} + \end{stylekey} +\end{stylekey} + +\begin{stylekey}{/tikz/show background bottom} + Works like the style for the top line. +\end{stylekey} +\begin{stylekey}{/tikz/show background left} + Works similarly. +\end{stylekey} +\begin{stylekey}{/tikz/show background right} + Works similarly. +\end{stylekey} |