Debian Codegraph @

texmf-dist/doc/latex/tikz-ext/tikz-ext-manual-en-pgf-shapes-rectround.tex

raw
1 % !TeX spellcheck = en_US
2 % !TeX root = tikz-ext-manual.tex
3 % Copyright 2022 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{Shape: Rectangle with Rounded Corners}
12 \begin{pgflibrary}{ext.shapes.rectangleroundedcorners}
13 A rectangle with rounded corners.
14 \end{pgflibrary}
15
16 \begin{ext_shape}{rectangle with rounded corners}
17 This library provides a |rectangle with rounded corners| where every corner can have a different radius.
18
19 \begin{key}{/\pgfext/rectangle with rounded corners north west radius=\meta{dimen} (initially .5\string\pgflinewidth)}\keycompat{pgf}
20 Sets the north west radius to \meta{dimen}.
21 \end{key}
22 \begin{key}{/\pgfext/rectangle with rounded corners north east radius=\meta{dimen} (initially .5\string\pgflinewidth)}\keycompat{pgf}
23 Sets the north east radius to \meta{dimen}.
24 \end{key}
25 \begin{key}{/\pgfext/rectangle with rounded corners south west radius=\meta{dimen} (initially .5\string\pgflinewidth)}\keycompat{pgf}
26 Sets the south west radius to \meta{dimen}.
27 \end{key}
28 \begin{key}{/\pgfext/rectangle with rounded corners south east radius=\meta{dimen} (initially .5\string\pgflinewidth)}\keycompat{pgf}
29 Sets the south east radius to \meta{dimen}.
30 \end{key}
31 \begin{key}{/\pgfext/rectangle with rounded corners radius=\meta{dimen}}\keycompat{pgf}
32 Sets all radii to \meta{dimen}.
33 \end{key}
34
35 \begin{codeexample}[preamble=\usepgflibrary{ext.shapes.rectangleroundedcorners}]
36 \begin{tikzpicture}\Huge
37 \node[name=s, shape=ext_rectangle with rounded corners, shape example,
38 ext/rectangle with rounded corners north west radius=10pt,
39 ext/rectangle with rounded corners north east radius=20pt,
40 ext/rectangle with rounded corners south west radius=30pt,
41 ext/rectangle with rounded corners south east radius=40pt] {Rectangle with rounded corners\vrule width 1pt height 2cm};
42 \foreach \anchor/\placement in
43 {north west/above left, north/above, north east/above right,
44 west/left, center/above, east/right,
45 mid west/right, mid/above, mid east/left,
46 base west/left, base/below, base east/right,
47 south west/below left, south/below, south east/below right,
48 text/below, 10/right, 130/above,
49 north west center/below right, north east center/left,
50 south west center/above right, south east center/left,
51 below north west/left, above south west/left, above south east/right, below north east/right,
52 right north west/above, right south west/below, left south east/below, left north east/above}
53 \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
54 node[\placement] {\scriptsize\texttt{(s.\anchor)}};
55 \end{tikzpicture}
56 \end{codeexample}
57 \end{ext_shape}
58 \endinput