Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pimp codeexamples (issue #640) part 2 (of pull request #711) #729

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ \subsubsection{Styling Ticks and Grid Lines: The Style and Node Style Keys}
in addition to the usual |style|.

\begin{key}{/tikz/data visualization/node style=\meta{\tikzname\ options}}
This key works like |style|, only it has an effect only on nodes that are
This key works like |style|, but it has an effect only on nodes that are
created during a data visualization. This includes tick labels and axis
labels:
%
Expand Down
4 changes: 2 additions & 2 deletions doc/generic/pgf/text-en/pgfmanual-en-library-math.tex
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ \subsection{Overview}
\end{key}

The following sections describe the miniature language that this library
provides and can be used in the |\tikzmath| command and the |evaluate| key.
provides and can be used in the |\tikzmath| command and the |evaluate| key.
The language consists only of simple keywords and expressions but the
mini-parser allows you to format code in a reasonably versatile way (much like
the |tikz| parser) except that \emph{all the keywords must be followed by at
Expand Down Expand Up @@ -320,7 +320,7 @@ \subsection{Repeating Things}
\item Because each item is evaluated, you cannot use \tikzname\
coordinates in \meta{list}.
\item Only single variable assignment is supported.
\item The ``dots notation'' (e.\,g., |1,2,...,9|) can be used in
\item The ``dots notation'' (e.g., |1,2,...,9|) can be used in
\meta{list}, but is not as sophisticated as the \pgfname\
|\foreach| command. In particular, contextual replacement is not
possible.
Expand Down
176 changes: 89 additions & 87 deletions doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ \subsection{Inherently Colored Patterns}
\patternindexinherentlycolored{crosshatch dots light steel blue}
\end{tabular}


\subsection{User-Defined Patterns}
\label{section-library-patterns-meta}

Expand All @@ -91,80 +92,81 @@ \subsection{User-Defined Patterns}
\end{pgflibrary}

\emph{Caveat:} This library is currently experimental and might change without
notice. There are some known shortcomings that will hopefully be fixed in the
notice. There are some known shortcomings that will hopefully be fixed in the
future.

\begin{command}{\pgfdeclarepattern\marg{config}}
This command is used to declare a new pattern. In contrast to the normal
This command is used to declare a new pattern. In contrast to the normal
patterns and in the spirit of |arrows.meta| this command takes a list of
keys and values to define the pattern. The following keys are available:
%
\begin{key}{/pgf/patterns/name=\meta{name}}
The name of the pattern by which it can be used later on.
\end{key}
keys and values to define the pattern. The following keys are available:
Mo-Gul marked this conversation as resolved.
Show resolved Hide resolved
%
\begin{key}{/pgf/patterns/type=\meta{type} (default uncolored)}
The type of the pattern maps to what was called ``form only'' and ``inherently colored'' in the language of the normal patterns.
The available choices are:
\begin{itemize}
\item |uncolored| the pattern will obey the surrounding color.
\item |colored| the pattern will have an intrinsic color.
\item |form only| synonym for |uncolored|
\item |inherently colored| synonym for |colored|
\end{itemize}
\end{key}
\begin{key}{/pgf/patterns/name=\meta{name}}
The name of the pattern by which it can be used later on.
\end{key}
%
\begin{key}{/pgf/patterns/x=\meta{dimension} (default 1cm)}
Unit vector of the coordinate system in the $x$-direction.
\end{key}
\begin{key}{/pgf/patterns/type=\meta{type} (default uncolored)}
The type of the pattern maps to what was called ``form only'' and
``inherently colored'' in the language of the normal patterns. The
available choices are:
%
\begin{itemize}
\item |uncolored| the pattern will obey the surrounding color.
\item |colored| the pattern will have an intrinsic color.
\item |form only| synonym for |uncolored|
\item |inherently colored| synonym for |colored|
\end{itemize}
\end{key}
%
\begin{key}{/pgf/patterns/y=\meta{dimension} (default 1cm)}
Unit vector of the coordinate system in the $y$-direction.
\end{key}
\begin{key}{/pgf/patterns/x=\meta{dimension} (default 1cm)}
Unit vector of the coordinate system in the $x$-direction.
\end{key}
%
\begin{key}{/pgf/patterns/parameters=\meta{comma separated list} (default empty)}
A list of parameters that are passed to the pattern. This is usually a
list of TeX macros. It is very important that these macros are fully
expandable because the values they hold are being used for deduplication in
the PDF file.
\end{key}
\begin{key}{/pgf/patterns/y=\meta{dimension} (default 1cm)}
Unit vector of the coordinate system in the $y$-direction.
\end{key}
%
\begin{key}{/pgf/patterns/defaults=\meta{comma separated list} (default empty)}
This list holds default assignments to the parameters passed to the
pattern. The default keys can then be found under the |/pgf/pattern keys/|
prefix.
\end{key}
\begin{key}{/pgf/patterns/parameters=\meta{comma separated list} (default empty)}
A list of parameters that are passed to the pattern. This is usually a
list of \TeX\ macros. It is very important that these macros are fully
expandable because the values they hold are being used for
deduplication in the PDF file.
\end{key}
%
\begin{key}{/pgf/patterns/bottom left=\meta{pgfpoint}}
Bottom left corner of the pattern's bounding box, e.g.\
|\pgfqpoint{-.1pt}{-.1pt}|.
\end{key}
\begin{key}{/pgf/patterns/defaults=\meta{comma separated list} (default empty)}
This list holds default assignments to the parameters passed to the
pattern. The default keys can then be found under the
|/pgf/pattern keys/| prefix.
\end{key}
%
\begin{key}{/pgf/patterns/top right=\meta{pgfpoint}}
Top right corner of the pattern's bounding box, e.g.\
|\pgfqpoint{3.1pt}{3.1pt}|.
\end{key}
\begin{key}{/pgf/patterns/bottom left=\meta{pgfpoint}}
Bottom left corner of the pattern's bounding box, e.g.\
|\pgfqpoint{-.1pt}{-.1pt}|.
\end{key}
%
\begin{key}{/pgf/patterns/tile size=\meta{pgfpoint}}
Width and height of a single of the pattern as a \pgfname\ point
specification, i.e. the $x$ coordinate is the width and the $y$ coordinate
is the height, e.g.\ |\pgfqpoint{3pt}{3pt}|.
\end{key}
\begin{key}{/pgf/patterns/top right=\meta{pgfpoint}}
Top right corner of the pattern's bounding box, e.g.\
|\pgfqpoint{3.1pt}{3.1pt}|.
\end{key}
%
\begin{key}{/pgf/patterns/tile transformation=\meta{pgftransformation} (default empty)}
A \pgfname\ transformation, e.g.\ |\pgftransformrotate{30}|.
\end{key}
\begin{key}{/pgf/patterns/tile size=\meta{pgfpoint}}
Width and height of a single of the pattern as a \pgfname\ point
specification, i.e. the $x$ coordinate is the width and the $y$
coordinate is the height, e.g.\ |\pgfqpoint{3pt}{3pt}|.
\end{key}
%
\begin{key}{/pgf/patterns/code=\meta{code}}
The code should be \pgfname\ code than can be protocolled. It should not
contain any color code or nodes.
\end{key}
\begin{key}{/pgf/patterns/tile transformation=\meta{pgftransformation} (default empty)}
A \pgfname\ transformation, e.g.\ |\pgftransformrotate{30}|.
\end{key}
%
\begin{key}{/pgf/patterns/set up code=\meta{code} (default empty)}
This code can be set if parameters have to be preprocessed before the
actual pattern code can be run.
\end{key}
\begin{key}{/pgf/patterns/code=\meta{code}}
The code should be \pgfname\ code that can be protocolled. It should not
contain any color code or nodes.
\end{key}
%
\begin{key}{/pgf/patterns/set up code=\meta{code} (default empty)}
This code can be set if parameters have to be preprocessed before the
actual pattern code can be run.
\end{key}
\end{command}

\begin{codeexample}[preamble={\usetikzlibrary{patterns.meta}}]
Expand Down Expand Up @@ -215,44 +217,43 @@ \subsection{User-Defined Patterns}

\begin{command}{\tikzdeclarepattern\marg{config}}
A pattern declared with |\pgfdeclarepattern| can only execute \pgfname\
code. This command extends the functionality to also allow \tikzname\
code. All the same keys of |\pgfdeclarepattern| are valid, but some of
code. This command extends the functionality to also allow \tikzname\
code. All the same keys of |\pgfdeclarepattern| are valid, but some of
them have been overloaded to give a more natural \tikzname\ syntax.
%
\begin{key}{/tikz/patterns/bottom left=\meta{point}}
Instead of a \pgfname\ name point, this key takes a \tikzname\ point, e.g.\
|(-.1,-.1)|.
\end{key}
\begin{key}{/tikz/patterns/bottom left=\meta{point}}
Instead of a \pgfname\ name point, this key takes a \tikzname\ point,
e.g.\ |(-.1,-.1)|.
\end{key}
%
\begin{key}{/tikz/patterns/top right=\meta{point}}
Instead of a \pgfname\ name point, this key takes a \tikzname\ point, e.g.\
|(3.1,3.1)|.
\end{key}
\begin{key}{/tikz/patterns/top right=\meta{point}}
Instead of a \pgfname\ name point, this key takes a \tikzname\ point,
e.g.\ |(3.1,3.1)|.
\end{key}
%
\begin{key}{/tikz/patterns/tile size=\meta{point}}
Instead of a \pgfname\ name point, this key takes a \tikzname\ point, e.g.\
|(3,3)|.
\end{key}
\begin{key}{/tikz/patterns/tile size=\meta{point}}
Instead of a \pgfname\ name point, this key takes a \tikzname\ point,
e.g.\ |(3,3)|.
\end{key}
%
\begin{key}{/tikz/patterns/tile transformation=\meta{transformation}}
Instead of a \pgfname\ transformation, this key takes a list of keys and
value and extracts the resulting transformation from them, e.g.\
|rotate=30|.
\end{key}
\begin{key}{/tikz/patterns/tile transformation=\meta{transformation}}
Instead of a \pgfname\ transformation, this key takes a list of keys
and value and extracts the resulting transformation from them, e.g.\
|rotate=30|.
\end{key}

In addition to the overloaded keys, some new keys have been added.
%
\begin{key}{/tikz/patterns/bounding box=\meta{point} and \meta{point}}
This is a shorthand to set the bounding box. It will assign the first
point to |bottom left| and the second point to |top right|.
\end{key}
%
\begin{key}{/tikz/patterns/infer tile bounding box=\meta{dimension} (default 0pt)}
Instead of specifying the bounding box by hand, you can ask \tikzname\ to
infer the size of the bounding box for you. The \meta{dimension} parameter
is padding that is added around the bounding box.
\end{key}
\begin{key}{/tikz/patterns/bounding box=\meta{point} and \meta{point}}
This is a shorthand to set the bounding box. It will assign the first
point to |bottom left| and the second point to |top right|.
\end{key}
%
\begin{key}{/tikz/patterns/infer tile bounding box=\meta{dimension} (default 0pt)}
Instead of specifying the bounding box by hand, you can ask \tikzname\
to infer the size of the bounding box for you. The \meta{dimension}
parameter is padding that is added around the bounding box.
\end{key}
\end{command}

\begin{codeexample}[preamble={\usetikzlibrary{patterns.meta}}]
Expand Down Expand Up @@ -310,6 +311,7 @@ \subsection{User-Defined Patterns}

Instead of macros you can also use \pgfname\ keys as parameters, if that is
what you prefer.
%
\begin{codeexample}[preamble={\usetikzlibrary{patterns.meta}}]
\tikzdeclarepattern{
name=lines,
Expand Down
8 changes: 4 additions & 4 deletions doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ \subsection{Changing display styles}%

\begin{stylekey}{/pgf/number format/verbatim}
A style which configures the number printer to produce verbatim text
output, i.\,e., it doesn't contain \TeX\ macros.
output, i.e., it doesn't contain \TeX\ macros.
%
\begin{codeexample}[preamble={\usetikzlibrary{fpu}}]
\pgfkeys{
Expand All @@ -823,9 +823,9 @@ \subsection{Changing display styles}%
|assume math mode|. Furthermore, it installs a |sci generic| format for
verbatim output of scientific numbers.

However, it will still respect |precision|, |fixed zerofill|, |sci
zerofill| and the overall styles |fixed|, |sci|, |int detect| (and their
variants). It might be useful if you intend to write output files.
However, it will still respect |precision|, |fixed zerofill|,
|sci zerofill| and the overall styles |fixed|, |sci|, |int detect| (and
their variants). It might be useful if you intend to write output files.
\end{stylekey}


Expand Down
2 changes: 1 addition & 1 deletion doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ \section{Extended Color Support}
\begin{environment}{{colormixin}\marg{mix-in specification}}
The mix-in specification is applied to all colors inside the environment.
At the beginning of the environment, the mix-in is applied to the current
color, i.\,e., the color that was in effect before the environment started.
color, i.e., the color that was in effect before the environment started.
A mix-in specification is a number between 0 and 100 followed by an
exclamation mark and a color name. When a |\color| command is encountered
inside a mix-in environment, the number states what percentage of the
Expand Down