| 1 |
% !TeX spellcheck = en_US |
| 2 |
% !TeX root = tikz-ext-manual.tex |
| 3 |
% Copyright 2023 by Qrrbrbirlbel |
| 4 |
% |
| 5 |
% This file may be distributed and/or modified |
| 6 |
% |
| 7 |
% 1. under the LaTeX Project Public License and/or |
| 8 |
% 2. under the GNU Free Documentation License. |
| 9 |
% |
| 10 |
|
| 11 |
\section{Arrow Tips} |
| 12 |
\label{pgflibrary:arrows} |
| 13 |
\tikzset{external/export/.try=false}% |
| 14 |
\begin{pgflibrary}{ext.arrows} |
| 15 |
This library adds arrows to \pgfname/\tikzname. |
| 16 |
|
| 17 |
\inspiration{ArrowLoop-Q,ArrowHug-Q,ArrowUntipped1-Q,ArrowUntipped2-Q,DoubleTipQ} |
| 18 |
{ArrowLoop-A,ArrowHug-A,ArrowUntipped1-A,ArrowUntipped2-A,DoubleTipA} |
| 19 |
\end{pgflibrary} |
| 20 |
\begin{multicols}{2} |
| 21 |
The arrow tips of the \referenceLibraryandIndexO{arrows.meta} library always |
| 22 |
just touch the end of original line -- which is usually |
| 23 |
what you want. |
| 24 |
|
| 25 |
But for some arrow tips (and when they lie along a path) it makes sense |
| 26 |
that these tips shoot a bit over the end of the line. |
| 27 |
This is why these arrow tips exist. |
| 28 |
They can be categorized into three groups: |
| 29 |
\begin{enumerate} |
| 30 |
\item Centered |
| 31 |
\item Untipped |
| 32 |
\item Overtipped\footnote{The Overtipped arrow tips aren't yet implemented.} |
| 33 |
\end{enumerate} |
| 34 |
Not all original arrow tips got all variants. |
| 35 |
For a summary, refer to table on the right side. |
| 36 |
As with the original tips of the \referenceLibraryandIndexO{arrows.meta} library |
| 37 |
these can be organized in the following categories. |
| 38 |
\newcolumn |
| 39 |
\begin{center} |
| 40 |
\newcommand*\tip[2][]{% |
| 41 |
\tikzset{external/export/.try=false}% |
| 42 |
\tikz[arrows={ext_#2 \arrowtiprow[reversed] - \arrowtiprow[sep] . ext_#2 \arrowtiprow[]}, baseline=+-.5ex, |
| 43 |
trim left=+-3mm, trim right=+13mm] |
| 44 |
\draw[line width=+.5mm, postaction={draw, gray, thin,-}] (0,0) -- + (right:1);% |
| 45 |
}% |
| 46 |
\def\tiprow#1 &{#1\gdef\arrowtiprow{#1} &}% |
| 47 |
\def\Tiprow#1 &{\quad#1\gdef\arrowtiprow{#1} &}% |
| 48 |
%\centering |
| 49 |
%\caption{Variants of the original \texttt{arrows.meta} arrow tips. |
| 50 |
% For each example, the order is 1. reversed variant, 2. original, 3. variant. |
| 51 |
% They gray line shows where the path actually ends. |
| 52 |
%}\label{tab:tips} |
| 53 |
\begin{tabular}{ll ccc} |
| 54 |
\toprule |
| 55 |
Group & Original & Centered & Untipped & Overtipped \\ \midrule |
| 56 |
Barbed & \tiprow Arc Barb & \tip{Centered} & \tip{Untipped} & -- \\ |
| 57 |
& \Tiprow Parenthesis & \tip{Centered} & \tip{Untipped} & -- \\ |
| 58 |
& \tiprow Hooks & \tip{Centered} & -- & -- \\ |
| 59 |
& \tiprow Straight Barb & \tip{Centered} & -- & -- \\ |
| 60 |
& \tiprow Tee Barb & \tip{Centered} & \tip{Untipped} & -- \\ |
| 61 |
& \Tiprow Bar & \tip{Centered} & \tip{Untipped} & -- \\ |
| 62 |
& \Tiprow Bracket & \tip{Centered} & \tip{Untipped} & -- \\ \midrule |
| 63 |
% Mathematical & Classical TikZ Rightarrow & -- & -- & -- \\ |
| 64 |
% & Computer Modern Rightarrow & -- & -- & -- \\ |
| 65 |
% & \quad To & -- & -- & -- \\ |
| 66 |
% & Implies & -- & -- & -- \\ \midrule |
| 67 |
Geometric & \tiprow Circle & \tip{Centered} & \tip{Untipped} & -- \\ |
| 68 |
& \Tiprow Ellipse & \tip{Centered} & \tip{Untipped} & -- \\ |
| 69 |
& \tiprow Kite & \tip{Centered} & -- & -- \\ |
| 70 |
& \Tiprow Diamond & \tip{Centered} & -- & -- \\ |
| 71 |
& \Tiprow Turned Square & \tip{Centered} & -- & -- \\ |
| 72 |
& \tiprow LaTeX & -- & -- & -- \\ |
| 73 |
& \tiprow Square & \tip{Centered} & -- & -- \\ |
| 74 |
& \Tiprow Rectangle & \tip{Centered} & -- & -- \\ |
| 75 |
& \tiprow Stealth & \tip{Centered} & -- & -- \\ |
| 76 |
& \Tiprow Triangle & \tip{Centered} & -- & -- \\ \midrule |
| 77 |
% Caps & & -- & -- & -- \\ |
| 78 |
Rays & \tiprow Rays & \tip{Centered} & -- & -- \\ \bottomrule |
| 79 |
\end{tabular} |
| 80 |
\end{center} |
| 81 |
\newcolumn |
| 82 |
|
| 83 |
\subsection{Centered} |
| 84 |
\subsubsection{Barbed Arrow Tips} |
| 85 |
\begin{arrowtipsimple}{ext\textunderscore Centered Arc Barb}\tipcompat |
| 86 |
This is a variant of the \referenceArrowtipandIndexO{Arc Barb} tip. |
| 87 |
The center of the arc lies on the original end of the path. |
| 88 |
\end{arrowtipsimple} |
| 89 |
|
| 90 |
\begin{arrowtipsimple}{ext\textunderscore Centered Bar}\tipcompat |
| 91 |
A variant of the simple \referenceArrowtipandIndexO{Bar} tip. |
| 92 |
This is a simple instance of |ext_Centered Tee Barb| for length zero. |
| 93 |
|
| 94 |
The middle of the line will lie on original end of the path. |
| 95 |
\end{arrowtipsimple} |
| 96 |
|
| 97 |
\begin{arrowtipsimple}{ext\textunderscore Centered Bracket}\tipcompat |
| 98 |
This is a variant of the \referenceArrowtipandIndexO{Bracket} tip and |
| 99 |
therefore an instance of the |ext_Centered Tee Barb| arrow tip that results in something |
| 100 |
resembling a bracket. |
| 101 |
|
| 102 |
The middle of the vertical part will lie on the original end of the path. |
| 103 |
\end{arrowtipsimple} |
| 104 |
|
| 105 |
\begin{arrowtipsimple}{ext\textunderscore Centered Hooks}\tipcompat |
| 106 |
A variant of the \referenceArrowtipandIndexO{Hooks} tip. |
| 107 |
The starting point of the hooks will lie on the original end of the path. |
| 108 |
\end{arrowtipsimple} |
| 109 |
|
| 110 |
\begin{arrowtipsimple}{ext\textunderscore Centered Parenthesis}\tipcompat |
| 111 |
This is a variant of the \referenceArrowtipandIndexO{Parenthesis} tip and |
| 112 |
thus an instance of the |ext_Centered Arc Barb| arrow tip. |
| 113 |
\end{arrowtipsimple} |
| 114 |
|
| 115 |
\begin{arrowtipsimple}{ext\textunderscore Centered Straight Barb}\tipcompat |
| 116 |
A variant of the \referenceArrowtipandIndexO{Straight Barb} tip. |
| 117 |
\end{arrowtipsimple} |
| 118 |
|
| 119 |
\begin{arrowtipsimple}{ext\textunderscore Centered Tee Barb}\tipcompat |
| 120 |
A variant of the \referenceArrowtipandIndexO{Tee Barb} tip. |
| 121 |
|
| 122 |
The middle of the vertical part will lie on the original end of the path. |
| 123 |
\end{arrowtipsimple} |
| 124 |
|
| 125 |
\subsubsection{Geometric Arrow Tips} |
| 126 |
\begin{arrowtipsimple}{ext\textunderscore Centered Circle}\tipcompat |
| 127 |
A variant of the \referenceArrowtipandIndexO{Circle} tip. |
| 128 |
The center of the circle will lie on the original end of the path. |
| 129 |
\end{arrowtipsimple} |
| 130 |
|
| 131 |
\begin{arrowtipsimple}{ext\textunderscore Centered Diamond}\tipcompat |
| 132 |
This is a variant of the \referenceArrowtipandIndexO{Diamond} tip and |
| 133 |
thus an instance of |ext_Centered Kite| where the length is larger than the width. |
| 134 |
\end{arrowtipsimple} |
| 135 |
|
| 136 |
\begin{arrowtipsimple}{ext\textunderscore Centered Ellipse}\tipcompat |
| 137 |
This is a variant of the \referenceArrowtipandIndexO{Ellipse} tip |
| 138 |
and thus another name for the |ext_Centered Circle| tip |
| 139 |
that is twice as wide as high. |
| 140 |
\end{arrowtipsimple} |
| 141 |
|
| 142 |
\begin{arrowtipsimple}{ext\textunderscore Centered Kite}\tipcompat |
| 143 |
A variant of the \referenceArrowtipandIndexO{Kite} tip. |
| 144 |
|
| 145 |
The widest part will lie on the original end of the path. |
| 146 |
\end{arrowtipsimple} |
| 147 |
|
| 148 |
\begin{arrowtipsimple}{ext\textunderscore Centered Rectangle}\tipcompat |
| 149 |
A variant of the \referenceArrowtipandIndexO{Rectangle} tip. |
| 150 |
By default, it is twice as long as high. |
| 151 |
\end{arrowtipsimple} |
| 152 |
|
| 153 |
\begin{arrowtipsimple}{ext\textunderscore Centered Square}\tipcompat |
| 154 |
A variant of the \referenceArrowtipandIndexO{Square} tip. |
| 155 |
\end{arrowtipsimple} |
| 156 |
|
| 157 |
\begin{arrowtipsimple}{ext\textunderscore Centered Stealth}\tipcompat |
| 158 |
This is a variant of the \referenceArrowtipandIndexO{Stealth} tip. |
| 159 |
|
| 160 |
The weighted center will lie at the original end of the path. |
| 161 |
\end{arrowtipsimple} |
| 162 |
|
| 163 |
\begin{arrowtipsimple}{ext\textunderscore Centered Triangle}\tipcompat |
| 164 |
This is a variant of the \referenceArrowtipandIndexO{Triangle} tip and |
| 165 |
thus an instance of the |ext_Centered Kite| tip with zero inset. |
| 166 |
\end{arrowtipsimple} |
| 167 |
|
| 168 |
\begin{arrowtipsimple}{ext\textunderscore Centered Turned Square}\tipcompat |
| 169 |
This is a variant of the \referenceArrowtipandIndexO{Turned Square} tip and |
| 170 |
thus an instance of the |ext_Centered Kite| tip with identical width and height and mid-inset. |
| 171 |
\end{arrowtipsimple} |
| 172 |
|
| 173 |
\subsubsection{Special Arrow Tips} |
| 174 |
\begin{arrowtipsimple}{ext\textunderscore Centered Rays}\tipcompat |
| 175 |
A variant of the \referenceArrowtipandIndexO{Rays} tip. |
| 176 |
The origin of the rays will lie on the original end of the path. |
| 177 |
\end{arrowtipsimple} |
| 178 |
|
| 179 |
\subsection{Untipped} |
| 180 |
\subsubsection{Barbed Arrow Tips} |
| 181 |
\begin{arrowtipsimple}{ext\textunderscore Centered Arc Barb}\tipcompat |
| 182 |
This is a variant of the \referenceArrowtipandIndexO{Arc Barb} tip. |
| 183 |
The arrow tip will protrude half its line width over the original end of the path. |
| 184 |
\end{arrowtipsimple} |
| 185 |
|
| 186 |
\begin{arrowtipsimple}{ext\textunderscore Untipped Bar}\tipcompat |
| 187 |
A variant of the simple \referenceArrowtipandIndexO{Bar} tip. |
| 188 |
This is a simple instance of |ext_Untipped Tee Barb| for length zero. |
| 189 |
|
| 190 |
The middle of the line will lie on original end of the path. |
| 191 |
\end{arrowtipsimple} |
| 192 |
|
| 193 |
\begin{arrowtipsimple}{ext\textunderscore Untipped Bracket}\tipcompat |
| 194 |
This is a variant of the \referenceArrowtipandIndexO{Bracket} tip and |
| 195 |
therefore an instance of the |ext_Untipped Tee Barb| arrow tip that results in something |
| 196 |
resembling a bracket. |
| 197 |
|
| 198 |
The arrow tip will protrude half its line width over the original end of the path. |
| 199 |
\end{arrowtipsimple} |
| 200 |
|
| 201 |
\begin{arrowtipsimple}{ext\textunderscore Untipped Parenthesis}\tipcompat |
| 202 |
This is a variant of the \referenceArrowtipandIndexO{Parenthesis} tip and |
| 203 |
thus an instance of the |ext_Untipped Arc Barb| arrow tip. |
| 204 |
\end{arrowtipsimple} |
| 205 |
|
| 206 |
\begin{arrowtipsimple}{ext\textunderscore Untipped Tee Barb}\tipcompat |
| 207 |
A variant of the \referenceArrowtipandIndexO{Tee Barb} tip. |
| 208 |
|
| 209 |
The middle of the vertical part will lie on the original end of the path. |
| 210 |
\end{arrowtipsimple} |
| 211 |
|
| 212 |
\subsubsection{Geometric Arrow Tips} |
| 213 |
\begin{arrowtipsimple}{ext\textunderscore Untipped Circle}\tipcompat |
| 214 |
A variant of the \referenceArrowtipandIndexO{Circle} tip. |
| 215 |
This tip will protrude half its line width over the original end of the path. |
| 216 |
\end{arrowtipsimple} |
| 217 |
|
| 218 |
\begin{arrowtipsimple}{ext\textunderscore Untipped Ellipse}\tipcompat |
| 219 |
This is a variant of the \referenceArrowtipandIndexO{Ellipse} tip |
| 220 |
and thus another name for the |ext_Untipped Circle| tip |
| 221 |
that is twice as wide as high. |
| 222 |
\end{arrowtipsimple} |
| 223 |
|
| 224 |
\newcolumn |
| 225 |
\subsection{Original Arrow Tips} |
| 226 |
\begin{arrowtipsimple}{ext\textunderscore Hug Cap}\tipcompat |
| 227 |
This arrow tips will hug a circle that would touch the end of the path. |
| 228 |
|
| 229 |
Use the \referenceKeyandIndexO[/pgf/arrow keys/]{length} key to set up the radius of that circle. |
| 230 |
|
| 231 |
\begin{codeexample}[preamble=\usepgflibrary{ext.arrows}] |
| 232 |
\begin{tikzpicture}[ |
| 233 |
dot/.style 2 args={ |
| 234 |
shape=circle, outer sep=+0pt, fill={#1}, minimum size={#2}}] |
| 235 |
\node[dot={red} {2cm}] (A) {}; |
| 236 |
\node[dot={blue}{3cm}] (B) at (6,0) {}; |
| 237 |
\draw[ |
| 238 |
line width=1.5cm, |
| 239 |
arrows={ext_Hug Cap[length=1cm]-ext_Hug Cap[length=1.5cm]} |
| 240 |
] (A) to[out=45, in=180] (B); |
| 241 |
\end{tikzpicture} |
| 242 |
\end{codeexample} |
| 243 |
\end{arrowtipsimple} |
| 244 |
|
| 245 |
\makeatletter |
| 246 |
\newcommand*\extus{% |
| 247 |
\ifx\path\tikz@command@path |
| 248 |
ext_% |
| 249 |
\else |
| 250 |
ext\textunderscore |
| 251 |
\fi |
| 252 |
} |
| 253 |
\makeatother |
| 254 |
\begin{arrowtip}{\extus Loop}{\tipCompat{Loop} |
| 255 |
This arrow tip attaches a one-sided loop to the end of the line. |
| 256 |
The |length| refers to the length of the whole tip while the |inset| |
| 257 |
specifies the radius of the three rounded corners. |
| 258 |
The width of the tip is twice the |length| (but can't specified independently). |
| 259 |
}{length=1.5cm,inset=3.5mm}{length=1.5cm,radius=3.5mm/1.5cm} |
| 260 |
\begin{arrowexamples} |
| 261 |
\arrowexample[] |
| 262 |
\arrowexampledup[sep] |
| 263 |
\arrowexampledupdot[sep] |
| 264 |
\arrowexample[open] |
| 265 |
\arrowexample[open, swap] |
| 266 |
\arrowexample[length=5pt,inset=0pt] |
| 267 |
\arrowexample[reversed] |
| 268 |
\arrowexample[slant=.3] |
| 269 |
\arrowexample[red] |
| 270 |
\end{arrowexamples} |
| 271 |
% |
| 272 |
The following options have no effect: |harpoon|, |round|, |line width|. |
| 273 |
|
| 274 |
On |double| lines, the arrow tip will not look correct. |
| 275 |
\end{arrowtip} |
| 276 |
\begin{arrowtipsimple}{\extus Double Stealth} |
| 277 |
This arrow tip is similar to the original \referenceArrowtipandIndexO{Stealth}, |
| 278 |
its back is left open so that it aligns neatly to a |double|d path. |
| 279 |
\end{arrowtipsimple} |
| 280 |
\begin{arrowtipsimple}{\extus Double Triangle} |
| 281 |
This arrow tip is similar to the original \referenceArrowtipandIndexO{Triangle}, |
| 282 |
its back is left open so that it aligns neatly to a |double|d path. |
| 283 |
\end{arrowtipsimple} |
| 284 |
\begin{arrowtipsimple}{\extus Double Cap} |
| 285 |
This arrow tip closes a |double|d line so that it not left open. |
| 286 |
\end{arrowtipsimple} |
| 287 |
\begin{codeexample}[preamble=\usepgflibrary{ext.arrows}] |
| 288 |
\begin{tikzpicture} |
| 289 |
\draw[ |
| 290 |
ext_Double Cap-ext_Double Stealth, |
| 291 |
double distance=1cm, |
| 292 |
line width=3mm |
| 293 |
] (0,0) to[bend left] (right:9); |
| 294 |
\end{tikzpicture} |
| 295 |
\end{codeexample} |
| 296 |
\end{multicols} |
| 297 |
\tikzset{external/export/.try=true}% |
| 298 |
\endinput |