diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-12 20:23:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-12 20:23:02 +0000 |
commit | 22cbaf8cd711b82b3fe4b387a7e72b58409ecdbd (patch) | |
tree | 0b785b59273566c030b567add8671b7f06167054 /Master/texmf-dist/doc/generic/pgf/text-en | |
parent | 692a797099b0acfd35d4bbd6a322acdc87c2c3a8 (diff) |
pgf
git-svn-id: svn://tug.org/texlive/trunk@51107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en')
19 files changed, 640 insertions, 119 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex index b51d5373162..a4067c9861a 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex @@ -968,7 +968,7 @@ only use one meta-decoration per path. \begin{environment}{{pgfmetadecoration}\marg{name}} This environment decorates the input path described in \meta{environment - contents}, with the meta-decoration \meta{name}. + contents}, with the meta-decoration \meta{name}. \end{environment} \begin{plainenvironment}{{pgfmetadecoration}\marg{name}} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex index eace57ffde3..56f49d7e5dc 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex @@ -66,7 +66,7 @@ The following commands are the most basic for specifying a coordinate. \draw[help lines] (0,0) grid (3,2); \foreach \angle in {0,10,...,90} - {\pgfpathcircle{\pgfpointpolar{\angle}{1cm/2cm}}{2pt}} + {\pgfpathcircle{\pgfpointpolar{\angle}{1cm and 2cm}}{2pt}} \pgfusepath{fill} \end{tikzpicture} \end{codeexample} @@ -662,8 +662,8 @@ be used to perform the above code: Note that this macro is used often internally. For this reason, it is not a good idea to keep anything important in the variables |\pgf@x| and |\pgf@y| since they will be overwritten and changed frequently. Instead, intermediate -values can ge stored in the \TeX-dimensions |\pgf@xa|, |\pgf@xb|, |\pgf@xc| and -their |y|-counterparts |\pgf@ya|, |\pgf@yb|, |pgf@yc|. For example, here is the +values can be stored in the \TeX-dimensions |\pgf@xa|, |\pgf@xb|, |\pgf@xc| and +their |y|-counterparts |\pgf@ya|, |\pgf@yb|, |\pgf@yc|. For example, here is the code of the command |\pgfpointadd|: % \begin{codeexample}[code only] diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex index c405699081b..e8bcde8ff7b 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex @@ -47,12 +47,88 @@ rgb(0cm)=(1,0,0); rgb(2cm)=(0,1,0); rgb(4cm)=(0,0,1) This line means that at 0cm (the left end) of the bar, the color should be red, which has red-green-blue (rgb) components (1,0,0). At 2cm, the bar should be green, and at 4cm it should be blue. Instead of |rgb|, you can currently also -specify |gray| as color model, in which case only one value is needed, or +specify |cmyk| as color model, in which case four values are needed, +|gray| as color model, in which case only one value is needed, or |color|, in which case you must provide the name of a color in parentheses. In a color specification the individual specifications must be separated using a semicolon, which may be followed by a whitespace (like a space or a newline). Individual specifications must be given in increasing order. +\subsubsection{Color models} + +\noindent\emph{by David Purton} + +An attempt is made to produce shadings consistent with the currently selected +|xcolor| package color model. The |rgb|, |cmyk|, and |gray| color models from +the |xcolor| package are supported. + +\textbf{Note:} The color model chosen for a shading is based on the |xcolor| +color model \emph{at the time the shading is created}. This is either when +\cs{pgfdeclare*shading} is called with no optional argument or when +\cs{pgfuseshading} is called if \cs{pgfdeclare*shading} was called with an +optional argument. + +If the |xcolor| package |natural| color model is in use then the shading color +model will be \textsc{rgb} by default. In practice this means that if you are +using the |natural| color model of the |xcolor| package you can get mismatched +colors if you, for example, create a shading from green (which is defined as +\textsc{rgb}) to magenta (which is defined as \textsc{cmyk}). The shading will +finish with \textsc{rgb} magenta which will look different to the +\textsc{cmyk} magenta used in solid colors. + +You can avoid mismatched colors by loading the |xcolor| package first with an +explicit color model (|rgb|, |cmyk|, or |gray|). + +\begin{codeexample}[code only] +\begin{tikzpicture} + \fill[green] (0,0) rectangle (1,1); + \shade[left color=green, right color=magenta] (1.25,0) rectangle (3.75,1); + \fill[magenta] (4,0) rectangle (5,1); +\end{tikzpicture} +\end{codeexample} + +\begin{center} + \begin{minipage}{5cm} + |xcolor| |natural| color model:\medskip + + \begin{tikzpicture} + \fill[green] (0,0) rectangle (1,1); + \shade[left color=green, right color=magenta] (1.25,0) rectangle (3.75,1); + \fill[magenta] (4,0) rectangle (5,1); + \end{tikzpicture} + \end{minipage}\hspace{2cm}% + \begin{minipage}{5cm} + |xcolor| |cmyk| color model:\medskip + + \selectcolormodel{cmyk} + \begin{tikzpicture} + \fill[green] (0,0) rectangle (1,1); + \shade[left color=green, right color=magenta] (1.25,0) rectangle (3.75,1); + \fill[magenta] (4,0) rectangle (5,1); + \end{tikzpicture} + \end{minipage}\medskip + + \begin{minipage}{5cm} + |xcolor| |rgb| color model:\medskip + + \selectcolormodel{rgb} + \begin{tikzpicture} + \fill[green] (0,0) rectangle (1,1); + \shade[left color=green, right color=magenta] (1.25,0) rectangle (3.75,1); + \fill[magenta] (4,0) rectangle (5,1); + \end{tikzpicture} + \end{minipage}\hspace{2cm}% + \begin{minipage}{5cm} + |xcolor| |gray| color model:\medskip + + \selectcolormodel{gray} + \begin{tikzpicture} + \fill[green] (0,0) rectangle (1,1); + \shade[left color=green, right color=magenta] (1.25,0) rectangle (3.75,1); + \fill[magenta] (4,0) rectangle (5,1); + \end{tikzpicture} + \end{minipage} +\end{center} \subsection{Declaring Shadings} @@ -75,11 +151,12 @@ Individual specifications must be given in increasing order. change a color that was used in the declaration of the shading later on, the shading will not change. By specifying a \meta{color list} you can specify that the shading should be recalculated whenever one of the colors - listed in the list changes (this includes effects like color mixins). Thus, - when you specify a \meta{color list}, whenever the shading is used, - \pgfname\ first converts the colors in the list to \textsc{rgb} triples - using the current values of the colors and taking any mixins and blends - into account. If the resulting \textsc{rgb} triples have not yet been used, + listed in the list changes (this includes effects like color mixins and + |xcolor| color models). Thus, when you specify a \meta{color list}, + whenever the shading is used, \pgfname\ first converts the colors in the + list to tuples in the current |xcolor| color model using the current + values of the colors and taking any mixins and blends into account. If the + resulting tuples have not yet been used, a new shading is internally created and used. Note that if the option \meta{color list} is used, then no shading is created until the first use of |\pgfuseshading|. In particular, the colors mentioned in the shading @@ -187,9 +264,12 @@ Individual specifications must be given in increasing order. \texttt{50.0} and \texttt{72.0}. Otherwise, the (virtual) stack is empty (or should be treated as if it were empty). The function should then replace these two values by three values, representing the red, green, and - blue color of the point. The numbers should be real values, not integers - since, Apple's PDF renderer is broken in this regard (use cvr at the end if - necessary). + blue color of the point for an \textsc{rgb} shading, four colors, + representing the cyan, magenta, yellow, and black color of the point for a + \textsc{cmyk} shading, or one value representing the gray color for a + grayscale shading. The numbers should be real values, not integers + since, Apple's PDF renderer is broken in this regard (use \texttt{cvr} at + the end if necessary). Conceptually, the function will be evaluated once for each point of the rectangle \meta{lower left corner} to \meta{upper right corner}, which @@ -231,10 +311,12 @@ Individual specifications must be given in increasing order. Inside the PostScript function \meta{type 4 function} you cannot use colors directly. Rather, you must push the color components on the stack. For - this, it is useful to call |\pgfshadecolortorgb| in the \meta{init code}: + this, it is useful to call one of |\pgfshadecolortorgb|, + |\pgfshadecolortocmyk|, or |\pgfshadecolortogray| in the \meta{init code}: \begin{command}{\pgfshadecolortorgb\marg{color name}\marg{macro}} - This command takes \meta{color name} as input and stores the color's + This command takes \meta{color name} as input, converts it to + \textsc{rgb} and stores the color's red/green/blue components real numbers between 0.0 and 1.0 separated by spaces (which is exactly what you need if you want to push it on a stack) in \meta{macro}. This macro can then be used inside the @@ -313,9 +395,184 @@ Individual specifications must be given in increasing order. \colorlet{col4}{green} \pgfuseshading{bilinear interpolation} \end{codeexample} + + \begin{command}{\pgfshadecolortocmyk\marg{color name}\marg{macro}} + This command takes \meta{color name} as input, converts it to + \textsc{cmyk} and stores the color's cyan/magenta/yellow/black + components real numbers between 0.0 and 1.0 separated by spaces. + + In addition, four macros suffixed with |cyan|, |magenta|, |yellow| and + |black| are defined, which store the individual components of + \meta{color name}. + % + \end{command} + + \begin{command}{\pgfshadecolortogray\marg{color name}\marg{macro}} + This command takes \meta{color name} as input converts it to grayscale + and stores the color's value as a real number between 0.0 and 1.0. + + Although it's not needed, for consistency a second macro suffixed with + |gray| is also defined. + % + \end{command} % \end{command} +\paragraph{Color model independent functional shadings.} + +By nature, the PostScript code used in functional shadings must output one of +\textsc{rgb}, \textsc{cmyk}, or grayscale data. Therefore, +\cs{pgfdeclarefunctionalshading} is \emph{not} portable across color models. + +Take particular care that the same color model is in use at declaration time +and use time for functional shadings declared with an optional argument as +otherwise the PostScript data will not match the declared color space and +you will end up with a malformed PDF. + +Having said this, it \emph{is} possible to create portable functional shadings +by providing conditional code to append color transformations to the +PostScript data. A variety of \cs{pgffuncshading*to*} (e.g., +\cs{pgffuncshadingrgbtocmyk}) macros along with \cs{ifpgfshadingmodel*} (e.g., +\cs{ifpgfshadingmodelcmyk}) conditionals are provided to assist with these +transformations. Obviously, this will make the PostScript code less efficient +than if you work in your intended color model. + +\pgfdeclarefunctionalshading[black]{portabletwospots} + {\pgfpointorigin}{\pgfpoint{3.5cm}{3.5cm}}{}{ + 2 copy + 45 sub dup mul exch + 40 sub dup mul 0.5 mul add sqrt + dup mul neg 1.0005 exch exp 1.0 exch sub + 3 1 roll + 70 sub dup mul .5 mul exch + 70 sub dup mul add sqrt + dup mul neg 1.002 exch exp 1.0 exch sub + 1.0 3 1 roll + \ifpgfshadingmodelcmyk + \pgffuncshadingrgbtocmyk + \fi + \ifpgfshadingmodelgray + \pgffuncshadingrgbtogray + \fi +} +\begin{center} + \begin{minipage}{3.5cm} + |xcolor| |rgb| model:\medskip + + \selectcolormodel{rgb} + \pgfuseshading{portabletwospots} + \end{minipage}\hspace{2cm} + \begin{minipage}{3.5cm} + |xcolor| |cmyk| model:\medskip + + \selectcolormodel{cmyk} + \pgfuseshading{portabletwospots} + \end{minipage}\hspace{2cm} + \begin{minipage}{3.5cm} + |xcolor| |gray| model:\medskip + + \selectcolormodel{gray} + \pgfuseshading{portabletwospots} + \end{minipage} +\end{center} + +\begin{codeexample}[code only] +\pgfdeclarefunctionalshading[black]{portabletwospots}{\pgfpointorigin}{\pgfpoint{3.5cm}{3.5cm}}{}{ + 2 copy + 45 sub dup mul exch + 40 sub dup mul 0.5 mul add sqrt + dup mul neg 1.0005 exch exp 1.0 exch sub + 3 1 roll + 70 sub dup mul .5 mul exch + 70 sub dup mul add sqrt + dup mul neg 1.002 exch exp 1.0 exch sub + 1.0 3 1 roll + \ifpgfshadingmodelcmyk + \pgffuncshadingrgbtocmyk + \fi + \ifpgfshadingmodelgray + \pgffuncshadingrgbtogray + \fi +} +\end{codeexample} + +\begin{command}{\pgffuncshadingrgbtocmyk} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to convert the + top 3 elements on the stack from \textsc{rgb} to \textsc{cmyk}. In + combination with the \cs{ifpgfshadingmodelcmyk} conditional this macro can + be used to make functional shading declarations more portable across color + models. +\end{command} + +\begin{command}{\pgffuncshadingrgbtogray} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to convert the + top 3 elements on the stack from \textsc{rgb} to grayscale. In combination + with the \cs{ifpgfshadingmodelgray} conditional this macro can be used to + make functional shading declarations more portable across color models. +\end{command} + +\begin{command}{\pgffuncshadingcmyktorgb} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to convert the + top 4 elements on the stack from \textsc{cmyk} to \textsc{rgb}. In + combination with the \cs{ifpgfshadingmodelrgb} conditional this macro can be + used to make functional shading declarations more portable across color + models. +\end{command} + +\begin{command}{\pgffuncshadingcmyktogray} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to convert the + top 4 elements on the stack from \textsc{cmyk} to grayscale. In combination + with the \cs{ifpgfshadingmodelgray} conditional this macro can be used to + make functional shading declarations more portable across color models. +\end{command} + +\begin{command}{\pgffuncshadinggraytorgb} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to convert the + top element on the stack from grayscale to \textsc{rgb}. In combination with + the \cs{ifpgfshadingmodelrgb} conditional this macro can be used to make + functional shading declarations more portable across color models. +\end{command} + +\begin{command}{\pgffuncshadinggraytocmyk} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to convert the + top element on the stack from grayscale to \textsc{cmyk}. In combination + with the \cs{ifpgfshadingmodelcmyk} conditional this macro can be used to + make functional shading declarations more portable across color models. +\end{command} + +{\let\ifpgfshadingmodelrgb=\relax + \let\ifpgfshadingmodelcmyk=\relax + \let\ifpgfshadingmodelgray=\relax + \begin{command}{\ifpgfshadingmodelrgb} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to test if the + |xcolor| color model is |rgb| \emph{at the time the shading is created}. + This can be used to ensure that the data output in the \meta{type 4 + function} correctly matches the active color model. + \end{command} + + \begin{command}{\ifpgfshadingmodelcmyk} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to test if the + |xcolor| color model is |cmyk| \emph{at the time the shading is created}. + This can be used to ensure that the data output in the \meta{type 4 + function} correctly matches the active color model. + \end{command} + + \begin{command}{\ifpgfshadingmodelgray} + Within the \meta{type 4 function} argument of + \cs{pgfdeclarefunctionalshading}, this command can be used to test if the + |xcolor| color model is |gray| \emph{at the time the shading is created}. + This can be used to ensure that the data output in the \meta{type 4 + function} correctly matches the active color model. + \end{command} +} \subsection{Using Shadings} \label{section-shading-a-path} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex index fda8f6a8872..22156f98d3e 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex @@ -349,6 +349,7 @@ Transparency groups are declared using the following commands. is ``large enough'' and then insert this picture into the main picture while ignoring the size. The following example shows how this is done: +% TODO: Nesting tikzpictures is NOT supported {\tikzexternaldisable \begin{codeexample}[] \begin{tikzpicture} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex index 975afd3d5b8..6f6c2e6ef01 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex @@ -91,12 +91,13 @@ % \begin{codeexample}[] \tikz - \draw (1,0,0) coordinate (A) -- (0,0,0) coordinate (B) - -- (0,0,1) coordinate (C) - (B) -- (0,1,0) coordinate (D) - pic [fill=gray,angle radius=4mm] {right angle = A--B--C} - pic [draw,red,thick,angle eccentricity=.5,pic text=$\cdot$] - {right angle = A--B--D}; + \draw (0,0,0) coordinate (O) + (1,0,0) coordinate (A) -- (O) + (0,0,1) coordinate (B) -- (O) + (0,1,0) coordinate (C) -- (O) + pic [fill=gray,angle radius=4mm] {right angle = A--O--B} + pic [draw,red,thick,angle eccentricity=.5,pic text=.] + {right angle = A--O--C}; \end{codeexample} % \end{pictype} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex index 66bbd1e3233..c211fa49ca4 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex @@ -920,7 +920,7 @@ graphical representations of the symbols declared in the following library: \end{key} \end{tikzlibrary} -Since the |circuit.logic| library does not define any actual graphics, you need +Since the |circuits.logic| library does not define any actual graphics, you need to use one of the following libraries, instead: \begin{pgflibrary}{circuits.logic.IEC} @@ -1241,7 +1241,7 @@ Let us begin with the base library that defines the handling of inputs. \foreach \x/\y/\z in {false/blue/1pt, true/red/2pt} \foreach \a in {north, south, east, west, north east, south east, north west, south west} - \draw[logic gate anchors use bounding box=\x, color=\y] + \draw[logic gate anchors use bounding box=\x, color=\y] (A.\a) circle(\z); \end{tikzpicture} \end{codeexample} @@ -1478,7 +1478,7 @@ As for logical circuits, to draw a circuit the first step is to include a library containing the symbols graphics. Currently, you have to include |circuits.ee.IEC|. -\begin{tikzlibrary}{circuit.ee.IEC} +\begin{tikzlibrary}{circuits.ee.IEC} When this library is loaded, you can use the following style: % \begin{key}{/tikz/circuit ee IEC} @@ -1746,6 +1746,8 @@ say |set| \meta{symbol name} |graphic=var| \meta{symbol name} |IEC graphic|. \eelineexample{/tikz/bulb}{} \eelineexample{/tikz/current source}{} \eelineexample{/tikz/voltage source}{} + \eelineexample{/tikz/ac source}{} + \eelineexample{/tikz/dc source}{} \eeendexample{/tikz/ground}{} \end{tabular} @@ -1783,10 +1785,25 @@ The following table shows contacts as they are depicted inside the \end{tabular} +\subsubsection{Symbols: Measurement devices} + +The following table shows measurement devices as they are depicted inside the +|circuit ee IEC| environment. +\medskip + +\noindent +\begin{tabular}{p{5cm}ll} + \emph{Key} & \emph{Appearance} \\[.25em] + \eelineexample{/tikz/amperemeter}{} + \eelineexample{/tikz/voltmeter}{} + \eelineexample{/tikz/ohmmeter}{} +\end{tabular} + + \subsubsection{Units} \label{section-circuits-units} -The |circuit.ee| library predefines the following unit keys: +The |circuits.ee| library predefines the following unit keys: \medskip \noindent @@ -1808,7 +1825,7 @@ The |circuit.ee| library predefines the following unit keys: \subsubsection{Annotations} \label{section-circuits-annotations} -The |circuit.ee.IEC| library defines the following annotations: +The |circuits.ee.IEC| library defines the following annotations: \medskip \noindent diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex index 58d2b6f3af8..718d8b7870c 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex @@ -1819,7 +1819,7 @@ shapes. This library is included mostly for historical reasons, using the \end{key} \begin{key}{/pgf/decoration/text effects/word count=\meta{macro}} - Store the number of words in the decoration text in \meta{macro}. + Store the number of words in the decoration text in \meta{macro}. Numbering starts at |1|. When the character is the word separator, \meta{macro} takes the number of the previous word. If the decoration text starts with a word separator \meta{macro} will be |0|. diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex index 58a7d4c9a19..cd9092874c5 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex @@ -8,11 +8,11 @@ % See the file doc/generic/pgf/licenses/LICENSE for more details. -\section{Paper Folding Diagrams Library} +\section{Paper-Folding Diagrams Library} \label{section-calender-folding} \begin{tikzlibrary}{folding} - This library defines pic types for creating paper folding diagrams. Many + This library defines pic types for creating paper-folding diagrams. Many thanks to Nico van Cleemput for providing most of the code. \end{tikzlibrary} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex index 78b72d5ab8c..15a678e7270 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex @@ -50,6 +50,7 @@ \foreach \where in {-9cm,9cm} {\nodeshadowed [at={(\where,5cm)}] { + % TODO: Nesting tikzpictures is NOT supported \tikz \draw [green!20!black, rotate=90] [l-system={rule set={F -> FF-[-F+F]+[+F-F]}, axiom=F, order=4, step=2pt, randomize step percent=50, angle=30, randomize angle percent=5}] @@ -220,7 +221,7 @@ \title{\bfseries The \tikzname\ and {\Large PGF} Packages\\ \large Manual for version \pgfversion\\[1mm] -\large\href{https://sourceforge.net/projects/pgf}{\texttt{https://sourceforge.net/projects/pgf}}} +\large\href{https://github.com/pgf-tikz/pgf}{\texttt{https://github.com/pgf-tikz/pgf}}} \author{Till Tantau\footnote{Editor of this documentation. Parts of this documentation have been written by other authors as indicated in these parts or chapters and in Section~\ref{section-authors}.}\\ @@ -536,6 +537,7 @@ libraries are not loaded by default since many users will not need them. \include{pgfmanual-en-library-mindmaps} \include{pgfmanual-en-library-folding} \include{pgfmanual-en-library-patterns} +\include{pgfmanual-en-library-perspective} \include{pgfmanual-en-library-petri} \include{pgfmanual-en-library-plot-handlers} \include{pgfmanual-en-library-plot-marks} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex index 5515cc8b7ed..d35c0e89abd 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex @@ -94,6 +94,7 @@ views, animations, rdf, + perspective, } \usepackage{ifluatex} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex index 4967587a306..578f66e6af4 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex @@ -1,4 +1,5 @@ % Copyright 2008 by Till Tantau +% Copyright 2019 by Jonathan P. Spratte % % This file may be distributed and/or modified % @@ -8,84 +9,273 @@ % See the file doc/generic/pgf/licenses/LICENSE for more details. -\section{Parser Module} -\label{section-module-parser} +\section{Parser Module}% +\label{section-module-parser}% -\begin{pgfmodule}{parser} +\begin{pgfmodule}{parser}% This module defines some commands for creating a simple letter-by-letter parser. -\end{pgfmodule} +\end{pgfmodule}% This module provides commands for defining a parser that scans some given text letter-by-letter. For each letter, some code is executed and, possibly a -state-switch occurs. The parsing process ends when a final state has been -reached. - -\begin{command}{\pgfparserparse\marg{parser name}\meta{text}} - This command is used to parse the \meta{text} using the (previously - defined) parser named \meta{parser name}. - - The \meta{text} is not contained in curly braces, rather it is all the text - that follows. The end of the text is determined implicitly, namely when the - final state of the parser has been reached. - - The parser works as follows: At any moment, it is in a certain - \emph{state}, initially this state is called |initial|. Then, the first - letter of the \meta{text} is examined (using the |\futurlet| command). For - each possible state and each possible letter, some action code is stored in - the parser in a table. This code is then executed. This code may, but need - not, trigger a \emph{state switch}, causing a new state to be set. The - parser then moves on to the next character of the text and repeats the - whole procedure, unless it is in the state |final|, which causes the - parsing process to stop immediately. - - In the following example, the parser counts the number of |a|'s in the - \text{text}, ignoring any |b|'s. The \meta{text} ends with the first~|c|. - % +state-switch occurs. The code for each letter might take mandatory or optional +arguments. The parsing process ends when a final state has been reached, and +optionally some code is executed afterwards. + +\begin{command}{\pgfparserparse\marg{parser name}\meta{text}}% + This command is used to parse the \meta{text} using the (previously defined) + parser named \meta{parser name}. + + The \meta{text} is not contained in curly braces, rather it is all the text + that follows. The end of the text is determined implicitly, namely when the + final state of the parser has been reached. If you defined a final action for + the parser using |\pgfparserdeffinal| it is executed now. + + The parser works as follows: At any moment, it is in a certain + \emph{state}, initially this state is called |initial|. Then, the first + letter of the \meta{text} is examined (using the |\futurlet| command). For + each possible state and each possible letter, some action code is stored in + the parser in a table. This code is then executed. This code may, but need + not, trigger a \emph{state switch}, causing a new state to be set. The + parser then moves on to the next character of the text and repeats the + whole procedure, unless it is in the state |final|, which causes the + parsing process to stop immediately. + + In the following example, the parser counts the number of |a|'s in the + \text{text}, ignoring any |b|'s. The \meta{text} ends with the first~|c|. + % \begin{codeexample}[] \newcount\mycount -\pgfparserdef{myparser}{initial}{the letter a} -{\advance\mycount by 1\relax} -\pgfparserdef{myparser}{initial}{the letter b} +\pgfparserdef{myparser}{initial}{the letter a}% +{\advance\mycount by 1\relax}% +\pgfparserdef{myparser}{initial}{the letter b}% {} % do nothing -\pgfparserdef{myparser}{initial}{the letter c} +\pgfparserdef{myparser}{initial}{the letter c}% {\pgfparserswitch{final}}% done! \pgfparserparse{myparser}aabaabababbbbbabaabcccc There are \the\mycount\ a's. -\end{codeexample} +\end{codeexample}% % -\end{command} - -\begin{command}{\pgfparserdef\marg{parser name}\marg{state}\marg{symbol meaning}\marg{action}} - This command should be used repeatedly to define a parser named - \meta{parser name}. With a call to this command you specify that the - \meta{parser name} should do the following: When it is in state - \meta{state} and reads the letter \meta{symbol meaning}, perform the code - stored in \meta{action}. - - The \meta{symbol meaning} must be the text that results from applying the - \TeX\ command |\meaning| to the given character. For instance, |\meaning a| - yields |the letter a|, while |\meaning 1| yields |the character 1|. A space - yields |blank space|. - - Inside the \meta{action} you can perform almost any kind of code. This code - will not be surrounded by a scope, so its effect persists after the parsing - is done. However, each time after the \meta{action} is executed, control - goes back to the parser. You should not launch a parser inside the - \meta{action} code, unless you put it in a scope. - - When you set the \meta{state} to |all|, the state \meta{action} is - performed in all states as a fallback, whenever \meta{symbol meaning} is - encountered. This means that when you do not specify anything explicitly - for a state and a letter, but you do specify something for |all| and this - letter, then the specified \meta{action} will be used. - - When the parser encounters a letter for which nothing is specified in the - current state (neither directly nor indirectly via |all|), an error occurs. -\end{command} - -\begin{command}{\pgfparserswitch\marg{state}} +\end{command}% + +\begin{command}% + {% + \pgfparserdef\marg{parser name}\marg{state}\meta{symbol meaning}% + \oarg{arguments}\marg{action}% + }% + This command should be used repeatedly to define a parser named + \meta{parser name}. With a call to this command you specify that the + \meta{parser name} should do the following: When it is in state \meta{state}% + and reads the letter \meta{symbol meaning}, perform the code stored in + \meta{action}. + + The \meta{symbol meaning} must be the text that results from applying the + \TeX\ command |\meaning| to the given character. For instance, |\meaning a| + yields |the letter a|, while |\meaning 1| yields |the character 1|. A space + yields |blank space|. Alternatively you can give the symbol you want without + surrounding it in braces. So both + |\pgfparserdef{myparser}{initial}{the letter a}{foo}| + and + |\pgfparserdef{myparser}{initial}a{foo}| + define an \meta{action} for |the letter a|. + + The \meta{action} might require arguments which you can specify in the + optional \meta{arguments} string. The argument string can contain up to nine + argument specifications of the following types: + + \begingroup + \def\argdesc#1#2% + {% + \par + \begingroup + \setbox0\hbox{\texttt #1}\makebox[1.5em][l]{\usebox0}% + \ifdim\wd0>1.5em\\\null\hspace{1.5em}\fi + \parbox[t]{\dimexpr\linewidth-1.5em\relax}{#2}% + \endgroup + }% + \argdesc{m}% + {a normal mandatory argument}% + \argdesc{r\meta{delim}}% + {a mandatory argument which is read up to the \meta{delim}}% + \argdesc{o}% + {an optional argument in |[]| defaulting to a special mark}% + \argdesc{O\marg{default}}% + {like |o| but defaulting to \meta{default}}% + \argdesc{d\meta{delim1}\meta{delim2}}% + {% + an optional argument in \meta{delim1} and \meta{delim2} defaulting to a + special mark% + }% + \argdesc{D\meta{delim1}\meta{delim2}\marg{default}}% + {like |d| but defaulting to \meta{default}}% + \argdesc{t\meta{token}}% + {% + tests whether the next letter is \meta{token}, if so gobbles it and + the argument is set to a special mark.% + }% + \endgroup + + So if you want to define an \meta{action} that takes two mandatory arguments + you use |[mm]|, if it should take an optional star, one optional argument in + brackets that returns a marker if it's not used, one mandatory and finally an + optional argument in parentheses that defaults to |something| you use + |[t*omD(){something}]| as the argument string. If the argument should be + anything up to a semicolon, you use |[r;]|. Spaces before argument + specifications in the string are ignored. So |[r m]| will be one argument and + read anything up to an |m|. Also spaces before any argument in the parsed + letters are ignored, so if |a| was setup to take an optional argument the + argument would be detected in |a []|. Like with normal \LaTeXe\ optional + arguments you have to protect nested brackets: |[a[bc]d]| would be read as + |a[bc| with a trailing |d]|, \emph{not} as |a[bc]d|. You'd have to use + |[{a[bc]d}]| to get it correct. + + Inside the \meta{action} you can perform almost any kind of code. This code + will not be surrounded by a scope, so its effect persists after the parsing + is done. However, each time after the \meta{action} is executed, control + goes back to the parser. You should not launch a parser inside the + \meta{action} code, unless you put it in a scope. + + When you set the \meta{state} to |all|, the state \meta{action} is performed + in all states as a fallback, whenever \meta{symbol meaning} is encountered. + This means that when you do not specify anything explicitly for a state and a + letter, but you do specify something for |all| and this letter, then the + specified \meta{action} will be used. + + When the parser encounters a letter for which nothing is specified in the + current state (neither directly nor indirectly via |all|), an error occurs. + Additionally you can specify an action that is executed after the error is + thrown using |\pgfparserdefunknown|. +\end{command}% + +\begin{command}% + {% + \pgfparserlet + \marg{parser name 1}\marg{state 1}\meta{symbol meaning 1}% + \oarg{opt 1}\oarg{opt 2}\meta{symbol meaning 2}% + }% + If none of of the optional arguments are given in the following \meta{parser + name 2} and \meta{state 2} are the same as \meta{parser name 1} and + \meta{state 1}. If only the first is given \meta{state 2} equals + \meta{opt 1}. If both are given \meta{parser name 2} equals \meta{opt 1} and + \meta{state 2} equals \meta{opt 2}. + + Defines an action for \meta{parser name 1} in \meta{state 1} for the + \meta{symbol meaning 1} to do the same as the action of \meta{parser name 2}% + in \meta{state 2} for the \meta{symbol meaning 2}. For \meta{symbol meaning 1}% + and \meta{symbol meaning 2} the same parsing rules apply as for \meta{symbol + meaning} in |\pgfparserdef| so you either give the meaning in braces or just + the symbol. +\end{command}% + +\begin{command}{\pgfparserdefunknown\marg{parser name}\marg{state}\marg{action}}% + With this macro you can define an \meta{action} for the \meta{parser name}% + parser in \meta{state} if the letter which was encountered was undefined. +\end{command}% + +\begin{command}{\pgfparserdeffinal\marg{parser name}\marg{action}}% + Every parser can call a final \meta{action} after the state was switched to + |final|. This \meta{action} is executed after everything else, so you can use + something that grabs more arguments if you want to. +\end{command}% + +\begin{command}{\pgfparserswitch\marg{state}}% This command can be called inside the action code of a parser to cause a state switch to \meta{state}. -\end{command} +\end{command}% + +\begin{command}{\pgfparserifmark\marg{arg}\marg{true}\marg{false}}% + Remember that some of the optional argument types set special marks? With + |\pgfparserifmark| you can test whether \meta{arg} is such a mark. So if + there was no optional argument for the argument types |o| and |d| the + \meta{true} branch will be executed, else the \meta{false} branch. For the |t| + type argument the \meta{true} branch is executed if the token was encountered. +\end{command}% + +\begin{command}{\pgfparserreinsert}% + You can use this as the final macro in an action of |\pgfparserdef| or + |\pgfparserdefunknown|. This has the effect that the letter which was parsed + in this action will be parsed again after this action (and after any arguments + were read). +\end{command}% + +\begin{command}{\pgfparserstate}% + Expands to the current state of the parser. +\end{command}% + +\begin{command}{\pgfparsertoken}% + This is the macro which is let to the following token with |\futurelet|. You + can use it inside an action code. +\end{command}% + +\begin{command}{\pgfparserletter}% + This macro stores the letter to which |\pgfparsertoken| was let. So if + you'd use |\pgfparserparse{foo}a| this macro would be defined with + |\def\pgfparserletter{a}|. This definition is done before any action code is + executed. There are two special cases: If |{| or |}| would be the next letter + for the parser, this macro is defined to expand to |\bgroup| or |\egroup|. +\end{command}% + +\begin{command}{\pgfparserset\marg{key list}}% + The |pgfparser| module has a few keys you can access through this macro. It + is just a shortcut for |\pgfset{/pgfparser/.cd,#1}|. The available keys are + listed in subsection~\ref{sec:parser:keys}. +\end{command}% + +\subsection{Keys of the Parser Module}\label{sec:parser:keys}% +\begin{key}{/pgfparser/silent=\meta{boolean} (initially false)}% + If |true| then no error will be thrown when a letter is parsed for which no + action is specified, silently ignoring it. This holds true for every parser. +\end{key}% + +\begin{key}{/pgfparser/status=\meta{boolean} (initially false)}% + If |true| every parser prints a status message for every action executed. This + might help in debugging and understanding what the parser does. +\end{key}% + +Additionally to those keys for every \meta{parser name} for which +|\pgfparserdef|, |\pgfparserdefunknown| or |\pgfparserlet| was run at least once +the following will be defined: + +\begin{key}% + {/pgfparser/\meta{parser name}/silent=\meta{boolean} (initially false)}% + If |true| the parser \meta{parser name} will silently ignore undefined + letters. This is an individual equivalent of |/pgfparser/silent| for each + defined parser. +\end{key}% + +\subsection{Examples}% +The following example counts the different letters appearing in a more or less +random string of letters. Every letter is counted only once, this is achieved by +defining a new action for every encountered unknown letter that does nothing. We +can define such rule without knowing which letter is used, because +|\pgfparsertoken| has the same meaning as that letter. +\begin{codeexample}[] +\mycount=0 +% using the shortcut syntax of just placing ; after the state +\pgfparserdef{different letters}{all};{\pgfparserswitch{final}}% +\pgfparserdefunknown{different letters}{all}% + {\pgfparserdef{different letters}{all}\pgfparsertoken{}\advance\mycount1}% +\pgfparserdeffinal{different letters}% + {\the\mycount\ different letters found}% +% don't throw errors for unknown letters +\pgfparserset{different letters/silent=true}% + +\pgfparserparse{different letters}udiaternxqlchudiea; +\end{codeexample}% + +Next we want to try something that uses some of the different argument types +available. +\begin{codeexample}[] +% using the same syntax as \pgfparserdef +\pgfparserdef{arguments}{initial}{the letter a}[d()] + {\pgfparserifmark{#1}{\textcolor{red}{\textit{use}}}{\textbf{#1}} }% +% using the shortcut syntax +\pgfparserdef{arguments}{initial}t[m]{\texttt{#1} }% +\pgfparserdef{arguments}{initial}c[t*O{blue}m] + {\pgfparserifmark{#1}{#3}{\textcolor{#2}{#3}}}% +\pgfparserdef{arguments}{all};{\pgfparserswitch{final}}% + +\pgfparserparse{arguments}t{nobody}a(will)ac[green]{P}c*{arse}c{r}; +\end{codeexample}% diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex index c22c2c2884a..7e6dae54f53 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex @@ -112,7 +112,7 @@ This section describes the package |pgfcalendar|. following: % \begin{verbatim} -\pgfcalendardatetojulian{2454115}{\myyear}{\mymonth}{\myday} +\pgfcalendarjuliantodate{2454115}{\myyear}{\mymonth}{\myday} \edef\isodate{\myyear-\mymonth-\myday} \end{verbatim} % @@ -131,6 +131,16 @@ This section describes the package |pgfcalendar|. \pgfcalendarjuliantoweekday{2454115}{\mycount}\the\mycount\ (it was a Sunday). \end{command} +\begin{command}{\pgfcalendareastersunday\marg{year}\marg{counter}} + This command computes the date of Easter Sunday as a Julian date and stores + it in \meta{counter}. + + \example |\pgfcalendareastersunday{2019}{\mycount}| sets + |\mycount| to + \pgfcalendareastersunday{2019}{\mycount}\the\mycount, which corresponds to + \pgfcalendarjuliantodate{\mycount}{\myyear}{\mymonth}{\myday}% + \edef\isodate{\myyear-\mymonth-\myday}\texttt{\isodate}. +\end{command} \subsubsection{Checking Dates} @@ -198,6 +208,14 @@ This section describes the package |pgfcalendar|. the last day of every month, the test |end of month=2| is passed by the second last day of every month. If \meta{number} is omitted, it is assumed to be |1|. + \itemcalendaroption{Easter}\opt{|=|\meta{number}} This test checks + whether the given date is Easter Sunday. The optional number can + be used for offsets from Easter Sunday, e.g.\ |Easter=-3| for + Maundy Thursday, |Easter=-2| for Good Friday, |Easter=1| for Easter + Monday. Since the dates of other Christian holidays are determined + by the date of easter, these can be accessed as well, e.g.\ + |Easter=39| for Feast of the Ascension, |Easter=49| for Pentecost, + and |Easter=50| for Whit Monday. \end{itemize} In addition to the above checks, you can also define new checks. To do so, diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex index a8ddbd9194a..8ae0628b367 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex @@ -359,6 +359,19 @@ This section describes the package |pgffor|, which is loaded automatically by \end{codeexample} % \end{key} + + \begin{key}{/pgf/foreach/parse=\marg{boolean} (default false)} + If this key is set to true the upper bound in the loop will be + fed into |\pgfmathparse|. This allows to use complex expressions as + the upper bound. However, the expression must be safe for evaluation + in |\pgfmathparse|. It is known that internal \TeX\ registers can + cause trouble. + % +\begin{codeexample}[] +\foreach \x [parse=true] in {1,...,1.0e+1 - 1}{ \x } +\end{codeexample} + % + \end{key} \end{command} \begin{command}{\breakforeach} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex index bf9bfd8a4a1..70aaf271cab 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex @@ -652,7 +652,7 @@ You can ``slant'' arrow tips using the following key: \subsubsection{Reversing, Halving, Swapping} \label{section-arrow-key-harpoon} -\begin{key}{/pgf/arrow keys/reverse} +\begin{key}{/pgf/arrow keys/reversed} Adding this key to an arrow tip will ``reverse its direction'' so that is points in the opposite direction (but is still at that end of the line where the non-reversed arrow tip would have been drawn; so only the tip is @@ -683,7 +683,7 @@ You can ``slant'' arrow tips using the following key: \tikz [ultra thick] \draw [arrows = {->[harpoon]}] (0,0) -- (1,0); \end{codeexample} % - Unlike the |reverse| key, which all arrows tip kinds support at least in a + Unlike the |reversed| key, which all arrows tip kinds support at least in a basic way, designers of arrow tips really need to take this key into account in their arrow tip code and often a lot of special attention needs to do be paid to this key in the implementation. For this reason, only some diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex index 8ffafad7f54..c3921486e6d 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex @@ -1046,7 +1046,7 @@ which you need. whatever value it had at the beginning of the scope. More precisely, when \tikzname\ encounters |}| on a path, it checks whether at this particular moment the key is set to |true|. If so, the current position reverts to the - value is had when the matching |{| was read. + value it had when the matching |{| was read. % \begin{codeexample}[] \begin{tikzpicture} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex index 1600e6f5378..009660a911d 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex @@ -474,25 +474,20 @@ decorations, not with meta-decorations. which |0pt| by default. Thus, for the |pre| option to have any effect, you also need to set the |pre length| option. % + % TODO: Nesting tikzpictures is NOT supported \begin{codeexample}[] -\begin{tikzpicture} \tikz [decoration={zigzag,pre=lineto,pre length=1cm}] \draw [decorate] (0,0) -- (2,1) arc (90:0:1); -\end{tikzpicture} \end{codeexample} % \begin{codeexample}[] -\begin{tikzpicture} \tikz [decoration={zigzag,pre=moveto,pre length=1cm}] \draw [decorate] (0,0) -- (2,1) arc (90:0:1); -\end{tikzpicture} \end{codeexample} % \begin{codeexample}[] -\begin{tikzpicture} \tikz [decoration={zigzag,pre=crosses,pre length=1cm}] \draw [decorate] (0,0) -- (2,1) arc (90:0:1); -\end{tikzpicture} \end{codeexample} Note that the default |pre| option is |lineto|, not |curveto|. This means @@ -500,17 +495,13 @@ decorations, not with meta-decorations. reasons). Change the |pre| key to |curveto| if you have a curved path. % \begin{codeexample}[] -\begin{tikzpicture} \tikz [decoration={zigzag,pre length=3cm}] \draw [decorate] (0,0) -- (2,1) arc (90:0:1); -\end{tikzpicture} \end{codeexample} % \begin{codeexample}[] -\begin{tikzpicture} \tikz [decoration={zigzag,pre=curveto,pre length=3cm}] \draw [decorate] (0,0) -- (2,1) arc (90:0:1); -\end{tikzpicture} \end{codeexample} % \end{key} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex index 340a5cef081..ac0d0080b64 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex @@ -1387,3 +1387,33 @@ experts and should only be used deep inside clever macros, not on normal paths. \end{codeexample} % \end{command} + + +\subsection{Interacting with the Soft Path subsystem} + +During construction \tikzname\ stores the path internally as a \emph{soft +path}. Sometimes it is desirable to save a path during the stage of +construction, restore it elsewhere and continue using it. There are two keys +to facilitate this operation, which are explained below. To learn more about +the soft path subsystem, refer to section~\ref{section-soft-paths}. + +\begin{key}{/tikz/save path=\meta{macro}} + Save the current soft path into \meta{macro}. +\end{key} + +\begin{key}{/tikz/use path=\meta{macro}} + Set the current path to the soft path stored in \meta{macro}. +\end{key} + +\begin{codeexample}[] +\begin{tikzpicture} + \path[save path=\pathA,name path=A] (0,1) to [bend left] (1,0); + \path[save path=\pathB,name path=B] + (0,0) .. controls (.33,.1) and (.66,.9) .. (1,1); + + \fill[name intersections={of=A and B}] (intersection-1) circle (1pt); + + \draw[blue][use path=\pathA]; + \draw[red] [use path=\pathB]; +\end{tikzpicture} +\end{codeexample} diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex index bce298b285a..01af022c291 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex @@ -585,7 +585,7 @@ that apply to most shapes: Specifies the outer separation in the $y$-direction, only. \end{key} -\begin{key}{/pgf/minimum height=\meta{dimension} (initially 0pt)} +\begin{key}{/pgf/minimum height=\meta{dimension} (initially 1pt)} \keyalias{tikz} This option ensures that the height of the shape (including the inner, but ignoring the outer separation) will be at least \meta{dimension}. Thus, if @@ -602,7 +602,7 @@ that apply to most shapes: % \end{key} -\begin{key}{/pgf/minimum width=\meta{dimension} (initially 0pt)} +\begin{key}{/pgf/minimum width=\meta{dimension} (initially 1pt)} \keyalias{tikz} Same as |minimum height|, only for the width. % @@ -967,7 +967,7 @@ Let us now first have a look at the |text width| command. {This is a\\ demonstration text for\\ alignments.}; \end{codeexample} % - For alignment with line breaking, the same will happen only the + For alignment with line breaking, the same will happen; only the lines will now, additionally, be broken automatically: % \begin{codeexample}[] @@ -1210,7 +1210,7 @@ Since the default anchor is |center|, the default behaviour is to shift the node in such a way that it is centered on the current position. \begin{key}{/tikz/anchor=\meta{anchor name}} - Causes the node to be shifted such that it's anchor \meta{anchor name} lies + Causes the node to be shifted such that its anchor \meta{anchor name} lies on the current coordinate. The only anchor that is present in all shapes is |center|. However, most @@ -1477,7 +1477,7 @@ differently. \end{itemize} % The net effect of all this is that the new node will be placed in - such a way that the distance between is south border and \meta{node + such a way that the distance between its south border and \meta{node name}'s north border is exactly the given distance. % \begin{codeexample}[] @@ -2241,7 +2241,7 @@ syntax: label=3:$3^\circ$, label=2:$2^\circ$, label={[below]180:$180^\circ$}, - label={[centered]135:$115^\circ$}] {my circle}; + label={[centered]135:$135^\circ$}] {my circle}; \end{codeexample} \item One \meta{angle} is special: If you set the \meta{angle} to |center|, then the label will be placed on the center of the main @@ -2371,7 +2371,7 @@ nodes. \subsubsection{The Quotes Syntax} \label{section-label-quotes} -The |label| and |pin| option provide a syntax for creating nodes next to +The |label| and |pin| options provide a syntax for creating nodes next to existing nodes, but this syntax is often a bit too verbose. By including the following library, you get access to an even more concise syntax: @@ -2389,8 +2389,8 @@ slightly more general, see the detailed descriptions later on): \end{quote} % The \meta{options} must be surrounded in curly braces when they contain a -comma, otherwise the curly braces are optional. The may be preceded by an -optional space. +comma, otherwise the curly braces are optional. The \meta{options} may be +preceded by an optional space. When a \meta{string} of the above form is encountered inside the options of a |node|, then it is internally transformed to diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex index c35deca1f82..ace6c5d8827 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex @@ -488,7 +488,7 @@ The second proposition in the Elements is the following: Produce the straight lines \A\E\ and \B\F\ in a straight line with \D\A\ and \D\B. Describe the circle \C\G\H\ with center \B\ and radius \B\C, and again, describe the circle \G\K\L\ with center - \D\ and radius \D\G. + \D\ and radius \D\G. Since the point \B\ is the center of the circle \C\G\H, therefore \B\C\ equals \B\G. Again, since the point \D\ is the center of the |