summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex104
1 files changed, 70 insertions, 34 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
index 5df4c13b6bb..c40d308b3f4 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
@@ -38,7 +38,7 @@ path is stroked or filled.
\subsubsection{Creating and Referencing Nodes}
You create a node by calling the macro |\pgfnode| or the more general
-|\pgfmultipartnode|. These macro takes several parameters and draws
+|\pgfmultipartnode|. This macro takes several parameters and draws
the requested shape at a certain position. In addition, it will
``remember'' the node's position within the current
|{pgfpicture}|. You can then, later on, refer to the
@@ -46,7 +46,7 @@ node's position. Coordinate transformations are ``fully supported,''
which means that if you used coordinate transformations to shift or
rotate the shape of a node, the node's position will still be correctly
determined by \pgfname. This is \emph{not} the case if you use canvas
-transformations, instead.
+transformations instead.
\subsubsection{Anchors}
@@ -81,7 +81,7 @@ The simplest shape, the |coordinate|, has just one anchor, namely the
shapes like the |rectangle| shape also have a \emph{background
path}. This is a \pgfname-path that is defined by the shape. The
shape does not prescribe what should happen with the path: When a node
-is created this path may be stroked (resulting in a frame around the
+is created, this path may be stroked (resulting in a frame around the
label), filled (resulting in a background color for the text), or just
discarded.
@@ -91,12 +91,12 @@ text, when a shape is drawn, up to seven different layers are drawn:
\begin{enumerate}
\item
The ``behind the background layer.'' Unlike the background path,
- which be used in different ways by different nodes, the graphic
+ which can be used in different ways by different nodes, the graphic
commands given for this layer will always stroke or
always fill the path they construct. They might also insert some
text that is ``behind everything.''
\item
- The background path layer. How this path is used depends on how the
+ The background path layer. How this path is used depends on the
arguments of the |\pgfnode| command.
\item
The ``before the background path layer.'' This layer works like the
@@ -111,7 +111,7 @@ text, when a shape is drawn, up to seven different layers are drawn:
executed.''
\item
The foreground path layer. This path is treated in the same way as the
- background path, only it is drawn only after the label text has been
+ background path, only it is drawn after the label text has been
drawn.
\item
The ``before the foreground layer.''
@@ -142,8 +142,8 @@ multipart nodes: They only have one part named |text|.
When a shape is declared, you must specify the node parts. There is a
simple command called |\nodeparts| that takes a list of the part names
as input. When you create a node of a multipart shape, for each part
-of the node you must have setup a \TeX-box containing the text of the
-part. For a part named |XYZ| you must setup the box
+of the node you must have set up a \TeX-box containing the text of the
+part. For a part named |XYZ| you must set up the box
|\pgfnodepartXYZbox|. The box will be placed at the anchor |XYZ|. See
the description of |\pgfmultipartnode| for more details.
@@ -225,9 +225,9 @@ the description of |\pgfmultipartnode| for more details.
shapes), this command can also be used with multi-part nodes.
When this command is called, for each node part of the node you must
- have setup one \TeX-box. Suppose the shape has two parts: The |text|
+ have set up one \TeX-box. Suppose the shape has two parts: The |text|
part and the |lower| part. Then, prior to calling
- |\pgfmultipartnode|, you must have setup the boxes
+ |\pgfmultipartnode|, you must have set up the boxes
|\pgfnodeparttextbox| and |\pgfnodepartlowerbox|. These boxes may
contain any \TeX-text. The shape code will then compute the
positions of the shape's anchors based on the sizes of the these
@@ -253,7 +253,7 @@ the description of |\pgfmultipartnode| for more details.
part name. Although you need a different box for each part of a
single shape, two different shapes may very well use the same box
even when the names of the parts are different. Suppose you have a
- |circle split| shape that has an |lower| part and you have a
+ |circle split| shape that has a |lower| part and you have a
|uml class| shape that has a |methods| part. Then, in order to avoid
exhausting \TeX's limited number of box registers, you can say
\begin{codeexample}[code only]
@@ -389,11 +389,12 @@ node. These values are stored in the following keys.
\subsubsection{Deferred Node Positioning}
+\label{section-shapes-deferred-node-positioning}
Normally, when a node is created using a command like |\pgfnode|, the
node is immediately inserted into the current picture. In particular,
you have no chance to change the position of a created node after it
-has been create. Using |\pgfpositionnodelater| in concert with
+has been created. Using |\pgfpositionnodelater| in concert with
|\pgfpositionnodenow|, you can create a node whose position is
determined only at some later time.
@@ -406,7 +407,7 @@ determined only at some later time.
node is not relevant for the picture's bounding box, but a bounding
box for the node is computed and stored in the macros
|\pgfpositionnodelaterminx| to |\pgfpositionnodelatermaxy|. Then,
- the \meta{macro name} is called with the following macros setup:
+ the \meta{macro name} is called with the following macros set up:
\begin{command}{\pgfpositionnodelaterbox}
A box register number (|0| currently) that stores the node's paths
@@ -416,9 +417,9 @@ determined only at some later time.
\begin{command}{\pgfpositionnodelatername}
The name of the just-created-node. This name will be the
- originally "desired" name of the box plus the fixed prefix
- |not yet positioned@|. The idea is to ensure that the original
- name is not inadvertently used before the node is actually
+ originally ``desired'' name of the box plus the fixed prefix
+ |not yet positionedPGFINTERNAL|. The idea is to ensure that the
+ original name is not inadvertently used before the node is actually
positioned. When |\pgfpositionnodenow| is called, it will change
the name to the original name.
\end{command}
@@ -426,7 +427,8 @@ determined only at some later time.
\begin{command}{\pgfpositionnodelaterminx}
The minimal $x$-position of a bounding box of the node. This
bounding box refers to the node when it is positioned with the
- anchor at the origin.
+ anchor at the origin. It is guaranteed, that this macro will
+ contain a dimension in the format \meta{number}|pt|.
\end{command}
\begin{command}{\pgfpositionnodelaterminy}
\end{command}
@@ -443,6 +445,17 @@ determined only at some later time.
above macros are local to a scope that ends right after the call to
\meta{macro name}, so it is your job to copy the values to safety
inside \meta{macro name}.
+
+ The following two macros will also be set inside the call to
+ \meta{macro name}, but they are only ``informative'' in the sense
+ that you need \emph{not} restore these macros when
+ |\pgfpositionnodenow| is called.
+
+ \begin{command}{\pgfpositionnodelaterpath}
+ This macro stores the path of the background of the node. See
+ Section~\ref{section-soft-paths} for an overview of how these
+ paths are encode.
+ \end{command}
By setting \meta{macro name} to |\relax| (which is the default), you
can switch off the whole mechanism. When a picture is interrupted,
@@ -452,12 +465,13 @@ determined only at some later time.
\begin{command}{\pgfpositionnodenow\marg{coordinate}}
This command is used to position a node that has previously been
- created with |\pgfpositionnodelater|. When |\pgfpositionnodenow| is
+ created using the command |\pgfpositionnodelater|. When |\pgfpositionnodenow| is
called, the macros and boxes mentioned in the description of
|\pgfpositionnodenow| must be set to the value they had when the
\meta{macro name} was called. Provided this is the case, this
command will insert the box into the current picture, shifted by
- \meta{coordinate}. Subsequently, you can refer to the node with its
+ \meta{coordinate}. Then, the late code (see below)
+ is called. Subsequently, you can refer to the node with its
original name as if it had just been created.
\begin{codeexample}[]
@@ -493,6 +507,22 @@ determined only at some later time.
\end{command}
+\begin{command}{\pgfnodepostsetupcode\marg{node name}\marg{code}}
+ When you call this macro inside a scope for which the
+ |\pgfpositionnodelater| has been called, the \meta{code} will be
+ stored internally. Later, when the node named \meta{node name} is
+ actually positioned using |\pgfpositionnodenow|, the \meta{code}
+ will be executed. When this macro is called multiple times with the
+ same \meta{node name}, the \meta{code} accumulates. However, When
+ |\pgfpositionnodenow| is called, the code stored for the node is
+ cleared.
+
+ The main purpose of this mechanism is to allow \tikzname\ to store
+ so-called ``late options'' with a node that will be positioned only
+ later.
+\end{command}
+
+
\subsection{Using Anchors}
Each shape defines a set of anchors. We saw already that the anchors
@@ -568,9 +598,9 @@ following commands:
A special situation arises when the \meta{node} lies in a picture
different from the current picture. In this case, if you have not
told \pgfname\ that the picture should be ``remembered,'' the
- \meta{node} will be treated as if it lied in the current
+ \meta{node} will be treated as if it lay in the current
picture. For example, if the \meta{node} was at position $(3,2)$ in
- the original picture, it is treated as if it lied at position
+ the original picture, it is treated as if it lay at position
$(3,2)$ in the current picture. However, if you have told \pgfname\
to remember the picture position of the node's picture and also of
the current picture,
@@ -625,7 +655,7 @@ not-so-easy. Because of this, \pgfname\ does not do so
automatically. Rather, you have to proceed as follows:
\begin{enumerate}
\item You have to use a backend driver that supports position
- tracking. pdf\TeX\ is one such drivers, |dvips| currently is not.
+ tracking. pdf\TeX\ is one such driver, |dvips| currently is not.
\item You have to say |\pgfrememberpicturepositiononpagetrue|
somewhere before or inside every picture
\begin{itemize}
@@ -670,6 +700,12 @@ should not attempt to redefine.
bounding box of the current path.
\end{predefinednode}
+\begin{predefinednode}{current subpath start}
+ This node is of shape |coordinate| and is at the beginning of the
+ current subpath. This is the position of the last move-to
+ operation.
+\end{predefinednode}
+
\begin{predefinednode}{current page}
This node is inside a virtual remembered picture. The size of this
node is the size of the current page. This means that if you create
@@ -769,7 +805,7 @@ In order to define a new shape, you must provide:
\subsubsection{Normal Anchors Versus Saved Anchors}
-Anchors are special places in shape. For example, the |north east|
+Anchors are special places in a shape. For example, the |north east|
anchor, which is a normal anchor, lies at the upper right corner of
the |rectangle| shape, as does |\northeast|, which is a saved
anchor. The difference is the following: \emph{saved anchors are
@@ -782,7 +818,7 @@ The idea behind all this is that a shape can declare a very large
number of normal anchors, but when a node of this shape is created,
these anchors are not actually computed. However, this causes a
problem: When we wish to reference an anchor of a node at some later
-time, we must still able to compute the position of the anchor. For
+time, we must still be able to compute the position of the anchor. For
this, we may need a lot of information: What was the transformation
matrix that was in force when the node was created? What was the size
of the text box? What were the values of the different separation
@@ -791,7 +827,7 @@ dimensions? And so on.
To solve this problem, \pgfname\ will always compute the locations of
all \emph{saved anchors} and store these positions. Then, when an
normal anchor position is requested later on, the anchor position can
-be given just from knowing where the locations of the saved anchors.
+be given just from knowing where the locations of the saved anchors are.
As an example, consider the |rectangle| shape. For this shape two
anchors are saved: The |\northeast| corner and the |\southwest|
@@ -856,13 +892,13 @@ The following command declares a new shape:
By default, a shape has just one node part called |text|. However,
there can be several node parts. For example, the
|circle split| shape has two parts: the |text| part, which
- shows that upper text, and a |lower| part, which shows the
+ shows that the upper text, and a |lower| part, which shows the
lower text. For the |circle split| shape the |\nodeparts| command
was called with the argument |{text,lower}|.
When a multipart node is created, the text labels are drawn in the
sequences listed in the \meta{list of node parts}. For each node
- part there you must have declared one anchor and the \TeX-box of
+ part, you must have declared one anchor and the \TeX-box of
the part is placed at this anchor. For a node part called |XYZ|
the \TeX-box |\pgfnodepartXYZbox| is placed at anchor |XYZ|.
\end{command}
@@ -877,7 +913,7 @@ The following command declares a new shape:
is executed, the \TeX-boxes of the node parts will contain the
text labels of the node. Possibly, these box are void. For
example, if there is just a |text| part, the node
- |\pgfnodeparttextbox| will be setup when the \meta{code} is
+ |\pgfnodeparttextbox| will be set up when the \meta{code} is
executed.
The \meta{code} can use the width, height, and depth of the
@@ -1029,9 +1065,9 @@ The following command declares a new shape:
creation is applied automatically to the coordinates returned by
the anchor's \meta{code}.
- Out |simple rectangle| only has one text label (node
- part) called |text|. This is the default situation, so we need not
- do anything. For the |text| node part we must setup a |text|
+ Our |simple rectangle| only has one text label (node
+ part) called |text|. This is the default situation, so we do not need to
+ do anything. For the |text| node part we must set up a |text|
anchor. This anchor is used upon creation of a node to determine
the lower left corner of the text label (within the private
coordinate system of the shape). By default, the |text| anchor is
@@ -1095,12 +1131,12 @@ The following command declares a new shape:
shape. What exactly is considered as the ``border'' of the shape
depends on the shape.
- When the user request a point on the border of the shape using the
+ When the user requests a point on the border of the shape using the
|\pgfpointshapeborder| command, the \meta{code} will be executed
to discern this point. When the execution of the \meta{code}
starts, the dimensions |\pgf@x| and |\pgf@y| will have been set to
a location $p$ in the shape's coordinate system. It is now the job of
- the \meta{code} to setup |\pgf@x| and |\pgf@y| such that they
+ the \meta{code} to set up |\pgf@x| and |\pgf@y| such that they
specify the point on the shape's border that lies on a straight
line from the shape's center to the point $p$. Usually, this is a
somewhat complicated computation, involving many case distinctions
@@ -1255,7 +1291,7 @@ The following command declares a new shape:
}\hskip-1.2cm
\begin{tikzpicture}
\node[shade,draw,shape=document,inner sep=2ex] (x) {Remark};
- \node[fill=examplefill,draw,ellipse,double]
+ \node[fill=yellow!80!black,draw,ellipse,double]
at ([shift=(-80:3cm)]x) (y) {Use Case};
\draw[dashed] (x) -- (y);