summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex')
-rw-r--r--graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex96
1 files changed, 59 insertions, 37 deletions
diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex
index 04ebb7c7a0..d4b274511c 100644
--- a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex
+++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex
@@ -15,47 +15,35 @@
measurements to the \filetype{aux} file.
Unfortunately, this does not work with the |external| library.\indexLibraryO{external}%
- \footnote{Not only would the \texttt{external} library not notice the change of the value between compilations runs,
- it also changes the way \texttt{\textbackslash pgfutil@writeout} works which suddenly writes to the \textsc{log} file instead.}
+ \footnote{First of all, I can't figure out how to use the \textsc{aux} file during externalization since it gets written to the \textsc{log} instead.
+ And then there's the question about how \texttt{external} would notice the need to export the picture again until it's stable \dots}
+
+ \inspiration{NodeFam-Q}{NodeFam-A}
+
\end{tikzlibrary}
-This library introduces two new shapes called |Circle| and |Rectangle|
-that are basically copies of the original shapes |circle|\indexShapeO{circle} and |rectangle|\indexShapeO{rectangle}.
-However, their dimension will be set to the same maximum |minimum width| and |minimum height|
-when one of the following \meta{name}s are declared.
-\begin{key}{/tikz/node family/width=\meta{name} (initially |\{\}|)}
-Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum width}.
-An empty \meta{name} disables the evaluation by the library.
-\begin{codeexample}[preamble=\usetikzlibrary{positioning,ext.node-families},/tikz/node distance=.5cm]
-\tikzexternaldisable % ext.node-families does not work with active externalization
-\begin{tikzpicture}[nodes={Rectangle, draw, node family/width=manual}]
-\node (a) {Foo};
-\node[below=of a] (b) {Foobar};
-\end{tikzpicture}
-\end{codeexample}
-\end{key}
-\begin{key}{/tikz/node family/height=\meta{name} (initially |\{\}|)}
-Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum height}.
-An empty \meta{name} disables the evaluation by the library.
-\end{key}
-\begin{key}{/tikz/node family/size=\meta{name}}
-Sets both |height| and |width|.
+Before we get to the interesting keys, a common prefix can be set for the families' names.
+Initially this is |\pgfpictureid-| so that families of different pictures don't interact.
+\begin{key}{/tikz/node family/prefix=\meta{prefix}(initially \string\pgfpictureid-)}
+The family names are prefixed with the value of |/tikz/node family/prefix|.
\end{key}
-While |node family/width| and |node family/height| only work for the new shapes |Circle| and |Rectangle|,
-the following keys~-- when setup, see below~-- work with every shape with one single node part.
-Initially though, only |circle|, |rectangle|, |Circle| and |Rectangle| are set up that way.
-\begin{key}{/tikz/node family/text height=\meta{name} (initially |\{\}|)}
+\subsection{Text Box}
+\label{ssec:nf-text}
+The following keys~-- when setup, see below~-- work with every shape with one single node part.%
+\footnote{Technically, it will also work with shapes with multiple node parts but it will only affect the main node part.}
+Initially though, only \referenceShapeandIndexO{circle} and \referenceShapeandIndexO{rectangle} are set up that way.
+\begin{key}{/tikz/node family/text height=\meta{name} (initially \{\})}
Nodes with the same \meta{name} will have the same text height.
An empty \meta{name} disables the evaluation by the library.
\end{key}
-\begin{key}{/tikz/node family/text depth=\meta{name} (initially |\{\}|)}
+\begin{key}{/tikz/node family/text depth=\meta{name} (initially \{\})}
Nodes with the same \meta{name} will have the same text depth.
An empty \meta{name} disables the evaluation by the library.
\end{key}
-\begin{key}{/tikz/node family/text width=\meta{name} (initially |\{\}|)}
+\begin{key}{/tikz/node family/text width=\meta{name} (initially \{\})}
Nodes with the same \meta{name} will have the same text width.
An empty \meta{name} disables the evaluation by the library.
\end{key}
@@ -68,31 +56,65 @@ Since the width of the node's content's box is setup much earlier,
the previous key only extends the width of that box which would make the text
seem as if it where aligned to the left.
With |text width family align| this can changed.
-\begin{key}{/tikz/node family/text width align=\meta{alignment}(initially |center|)}
+\begin{key}{/tikz/node family/text width align=\meta{alignment}(initially center)}
\meta{alignment} is one of |left|, |center| or |right|.
\begin{codeexample}[preamble=\usetikzlibrary{positioning,ext.node-families},/tikz/node distance=.5cm]
\tikzexternaldisable % ext.node-families does not work with active externalization
-\begin{tikzpicture}[nodes={Rectangle, draw, node family={text width=manual, text width align=right}}]
+\begin{tikzpicture}[nodes={rectangle, draw, node family={text width=manual, text width align=right}}]
\node (a) {Foo};
\node[below=of a] (b) {Foobar};
\end{tikzpicture}
\end{codeexample}
\end{key}
-\begin{key}{/tikz/node family/prefix=\meta{prefix}(initially \expandafter|\string\pgfpictureid-|)}
-The family names are prefixed with the value of |/tikz/node family/prefix|.
-\end{key}
-
\begin{key}{/tikz/node family/setup shape=\meta{shape}}
This adds instructions to the \meta{shape}'s definition which
adjust the text box's dimensions according to the family.
This should be only used once per shape.
\end{key}
-\begin{codeexample}[width=9cm,preamble=\usetikzlibrary{ext.node-families,shapes.geometric}]
+
+\subsection{Minimum Width/Height}
+While the keys of the previous subsection work well enough for nodes of the same shape
+(and the same |inner sep|s), for different node shapes the text box dimensions will be used
+differently for the node's total dimension.
+
+For this, the following keys are necessary.
+When one of the keys are used the values of |minimum width| and/or |minimum height| are set to |nf_width| or |nf_height| respectively.
+\begin{key}{/tikz/node family/width=\meta{name} (initially \{\})}
+Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum width}.
+An empty \meta{name} disables the evaluation by the library.
+\begin{codeexample}[preamble=\usetikzlibrary{positioning,ext.node-families},/tikz/node distance=.5cm]
+\tikzexternaldisable % ext.node-families does not work with active externalization
+\begin{tikzpicture}[nodes={rectangle, draw, node family/width=manual}]
+\node (a) {Foo};
+\node[below=of a] (b) {Foobar};
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/tikz/node family/height=\meta{name} (initially \{\})}
+Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum height}.
+An empty \meta{name} disables the evaluation by the library.
+\end{key}
+\begin{key}{/tikz/node family/size=\meta{name}}
+Sets both |height| and |width|.
+\end{key}
+
+\clearpage
+\subsection{More shapes that support the keys \texttt{width} and \texttt{height}}
+\begin{tikzlibrary}{ext.node-families.shapes.geometric}
+ This library adds support for the keys \referenceKeyandIndex[/tikz/node family/]{width} and
+ \referenceKeyandIndex[/tikz/node family/]{height} for the shapes of
+ the \pgfname\space library \referenceLibraryandIndexO{shapes.geometric}.
+
+ \inspirationQ{NodeFam-Ellipse}
+\end{tikzlibrary}
+The shapes are also setup for the keys from subsection~\ref{ssec:nf-text}.
+
+\begin{codeexample}[width=9cm,preamble=\usetikzlibrary{ext.node-families.shapes.geometric}]
\tikzexternaldisable % ext.node-families does not work with active externalization
-\begin{tikzpicture}[node family/setup shape=diamond]
+\begin{tikzpicture}
\foreach \cnt[count=\Cnt] in {a,...,h}
\node[draw, diamond, node family/text=aTOh] (\cnt)
at (right:\Cnt) {\cnt};