diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex index 93c0aed44b7..9a4daeeaff0 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex @@ -1,4 +1,4 @@ -% Copyright 2007 by Mark Wibrow +% Copyright 2019 by Mark Wibrow % % This file may be distributed and/or modified % @@ -24,7 +24,7 @@ tricky business and is only recommended for adventurous users. To add a new function to the math engine the following command can be used: -\begin{command}{\pgfmathdeclarefunction\opt{|*|}\marg{name}\marg{number of arguments}\marg{code}} +\begin{command}{\pgfmathdeclarefunction\opt{|*|}\marg{function name}\marg{number of arguments}\marg{code}} This will set up the parser to recognize a function called \meta{name}. The name of the function can consist of, uppercase or lowercase letters, numbers or the underscore |_|. In line with many programming languages, a @@ -120,9 +120,9 @@ To add a new function to the math engine the following command can be used: To redefine a function use the following command: -\begin{command}{\pgfmathredeclarefunction\marg{function name}\marg{algorithm code}} +\begin{command}{\pgfmathredeclarefunction\marg{function name}\marg{code}} This command redefines the |\pgfmath|\meta{function name}|@| macro with the - new \meta{algorithm code}. See the description of the + new \meta{code}. See the description of the |\pgfmathdeclarefunction| for details. You cannot change the number of arguments for an existing function. % @@ -205,3 +205,27 @@ To redefine a function use the following command: \end{codeexample} % \end{key} + +\begin{key}{/pgf/declare function/execute at begin function=\meta{tokens}} + These \meta{tokens} are inserted just before |\pgfmathdeclarefunction| + scans the body of the function definition. This is a rather low-level + option, so you should read the implementation to figure out where the + \meta{tokens} are inserted. +\end{key} + +\begin{key}{/pgf/declare function/execute at end function=\meta{tokens}} + These \meta{tokens} are inserted just after |\pgfmathdeclarefunction| has + finished scanning the body of the function definition. This is a rather + low-level option, so you should read the implementation to figure out where + the \meta{tokens} are inserted. +\end{key} + +\begin{key}{/pgf/declare function/ignore spaces=\meta{boolean}} + Uses the two previously described keys |/pgf/declare function/execute at begin function| and + |/pgf/declare function/execute at end function| to install catcodes such + that spaces inside the body of the function definition of + |\pgfmathdeclarefunction| are ignored. The usual \TeX\ tokenization rules + apply, so if the body of the function had already been tokenized by other + means this will become ineffective. If you want to use a space you can use + |~| in the function body which has its catcode set to 10 (space). +\end{key} |