summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex25
1 files changed, 19 insertions, 6 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
index 392e2298142..fdac5a31c42 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
@@ -277,7 +277,7 @@ continue with the next subsection.
Settings keys is done using a powerful command called |\pgfkeys|. This command
takes a list of so-called \emph{key--value pairs}. These are pairs of the form
-\meta{key}|=|\meta{value}. The principle idea is the following: For each pair
+\meta{key}|=|\meta{value}. The principal idea is the following: For each pair
in the list, some \emph{action} is taken. This action can be one of the
following:
%
@@ -376,13 +376,13 @@ instead of the more cumbersome
An example where such a syntax reinterpretation is done is the |quotes|
library, which allows you to write things like
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{graphs,quotes}}]
\tikz \graph { a ->["1" red] b ->["0"] c };
\end{codeexample}
%
\noindent instead of the somewhat longer
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{graphs}}]
\tikz \graph { a ->[edge node={node[red,auto]{1}}] b ->[edge label=0] c };
\end{codeexample}
@@ -1416,6 +1416,19 @@ Key 4:& \pgfkeys{/key4}
processing \meta{key}|=|\meta{result}.
\end{handler}
+\begin{handler}{{.evaluated}|=|\meta{value}}
+ This handler will evaluate \meta{value} as a mathematical
+ expression with |\pgfmathparse| and assign \meta{key}|=\pgfmathresult|.
+ %
+\begin{codeexample}[]
+\pgfkeys{
+ /golden ratio/.initial/.evaluated={(1 + sqrt(5))/2},
+}
+\pgfkeys{/golden ratio}
+\end{codeexample}
+ %
+\end{handler}
+
\begin{handler}{{.list}|=|\meta{comma-separated list of values}}
This handler causes the key to be used repeatedly, namely once for every
element of the list of values. Note that the list of values should
@@ -1592,7 +1605,7 @@ Key 4:& \pgfkeys{/key4}
will ``try'' to use the key, but no further action is taken when the key is
not defined.
- The \TeX-if |\||ifpgfkeyssuccess| will be set according to whether the
+ The \TeX-if |\ifpgfkeyssuccess| will be set according to whether the
\meta{key} was successfully executed or not.
%
\begin{codeexample}[]
@@ -1605,7 +1618,7 @@ Key 4:& \pgfkeys{/key4}
\begin{handler}{{.retry}|=|\meta{value}}
This handler works just like |/.try|, only it will not do anything if
- |\||ifpgfkeyssuccess| is false. Thus, this handler will only retry to set a
+ |\ifpgfkeyssuccess| is false. Thus, this handler will only retry to set a
key if ``the last attempt failed''.
%
\begin{codeexample}[]
@@ -1618,7 +1631,7 @@ Key 4:& \pgfkeys{/key4}
\begin{handler}{{.lastretry}|=|\meta{value}}
This handler works like |/.retry|, only it will invoke the usual handlers
- for unknowns keys if |\||ifpgfkeyssuccess| is false. Thus, this handler
+ for unknowns keys if |\ifpgfkeyssuccess| is false. Thus, this handler
will only try to set a key if ``the last attempt failed''. Furthermore,
this here is the last such attempt.
\end{handler}