summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tikz-ext/tikz-ext-manual-en-pgf-arrows.tex
blob: d330360ed6e3fecd4dd5b00080460ad729ed3d22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
% !TeX spellcheck = en_US
% !TeX root = tikz-ext-manual.tex
% Copyright 2023 by Qrrbrbirlbel
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%

\section{Arrow Tips}
\label{pgflibrary:arrows}
\tikzset{external/export/.try=false}%
\begin{pgflibrary}{ext.arrows}
  This library adds arrows to \pgfname/\tikzname.
  
  \inspiration{ArrowLoop-Q,ArrowHug-Q,ArrowUntipped1-Q,ArrowUntipped2-Q}
              {ArrowLoop-A,ArrowHug-A,ArrowUntipped1-A,ArrowUntipped2-A}
\end{pgflibrary}
\begin{multicols}{2}
The arrow tips of the \referenceLibraryandIndexO{arrows.meta} library always
just touch the end of original line -- which is usually
what you want.

But for some arrow tips (and when they lie along a path) it makes sense
that these tips shoot a bit over the end of the line.
This is why these arrow tips exist.
They can be categorized into three groups:
\begin{enumerate}
\item Centered
\item Untipped
\item Overtipped\footnote{The Overtipped arrow tips aren't yet implemented.}
\end{enumerate}
Not all original arrow tips got all variants.
For a summary, refer to table on the right side.
As with the original tips of the \referenceLibraryandIndexO{arrows.meta} library
these can be organized in the following categories.
\newcolumn
\begin{center}
\newcommand*\tip[2][]{%
  \tikzset{external/export/.try=false}%
  \tikz[arrows={#2 \arrowtiprow[reversed] - \arrowtiprow[sep] . #2 \arrowtiprow[]}, baseline=+-.5ex,
    trim left=+-3mm, trim right=+13mm]
    \draw[line width=+.5mm, postaction={draw, gray, thin,-}] (0,0) -- + (right:1);%
}%
\def\tiprow#1 &{#1\gdef\arrowtiprow{#1} &}%
\def\Tiprow#1 &{\quad#1\gdef\arrowtiprow{#1} &}%
%\centering
%\caption{Variants of the original \texttt{arrows.meta} arrow tips.
%  For each example, the order is 1. reversed variant, 2. original, 3. variant.
%  They gray line shows where the path actually ends.
%}\label{tab:tips}
\begin{tabular}{ll ccc}
  \toprule
  Group        & Original                   & Centered       &    Untipped    & Overtipped \\ \midrule
  Barbed       & \tiprow Arc Barb           & \tip{Centered} & \tip{Untipped} &     --     \\
               & \Tiprow Parenthesis        & \tip{Centered} & \tip{Untipped} &     --     \\
               & \tiprow Hooks              & \tip{Centered} &       --       &     --     \\
               & \tiprow Straight Barb      & \tip{Centered} &       --       &     --     \\
               & \tiprow Tee Barb           & \tip{Centered} & \tip{Untipped} &     --     \\
               & \Tiprow Bar                & \tip{Centered} & \tip{Untipped} &     --     \\
               & \Tiprow Bracket            & \tip{Centered} & \tip{Untipped} &     --     \\ \midrule
%  Mathematical & Classical TikZ Rightarrow  & --             &       --       &     --     \\
%               & Computer Modern Rightarrow & --             &       --       &     --     \\
%               & \quad To                   & --             &       --       &     --     \\
%               & Implies                    & --             &       --       &     --     \\ \midrule
  Geometric    & \tiprow Circle             & \tip{Centered} & \tip{Untipped} &     --     \\
               & \Tiprow Ellipse            & \tip{Centered} & \tip{Untipped} &     --     \\
               & \tiprow Kite               & \tip{Centered} &       --       &     --     \\
               & \Tiprow Diamond            & \tip{Centered} &       --       &     --     \\
               & \Tiprow Turned Square      & \tip{Centered} &       --       &     --     \\
               & \tiprow LaTeX              & --             &       --       &     --     \\
               & \tiprow Square             & \tip{Centered} &       --       &     --     \\
               & \Tiprow Rectangle          & \tip{Centered} &       --       &     --     \\
               & \tiprow Stealth            & \tip{Centered} &       --       &     --     \\
               & \Tiprow Triangle           & \tip{Centered} &       --       &     --     \\ \midrule
%  Caps         &                            & --             &       --       &     --     \\
  Rays         & \tiprow Rays               & \tip{Centered} &       --       &     --     \\ \bottomrule
\end{tabular}
\end{center}
\newcolumn

\subsection{Centered}
\subsubsection{Barbed Arrow Tips}
\begin{arrowtipsimple}{Centered Arc Barb}
    This is a variant of the \referenceArrowtipandIndexO{Arc Barb} tip.
    The center of the arc lies on the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Bar}
    A variant of the simple \referenceArrowtipandIndexO{Bar} tip.
    This is a simple instance of |Centered Tee Barb| for length zero.
    
    The middle of the line will lie on original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Bracket}
    This is a variant of the \referenceArrowtipandIndexO{Bracket} tip and
    therefore an instance of the |Centered Tee Barb| arrow tip that results in something
    resembling a bracket.
    
    The middle of the vertical part will lie on the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Hooks}
    A variant of the \referenceArrowtipandIndexO{Hooks} tip.
    The starting point of the hooks will lie on the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Parenthesis}
    This is a variant of the \referenceArrowtipandIndexO{Parenthesis} tip and
    thus an instance of the |Centered Arc Barb| arrow tip.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Straight Barb}
    A variant of the \referenceArrowtipandIndexO{Straight Barb} tip.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Tee Barb}
    A variant of the \referenceArrowtipandIndexO{Tee Barb} tip.
    
    The middle of the vertical part will lie on the original end of the path.
