summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex210
1 files changed, 113 insertions, 97 deletions
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 70aaf271cab..e3e500ae9a2 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
@@ -20,7 +20,7 @@ and you can change the appearance of each of them individually using a special
syntax. The following example is a perhaps slightly ``excessive'' demonstration
of what you can do (you need to load the |arrows.meta| library for it to work):
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending,positioning}}]
\tikz {
\node [circle,draw] (A) {A};
\node [circle,draw] (B) [right=of A] {B};
@@ -93,7 +93,7 @@ Let us start with an introduction to the basics of the |arrows| key:
text |arrows=|.} What happens is that every (otherwise unknown) option that
contains a |-| is interpreted as an arrow specification.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\begin{tikzpicture}
\draw[->] (0,0) -- (1,0);
\draw[>-Stealth] (0,0.3) -- (1,0.3);
@@ -115,7 +115,7 @@ Let us start with an introduction to the basics of the |arrows| key:
Section~\ref{section-arrow-config} below by adding options in square
brackets following the arrow tip kind:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\begin{tikzpicture}
\draw[-{Stealth[red]}] (0,0) -- (1,0);
\end{tikzpicture}
@@ -224,6 +224,7 @@ the setting of the key |tips|:
% Two subpaths, but one is closed: No tips, even though last subpath is open
\tikz [<->] \draw (0,0) circle[radius=2pt] (2,0) -- (3,0);
\end{codeexample}
+ %
\end{key}
One common pitfall when arrow tips are added to a path should be addressed
@@ -283,9 +284,9 @@ loaded.
\subsubsection{Size}
-The most important configuration parameter of an arrow tip is
-undoubtedly its size. The following two keys are the main keys that
-are important in this context:
+The most important configuration parameter of an arrow tip is undoubtedly its
+size. The following two keys are the main keys that are important in this
+context:
\begin{key}{/pgf/arrow keys/length=\meta{dimension}| |\opt{\meta{line width factor}}%
| |\opt{\meta{outer factor}}}
@@ -295,19 +296,19 @@ are important in this context:
distance from the ``very tip'' of the arrow to its ``back end'' along the
line:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz{
\draw [-{Stealth[length=5mm]}] (0,0) -- (2,0);
\draw [|<->|] (1.5,.4) -- node[above=1mm] {5mm} (2,.4);
}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz{
\draw [-{Latex[length=5mm]}] (0,0) -- (2,0);
\draw [|<->|] (1.5,.4) -- node[above=1mm] {5mm} (2,.4);
}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz{
\draw [-{Classical TikZ Rightarrow[length=5mm]}] (0,0) -- (2,0);
\draw [|<->|] (1.5,.6) -- node[above=1mm] {5mm} (2,.6);
@@ -354,15 +355,15 @@ are important in this context:
resulting length is 3pt. Finally, for the middle case, the ``middle''
between 5pt and 1pt is 3pt, so the length is 9pt.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [line width=1pt, double distance=3pt,
arrows = {-Latex[length=0pt 3 0]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [line width=1pt, double distance=3pt,
arrows = {-Latex[length=0pt 3 .5]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [line width=1pt, double distance=3pt,
arrows = {-Latex[length=0pt 3 1]} ] (0,0) -- (1,0);
\end{codeexample}
@@ -384,7 +385,7 @@ are important in this context:
``pixel''. Thus, the thickness of the stroked line and also the
miter ends should be taken into account:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz{
\draw [line width=1mm, -{Stealth[length=10mm, open]}]
(0,0) -- (2,0);
@@ -399,7 +400,7 @@ are important in this context:
This creates some ``visual consistency'' if the two modes are
mixed or if you later one change the mode.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz{
\draw [line width=1mm, -{Stealth[length=10mm, open, round]}]
(0,0) -- (2,0);
@@ -423,10 +424,10 @@ are important in this context:
the two optional factor numbers following the \meta{dimension} is the same
as for the |length| key.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Latex[width=10pt, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Latex[width=0pt 10, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
\end{key}
@@ -456,10 +457,10 @@ length = 10pt, width'=5pt 2, length=7pt
the resulting width will be $19\mathrm{pt} = 5\mathrm{pt} + 2\cdot
7\mathrm{pt}$.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Latex[width'=0pt .5, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Latex[width'=0pt .5, length=15pt]}] (0,0) -- (1,0);
\end{codeexample}
%
@@ -480,10 +481,10 @@ length = 10pt, width'=5pt 2, length=7pt
line width, where the line width is computed based on the \meta{outer
factor} as described for the |length| key.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Stealth[length=10pt, inset=5pt]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Stealth[length=10pt, inset=2pt]}] (0,0) -- (1,0);
\end{codeexample}
@@ -509,10 +510,10 @@ length = 10pt, width'=5pt 2, length=7pt
optional factors are given, they add a certain multiple of the line width
to the \meta{dimension} before the sine and cosines are computed.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Stealth[inset=0pt, angle=90:10pt]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Stealth[inset=0pt, angle=30:10pt]}] (0,0) -- (1,0);
\end{codeexample}
%
@@ -523,11 +524,11 @@ length = 10pt, width'=5pt 2, length=7pt
the arrow length. This results in an arrow tip with an opening angle of
\meta{angle} at its tip and with the specified |length| unchanged.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Stealth[inset=0pt, length=10pt, angle'=90]}]
(0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Stealth[inset=0pt, length=10pt, angle'=30]}]
(0,0) -- (1,0);
\end{codeexample}
@@ -550,7 +551,7 @@ keys are useful:
size parameters defined by special-purpose arrow tip kinds). Everything is
simply scaled by the given \meta{factor}.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [arrows = {-Stealth[]}] (0,1) -- (1,1);
\draw [arrows = {-Stealth[scale=1.5]}] (0,0.5) -- (1,0.5);
@@ -571,7 +572,7 @@ keys simultaneously):
``along the axis of the arrow'', that is, to the length and to the inset,
but not to the width.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [arrows = {-Stealth[]}] (0,1) -- (1,1);
\draw [arrows = {-Stealth[scale length=1.5]}] (0,0.5) -- (1,0.5);
@@ -584,7 +585,7 @@ keys simultaneously):
\begin{key}{/pgf/arrows keys/scale width=\meta{factor} (initially 1)}
Like |scale length|, but for dimensions related to the width.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [arrows = {-Stealth[]}] (0,1) -- (1,1);
\draw [arrows = {-Stealth[scale width=1.5]}] (0,0.5) -- (1,0.5);
@@ -606,7 +607,7 @@ these arrow tips, you use the following key:
setting the length and width''. In contrast, the |arc| key is used to set
the degrees of arcs that are part of an arrow tip:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] {
\draw [arrows = {-Hooks[]}] (0,1) -- (1,1);
\draw [arrows = {-Hooks[arc=90]}] (0,0.5) -- (1,0.5);
@@ -625,7 +626,7 @@ You can ``slant'' arrow tips using the following key:
Slanting is used to create an ``italics'' effect for arrow tips: All arrow
tips get ``slanted'' a little bit relative to the axis of the arrow:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [arrows = {->[]}] (0,1) -- (1,1);
\draw [arrows = {->[slant=.5]}] (0,0.5) -- (1,0.5);
@@ -641,7 +642,7 @@ You can ``slant'' arrow tips using the following key:
Here is another example where slanting is used to match italic text:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,graphs}}]
\tikz [>={[slant=.3] To[] To[]}]
\graph [math nodes] { A -> B <-> C };
\end{codeexample}
@@ -665,10 +666,10 @@ You can ``slant'' arrow tips using the following key:
If you apply this key twice, the effect cancels, which is useful for the
definition of shorthands (which will be discussed later).
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {-Stealth[reversed]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {-Stealth[reversed, reversed]}] (0,0) -- (1,0);
\end{codeexample}
\end{key}
@@ -676,10 +677,10 @@ You can ``slant'' arrow tips using the following key:
\begin{key}{/pgf/arrow keys/harpoon}
The key requests that only the ``left half'' of the arrow tip should drawn:
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {->[harpoon]}] (0,0) -- (1,0);
\end{codeexample}
%
@@ -695,10 +696,10 @@ You can ``slant'' arrow tips using the following key:
only for asymmetric arrow tips like the harpoons created using the
|harpoon| option.
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon,swap]}] (0,0) -- (1,0);
\end{codeexample}
%
@@ -713,10 +714,10 @@ You can ``slant'' arrow tips using the following key:
\begin{key}{/pgf/arrow keys/right}
A shorthand for |harpoon, swap|.
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {-Stealth[left]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [arrows = {-Stealth[right]}] (0,0) -- (1,0);
\end{codeexample}
%
@@ -743,10 +744,10 @@ The following options allow you to configure how arrow tips are colored:
this default draw color of the path. Since this is the default behaviour,
you usually do not need to specify anything:
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [red, arrows = {-Stealth}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [blue, arrows = {-Stealth}] (0,0) -- (1,0);
\end{codeexample}
@@ -754,10 +755,10 @@ The following options allow you to configure how arrow tips are colored:
arrow tip should get this color \emph{instead} of the color of the main
path:
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [red, arrows = {-Stealth[color=blue]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [red, arrows = {-Stealth[color=black]}] (0,0) -- (1,0);
\end{codeexample}
@@ -767,7 +768,7 @@ The following options allow you to configure how arrow tips are colored:
key is the name of a color and, if so, execute |color=|\meta{arrow key}.
So, the first of the above examples can be rewritten as follows:
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [red, arrows = {-Stealth[blue]}] (0,0) -- (1,0);
\end{codeexample}
@@ -781,7 +782,7 @@ The following options allow you to configure how arrow tips are colored:
fill the arrow tips, even if a different color is specified for filling the
path:
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [draw=red, fill=red!50, arrows = {-Stealth[length=10pt]}]
(0,0) -- (1,1) -- (2,0);
\end{codeexample}
@@ -800,7 +801,7 @@ The following options allow you to configure how arrow tips are colored:
This color can be different from the color used to draw (stroke) the arrow
tip:
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [help lines] (0,-.5) grid [step=1mm] (1,.5);
\draw [thick, red, arrows = {-Stealth[fill=white,length=15pt]}] (0,0) -- (1,0);
@@ -810,7 +811,7 @@ The following options allow you to configure how arrow tips are colored:
You can also specify the special ``color'' |none|. In this case, the arrow
tip is not filled at all (not even with white):
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [help lines] (0,-.5) grid [step=1mm] (1,.5);
\draw [thick, red, arrows = {-Stealth[fill=none,length=15pt]}] (0,0) -- (1,0);
@@ -830,7 +831,7 @@ The following options allow you to configure how arrow tips are colored:
come first since it will reset the filling to the color specified for
drawing.
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [help lines] (0,-.5) grid [step=1mm] (1,.5);
\draw [thick, red, arrows = {-Stealth[color=blue, fill=white, length=15pt]}]
@@ -843,7 +844,7 @@ The following options allow you to configure how arrow tips are colored:
path. (This special color is always available and always set to the current
filling color of the graphic state.):
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [ultra thick] \draw [draw=red, fill=red!50,
arrows = {-Stealth[length=15pt, fill=pgffillcolor]}]
(0,0) -- (1,1) -- (2,0);
@@ -878,22 +879,22 @@ arrow tip:
it will have an effect on where the exact ``tip'' of the arrow is since
this will always be exactly at the end of the arrow:
%
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[line cap=butt]}]
(0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[line cap=round]}]
(0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,line cap=butt]}]
(0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,line cap=round]}]
(0,0) -- (1,0);
@@ -906,22 +907,22 @@ arrow tip:
the key only has an effect on paths that have ``corners'' in them. The same
rules as for |line cap| apply: the size is not affects, but the tip end is:
%
- \begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[line join=miter]}]
(0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[line join=round]}]
(0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,line join=miter]}]
(0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,line join=round]}]
(0,0) -- (1,0);
@@ -935,11 +936,11 @@ The following keys set both of the above:
A shorthand for |line cap=round, line join=round|, resulting in ``rounded''
arrow heads.
%
- \begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[round]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,round]}] (0,0) -- (1,0);
\end{codeexample}
@@ -949,11 +950,12 @@ The following keys set both of the above:
\begin{key}{/pgf/arrow keys/sharp}
A shorthand for |line cap=butt, line join=miter|, resulting in ``sharp'' or
``pointed'' arrow heads.
- \begin{codeexample}[width=3cm]
+ %
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[sharp]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=3cm]
+\begin{codeexample}[width=3cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,sharp]}] (0,0) -- (1,0);
\end{codeexample}
@@ -972,10 +974,10 @@ You can also set the width of lines used inside arrow tips:
The meaning of the factors is as usual the same as for |length| or |width|.
%
-\begin{codeexample}[width=2cm]
+\begin{codeexample}[width=2cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Latex[line width=0.1pt, fill=white, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[width=2cm]
+\begin{codeexample}[width=2cm,preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [arrows = {-Latex[line width=1pt, fill=white, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
%
@@ -998,7 +1000,7 @@ To get a feeling for the difficulties involved, consider the following
situation: We have a ``gray wall'' at the $x$-coordinate of and a red line that
ends in its middle.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{patterns}}]
\def\wall{ \fill [fill=black!50] (1,-.5) rectangle (2,.5);
\pattern [pattern=bricks] (1,-.5) rectangle (2,.5);
\draw [line width=1pt] (1cm+.5pt,-.5) -- ++(0,1); }
@@ -1012,10 +1014,13 @@ ends in its middle.
Now we wish to add a blue open arrow tip the red line like, say,
|Stealth[length=1cm,open,blue]|:
%
+\begin{codeexample}[setup code,hidden]
+\usetikzlibrary{patterns}
\def\wall{ \fill [fill=black!50] (1,-.5) rectangle (2,.5);
\pattern [pattern=bricks] (1,-.5) rectangle (2,.5);
\draw [line width=1pt] (1cm+.5pt,-.5) -- ++(0,1); }
-\begin{codeexample}[]
+\end{codeexample}
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\begin{tikzpicture}
\wall
\draw [red,line width=1mm,-{Stealth[length=1cm,open,blue]}]
@@ -1086,7 +1091,7 @@ way (although the option for selecting this option is politely just called
same amount to ensure that the line still has the same tangent at the end.
This will result in the following:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1153,7 +1158,7 @@ you need to load the following library:
original line ended. Then, the arrow is rotated so the \emph{the
visual end lies on the line}:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1183,7 +1188,7 @@ you need to load the following library:
|flex=.5| will rotate the arrow's visual end ``halfway away from the
tangent towards the actual position on the line''.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1191,7 +1196,7 @@ you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1204,7 +1209,7 @@ you need to load the following library:
arrow tip. Open arrow tips do not go well with a flex value other than~|1|.
Here is a more realistic use of the |flex=0| key:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1216,7 +1221,7 @@ you need to load the following library:
If there are several arrow tips on a path, the |flex| option positions them
independently, so that each of them lies optimally on the path:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1235,7 +1240,7 @@ you need to load the following library:
distance of |6.25mm| from the tip lie on the path, we have the point at a
distance of |1cm| from the tip lie on the path:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1251,7 +1256,7 @@ you need to load the following library:
but rather with tips like the standard |>| in the context of a strongly
curved line:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1269,7 +1274,7 @@ you need to load the following library:
that it should be rotated. This is exactly what the |flex'| option does
since it allows us to align the ``back end'' of the tip with the red line:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1294,7 +1299,7 @@ you need to load the following library:
tips. On the other hand, for most arrow tips their bend version are
visually quite pleasing and create a sophisticated look:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1302,7 +1307,7 @@ you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1310,7 +1315,7 @@ you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\begin{tikzpicture}
\wall
\draw [red!25,line width=1mm] (-1,0) -- (1,0);
@@ -1320,6 +1325,9 @@ you need to load the following library:
\end{codeexample}
%
\end{key}
+% TODOsp: codeexamples: `bending` library is needed up to here
+% TODOsp: codeexamples: `\def\wall` + `patterns` library are needed up to here
+% TODOsp: codeexamples: `arrows.meta` library needed up to here
\subsection{Arrow Tip Specifications}
@@ -1475,7 +1483,7 @@ following arrow key is important:
Let us now have a look at some examples. First, we use two arrow tips with
different separations between them:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\draw [-{>[sep=1pt]>[sep= 2pt]>}] (0,1.0) -- (1,1.0);
\draw [-{>[sep=1pt]>[sep=-2pt]>}] (0,0.5) -- (1,0.5);
@@ -1489,7 +1497,7 @@ following arrow key is important:
but will rather leave the specified amount of space. This is usually quite
desirable.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,positioning}}]
\tikz {
\node [draw] (A) {A};
\node [draw] (B) [right=of A] {B};
@@ -1550,7 +1558,7 @@ the first one ``wins'' (for end specifications, otherwise the last one).
Note that |.| is parsed as any other shorthand. In particular, if you wish to
add a dot after a normal arrow tip kind name, you need to add brackets:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz [very thick] \draw [-{Stealth[] . Stealth[] Stealth[]}] (0,0) -- (2,0);
\end{codeexample}
%
@@ -1583,11 +1591,11 @@ done using the following handler:
keys inside the \meta{end specification} are translated automatically.
\todosp{remaining instance of bug \#473}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz [foo /.tip = {Stealth[sep]. >>}]
\draw [-foo] (0,0) -- (2,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz [foo /.tip = {Stealth[sep] Latex[sep]},
bar /.tip = {Stealth[length=10pt,open]}]
\draw [-{foo[red] . bar}] (0,0) -- (2,0);
@@ -1633,7 +1641,7 @@ done using the following handler:
\begin{codeexample}[]
\tikz \draw [>->] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [Stealth-Stealth] (0,0) -- (1,0);
\end{codeexample}
%
@@ -1651,10 +1659,10 @@ done using the following handler:
start specifications}|-|\meta{name in end specifications}. Thus, to set the
|>| key correctly, you actually need to write
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz [<-> /.tip = Stealth] \draw [<->>] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz [<-> /.tip = Latex] \draw [>-<] (0,0) -- (1,0);
\end{codeexample}
@@ -1673,14 +1681,14 @@ done using the following handler:
By default, |>| is a shorthand for |To| and |To| is a shorthand for |to|
(an arrow from the old libraries) when |arrows.meta| is not loaded library.
- When |arrow.meta| is loaded, |To| is redefined to mean the same as
+ When |arrows.meta| is loaded, |To| is redefined to mean the same as
|Computer Modern Rightarrow|.
\end{handler}
\begin{key}{/tikz/>=\meta{end arrow specification}}
This is a short way of saying |<->/.tip=|\meta{end arrow specification}.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\begin{tikzpicture}[scale=2,ultra thick]
\begin{scope}[>=Latex]
\draw[>->] (0pt,3ex) -- (1cm,3ex);
@@ -1695,6 +1703,14 @@ done using the following handler:
%
\end{key}
+\begin{key}{/tikz/shorten <=\meta{length}}
+ Shorten the path by \meta{length} in the direction of the starting point.
+\end{key}
+
+\begin{key}{/tikz/shorten >=\meta{length}}
+ Shorten the path by \meta{length} in the direction of the end point.
+\end{key}
+
\subsubsection{Scoping of Arrow Keys}
\label{section-arrow-scopes}
@@ -1835,7 +1851,7 @@ classified in different groups:
difference is that the background will ``shine through'' an open
arrow, while a filled arrow always obscures the background:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz {
\shade [left color=white, right color=red!50] (0,0) rectangle (4,1);
@@ -1911,7 +1927,7 @@ classified in different groups:
\end{arrowtipsimple}
\begin{arrowtip}{Bracket}{
- This is an instance of the |Tee Barb| arrow tip that results in something
+ This is an instance of the |Tee Barb| \todosp{no space shown here} arrow tip that results in something
resembling a bracket. Just like the |Parenthesis| arrow tip, a |Bracket| is
not modelled from a text square bracket, but rather its size has been
chosen so that it fits with the other arrow tips.
@@ -1973,7 +1989,7 @@ classified in different groups:
\end{arrowtip}
\begin{arrowtip}{Parenthesis}{
- This arrow tip is an instantiation of the |Arc Barb| so that it resembles a
+ This arrow tip is an instantiation of the |Arc Barb| \todosp{no space shown here} so that it resembles a
parenthesis. However, the idea is not to recreate a ``real'' parenthesis as
it is used in text, but rather a ``bow'' at a size that harmonizes with the
other arrow tips at their default sizes.
@@ -2107,7 +2123,7 @@ classified in different groups:
like \texttt{\string\rightarrow} ($\to$) of the Computer Modern math fonts.
However, it is not a ``perfect'' match: the line caps and joins of the
``real'' $\to$ are rounded differently from this arrow tip; but it takes a
- keen eye to notice the difference. When the |arrow.meta| library is loaded,
+ keen eye to notice the difference. When the |arrows.meta| library is loaded,
this arrow tip becomes the default of |To| and, thus, is used whenever |>|
is used (unless, of course, you redefined |>|).
}%
@@ -2138,7 +2154,7 @@ classified in different groups:
like \TeX's \texttt{\string\implies} arrow ($\implies$). A typical use of
this arrow tip is
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,graphs}}]
\tikz \graph [clockwise=3, math nodes,
edges = {double equal sign distance, -Implies}] {
"\alpha", "\beta", "\gamma";
@@ -2153,7 +2169,7 @@ classified in different groups:
\end{arrowtipsimple}
\begin{arrowtipsimple}{To}
- This is a shorthand for |Computer Modern Rightarrow| when the |arrow.meta|
+ This is a shorthand for |Computer Modern Rightarrow| when the |arrows.meta|
library is loaded. Otherwise, it is a shorthand for the classical
\tikzname\ rightarrow.
\end{arrowtipsimple}
@@ -2382,7 +2398,7 @@ different caps for the end and the start.
happens to differ from the normal cap. In the following example, the line
cap is ``round'', but, nevertheless, the right end is a ``butt'' cap:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [line width=1ex, line cap=round, -Butt Cap] (0,0) -- (1,0);
\end{codeexample}
%
@@ -2399,7 +2415,7 @@ different caps for the end and the start.
{length=5mm,inset=-1cm}%
{-15mm}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [line width=1ex,
-{Round Cap []. Fast Round[] Fast Round[]}]
(0,0) -- (1,0);
@@ -2408,7 +2424,7 @@ different caps for the end and the start.
Note that in conjunction with the |bend| option, this works even quite well
for curves:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\tikz [f/.tip = Fast Round] % shorthand
\draw [line width=1ex, -{[bend] Round Cap[] . f f f}]
(0,0) to [bend left] (1,0);
@@ -2431,7 +2447,7 @@ different caps for the end and the start.
{length=5mm,inset=-1cm}%
{-15mm}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\tikz \draw [line width=1ex,
-{Triangle Cap []. Fast Triangle[] Fast Triangle[]}]
(0,0) -- (1,0);
@@ -2439,7 +2455,7 @@ different caps for the end and the start.
%
Again, this tip works well for curves:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,bending}}]
\tikz [f/.tip = Fast Triangle] % shorthand
\draw [line width=1ex, -{[bend] Triangle Cap[] . f f f}]
(0,0) to [bend left] (1,0);