diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex index 2108e77e333..5e0dab698db 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex @@ -12,11 +12,11 @@ \label{section-library-fit} \begin{tikzlibrary}{fit} - The library defines (currently only one) option for fitting a node + The library defines (currently only two) options for fitting a node so that it contains a set of coordinates. \end{tikzlibrary} -When you load this library, the following option becomes available: +When you load this library, the following options become available: \begin{key}{/tikz/fit=\meta{coordinates or nodes}} This option must be given to a |node| path command. The @@ -49,7 +49,7 @@ When you load this library, the following option becomes available: \node[draw=red, fit=(a) (b) (c) (d) (e)] {box}; \node[draw,circle,fit=(a) (b) (c) (d) (e)] {}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} Every time the |fit| option is used, the following style is also @@ -61,14 +61,14 @@ When you load this library, the following option becomes available: The exact effects of the |fit| option are the following: \begin{enumerate} - \item A minimal bounding box containg all coordinates is + \item A minimal bounding box containing all coordinates is computed. Note that if a coordinate like |(a)| is used that contain a node name, this has the same effect as explicitly providing the |(a.north)| and |(a.south)| and |(a.west)| and |(a.east)|. If you wish to refer only to the center of the |a| node, use |(a.center)| instead. \item The |text width| option is set to the width of this bounding box. - \item The |text centered| option is set. + \item The |align=center| option is set. \item The |anchor| is set to |center|. \item The |at| position of the node is set to the center of the computed bounding box. @@ -85,11 +85,11 @@ When you load this library, the following option becomes available: |fit| option that does not contain any text, give it a name, and then use normal nodes to add text at the desired positions. Alternatively, consider using the |label| or |pin| - options. + options. Suppose, for instance, that in the above example we want the word ``box'' to appear inside the box, but at its top. This can be - achieved as follows: + achieved as follows: \begin{codeexample}[] \begin{tikzpicture}[inner sep=0pt,thick, dot/.style={fill=blue,circle,minimum size=3pt}] @@ -102,10 +102,10 @@ When you load this library, the following option becomes available: \node[draw=red,fit=(a) (b) (c) (d) (e)] (fit) {}; \node[below] at (fit.north) {box}; -\end{tikzpicture} +\end{tikzpicture} \end{codeexample} - Here is a real-life example that uses fitting: + Here is a real-life example that uses fitting: \begin{codeexample}[] \begin{tikzpicture} @@ -125,17 +125,36 @@ When you load this library, the following option becomes available: child { node [vertex,leaf=b] {} } } child { node [vertex,leaf=a] {} } } child { node [coordinate] {} - child[missing] + child[missing] child { node [vertex] (f's parent) {} child { node [vertex,leaf=c] {} } child { node [vertex,leaf=f] {} } } } edge from parent node {$\rho$} }; - + \node [fit=(d) (e) (b) (b's parent),label=above left:$F^{(b,R)}$] {}; \node [fit=(c) (f) (f's parent),label=above right:$F^{(c,R)}$] {}; \end{tikzpicture} \end{codeexample} - \end{key} +\begin{key}{/tikz/rotate fit=\meta{angle} (initially 0)} + This key fits \meta{coordinates or nodes} inside a node that is + rotated by \meta{angle}. As a side effect, it also sets the + |/tikz/rotate| key. + +\begin{codeexample}[] +\begin{tikzpicture}[inner sep=0pt,thick, + dot/.style={fill=blue,circle,minimum size=3pt}] + \draw[help lines] (0,0) grid (3,2); + \node[dot] (a) at (1,1) {}; + \node[dot] (b) at (2,2) {}; + \node[dot] (c) at (1,2) {}; + \node[dot] (d) at (1.25,0.25) {}; + \node[dot] (e) at (1.75,1.5) {}; + \node[draw, fit=(a) (b) (c) (d) (e)] {}; + \node[draw=red, rotate fit=30, fit=(a) (b) (c) (d) (e)] {}; +\end{tikzpicture} +\end{codeexample} + +\end{key} |