\end{arrowtipsimple}

\subsubsection{Geometric Arrow Tips}
\begin{arrowtipsimple}{Centered Circle}
    A variant of the \referenceArrowtipandIndexO{Circle} tip.
    The center of the circle will lie on the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Diamond}
    This is a variant of the \referenceArrowtipandIndexO{Diamond} tip and
    thus an instance of |Centered Kite| where the length is larger than the width.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Ellipse}
    This is a variant of the \referenceArrowtipandIndexO{Ellipse} tip
    and thus another name for the |Centered Circle| tip
    that is twice as wide as high.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Kite}
    A variant of the \referenceArrowtipandIndexO{Kite} tip.
    
    The widest part will lie on the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Rectangle}
    A variant of the \referenceArrowtipandIndexO{Rectangle} tip.
    By default, it is twice as long as high.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Square}
    A variant of the \referenceArrowtipandIndexO{Square} tip.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Stealth}
    This is a variant of the \referenceArrowtipandIndexO{Stealth} tip.
    
    The weighted center will lie at the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Triangle}
    This is a variant of the \referenceArrowtipandIndexO{Triangle} tip and
    thus an instance of the |Centered Kite| tip with zero inset.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Centered Turned Square}
    This is a variant of the \referenceArrowtipandIndexO{Turned Square} tip and
    thus an instance of the |Centered Kite| tip with identical width and height and mid-inset.
\end{arrowtipsimple}

\subsubsection{Special Arrow Tips}
\begin{arrowtipsimple}{Centered Rays}
    A variant of the \referenceArrowtipandIndexO{Rays} tip.
    The origin of the rays will lie on the original end of the path.
\end{arrowtipsimple}

\subsection{Untipped}
\subsubsection{Barbed Arrow Tips}
\begin{arrowtipsimple}{Centered Arc Barb}
    This is a variant of the \referenceArrowtipandIndexO{Arc Barb} tip.
    The arrow tip will protrude half its line width over the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Untipped Bar}
    A variant of the simple \referenceArrowtipandIndexO{Bar} tip.
    This is a simple instance of |Untipped Tee Barb| for length zero.
    
    The middle of the line will lie on original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Untipped Bracket}
    This is a variant of the \referenceArrowtipandIndexO{Bracket} tip and
    therefore an instance of the |Untipped Tee Barb| arrow tip that results in something
    resembling a bracket.
    
    The arrow tip will protrude half its line width over the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Untipped Parenthesis}
    This is a variant of the \referenceArrowtipandIndexO{Parenthesis} tip and
    thus an instance of the |Untipped Arc Barb| arrow tip.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Untipped Tee Barb}
    A variant of the \referenceArrowtipandIndexO{Tee Barb} tip.
    
    The middle of the vertical part will lie on the original end of the path.
\end{arrowtipsimple}

\subsubsection{Geometric Arrow Tips}
\begin{arrowtipsimple}{Untipped Circle}
    A variant of the \referenceArrowtipandIndexO{Circle} tip.
    This tip will protrude half its line width over the original end of the path.
\end{arrowtipsimple}

\begin{arrowtipsimple}{Untipped Ellipse}
    This is a variant of the \referenceArrowtipandIndexO{Ellipse} tip
    and thus another name for the |Untipped Circle| tip
    that is twice as wide as high.
\end{arrowtipsimple}

\subsection{Original Arrow Tips}
\begin{arrowtipsimple}{Hug Cap}
This arrow tips will hug a circle that would touch the end of the path.

Use the \referenceKeyandIndexO[/pgf/arrow keys/]{length} key to set up the radius of that circle.

\begin{codeexample}[preamble=\usepgflibrary{ext.arrows}]
\begin{tikzpicture}[
  dot/.style 2 args={
    shape=circle, outer sep=+0pt, fill={#1}, minimum size={#2}}]
\node[dot={red} {2cm}] (A)           {};
\node[dot={blue}{3cm}] (B) at (6,0) {};
\draw[
  line width=1.5cm,
  arrows={Hug Cap[length=1cm]-Hug Cap[length=1.5cm]}
] (A) to[out=45, in=180] (B);
\end{tikzpicture}
\end{codeexample}
\end{arrowtipsimple}

\begin{arrowtip}{Loop}{
  This arrow tip attaches a one-sided loop to the end of the line.
  The |length| refers to the length of the whole tip while the |radius|
  specifies the radius of the three rounded corners.
  The width of the tip is twice the |length| (but can't specified independently).
}{length=1.5cm,radius=3.5mm}{length=1.5cm,radius=3.5mm}
    \begin{arrowexamples}
        \arrowexample[]
        \arrowexampledup[sep]
        \arrowexampledupdot[sep]
        \arrowexample[open]
        \arrowexample[open, swap]
        \arrowexample[length=5pt,radius=0pt]
        \arrowexample[reversed]
        \arrowexample[slant=.3]
        \arrowexample[red]
    \end{arrowexamples}
    %
    The following options have no effect: |harpoon|, |round|, |line width|.

    On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
\end{multicols}
\tikzset{external/export/.try=true}%
\endinput