diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex | 96 |
1 files changed, 86 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex index 4539f7be0fb..33bca9f97ac 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex @@ -1,9 +1,11 @@ -% Copyright 2003 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the LaTeX Project Public License Distributed from CTAN -% archives in directory macros/latex/base/lppl.txt. - +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. \section{Actions on Paths} @@ -68,6 +70,10 @@ abbreviations: Inside |{tikzpicture}| this is an abbreviation for |\path[fill,draw]|. \end{command} +\begin{command}{\pattern} + Inside |{tikzpicture}| this is an abbreviation for |\path[pattern]|. +\end{command} + \begin{command}{\shade} Inside |{tikzpicture}| this is an abbreviation for |\path[shade]|. \end{command} @@ -682,6 +688,73 @@ To fill a path, use the following option: \end{itemize} + +\subsubsection{Graphic Parameters: Fill Pattern} + +\label{section-fill-pattern} +Instead of filling a path with a single solid color, it is also +possible to fill it with a \emph{tiling pattern}. Imagine a small tile +that contains a simple picture like a star. Then these tiles are +(conceptually) repeated infinitely in all directions, but clipped +against the path. + +Tiling patterns come in two variants: \emph{inherently + colored patterns} and \emph{form-only patterns}. An inherently colored +pattern is, say, a red star with a black border and will always look +like this. A form-only pattern may have a different color each time +it is used, only the form of the pattern will stay the same. As such, +form-only patterhns do not have any colors of their own, but when it +is used the current \emph{pattern color} is used as its color. + +Patterns are not overly flexible. In particular, it is not possible to +change the size or orientation of a pattern without declaring a new +pattern. For complicated case, it may be easier to use two nested +|\foreach| statements to simulate a pattern, but patterns are rendered +\emph{much} more quickly than simulated ones. + +\begin{itemize} + \itemoption{pattern}\opt{|=|\meta{name}} + This option causes the path to be filled with a pattern. If the + \meta{name} is given, this pattern is used, otherwise the pattern + set in the enclosing scope is used. As for the |draw| and |fill| + options, setting \meta{name} to |none| disables filling locally. + + The pattern works like a fill color. In particular, setting a new + fill color will fill the path with a solid color once more. + + Strangely, no \meta{name}s are permissible by default. You neet to + load for instance |pgflibrarypatterns|, see + Section~\ref{section-library-patterns}, to install predefined + patterns. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw[pattern=dots] (0,0) circle (1cm); + \draw[pattern=fivepointed stars] (0,0) rectangle (3,1); +\end{tikzpicture} +\end{codeexample} + + \itemoption{pattern color}|=|\meta{color} + This option is used to set the color to be used for form-only + patterns. This option has no effect on inherently colored patterns. + +\begin{codeexample}[] +\begin{tikzpicture} + \draw[pattern color=red,pattern=fivepointed stars] (0,0) circle (1cm); + \draw[pattern color=blue,pattern=fivepointed stars] (0,0) rectangle (3,1); +\end{tikzpicture} +\end{codeexample} + +\begin{codeexample}[] +\begin{tikzpicture} + \def\mypath{(0,0) -- +(0,1) arc (180:0:1.5cm) -- +(0,-1)} + \fill [red] \mypath; + \pattern[pattern color=white,pattern=bricks] \mypath; +\end{tikzpicture} +\end{codeexample} +\end{itemize} + + \subsubsection{Graphic Parameters: Interior Rules} The following two options can be used to decide how interior points @@ -708,8 +781,8 @@ should be determined: % Counter-clockwise rectangle (0.25,0.25) -- (0.75,0.25) -- (0.75,0.75) -- (0.25,0.75) -- cycle; - \draw[->] (0,1) (.4,1); - \draw[->] (0.75,0.75) (0.3,.75); + \draw[->] (0,1) -- (.4,1); + \draw[->] (0.75,0.75) -- (0.3,.75); \draw[->] (0.5,0.5) -- +(0,1) node[above] {crossings: $-1+1 = 0$}; @@ -720,8 +793,8 @@ should be determined: % Clockwise rectangle (0.25,0.25) -- (0.25,0.75) -- (0.75,0.75) -- (0.75,0.25) -- cycle; - \draw[->] (0,1) (.4,1); - \draw[->] (0.25,0.75) (0.4,.75); + \draw[->] (0,1) -- (.4,1); + \draw[->] (0.25,0.75) -- (0.4,.75); \draw[->] (0.5,0.5) -- +(0,1) node[above] {crossings: $1+1 = 2$}; \end{scope} @@ -1033,9 +1106,12 @@ right of picture. There is a node that allows you to get the size of the current bounding box. The |current bounding box| node has the |rectangle| -shape |rectangle| shape and its size is always the size of the current +shape and its size is always the size of the current bounding box. +Similarly, the |current path bounding box| node has the |rectangle| +hape and the size of the bounding box of the current path. + \begin{codeexample}[] \begin{tikzpicture} |