Debian Codegraph @

texmf-dist/doc/latex/tikz-ext/tikz-ext-manual-en-intro.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 \part{Introduction}
11 \begin{multicols}{2}
12 \section{Usage}
13 This package is called |tikz-ext|, however,
14 one can't load it via |\usepackage|.%
15 \footnote{Except for \texttt{pgfcalendar-ext} and \texttt{pgffor-ext}.}
16 Instead, this package consists mostly of
17 \pgfname\space and \tikzname\space libraries
18 which are loaded by either |\usepgflibrary| or |\usetikzlibrary|.
19
20 \section{Why do we need it?}
21 Since I have been answering questions on
22 \hyperlink{https://tex.stackexchange.com}{TeX.sx}
23 I've noticed that some questions come up again and again,
24 every time with a slightly different approach on how to solve them.
25
26 I don't like reinventing the wheel which is why I've gathered
27 the solutions of my answers in this package.
28
29 \section{Having problems?}
30 Note however, that most of these extensions haven't been
31 stress-tested properly and might be considered
32 experimental.
33
34 Don't hesitate to open an issue on GitHub.
35 You probably found a bug.
36
37 \newcolumn
38 \section{Namespaces and \tikzextname\ macros}
39 Since some parts of this package have existed in some form since 2013,
40 the choice for key names and in which \pgfname keys namespace they reside
41 is not always optimal.
42 They often reside in the main |/tikz| or |/pgf| path.
43 Similar applies to macro names.
44
45 Starting with version~0.6, the namespace for almost all keys is |/tikz/ext|
46 or |/pgf/ext|. The same applies to macros that shall be starting with |\tikzext| or |\pgfext|.
47
48 Starting with version~0.6,
49 \tikzextname\ provides commands that return the current version for compatibility testing.
50 The second simply increments with every release
51 so that the first doesn't need to be parsed.
52 \begin{command}{\tikzextversion}
53 Returns \texttt{\tikzextversion}.
54 \end{command}
55 \begin{command}{\tikzextversionnumber}
56 Returns \texttt{\tikzextversionnumber}.
57 \end{command}
58 %
59 Also there's |\tikzextset| and |\pgfextset|.
60 \begin{command}{\tikzextset\marg{options}}
61 This command will process the \meta{options} using the
62 |\pgfkeys| command with the default path set to |/tikz/ext|.
63 \end{command}
64 \begin{command}{\pgfextset\marg{options}}
65 This command will process the \meta{options} using the
66 |\pgfkeys| command with the default path set to |/pgf/ext|.
67 \end{command}
68
69 \newcolumn
70 \section{Compatibility with older versions}
71 As discussed in the previous section,
72 keys and commands of extensions that existed before version~0.6
73 that do not appear in this manual are considered deprecated.
74
75 \begin{key}{/\tikzext/compat=\mchoice{pre 0.6, 0.6, warn, newest} (default pre 0.6)}
76 This sets the global compatibility setting for every extension of this package
77 (whether already loaded or not).
78
79 The choice |warn| gives out warning for deprecated keys or commands
80 but still executes them if they were not not in use when an extension was loaded.
81
82 For version 0.6 this is actually the default settings so that active documents
83 keep working -- for now.
84
85 The following table shows the compatibility settings for each extension.
86 \newcommand*\X{$\checkmark$}%
87 \newcommand*\Xdef{\X\kern-.65em\X}%
88 A \X\ denotes an available setting where \Xdef\ denotes the default compatibility setting.
89 A -- denotes that it is not different than the |newest| setting.
90 \begin{center}
91 \begin{tabular}{>{\ttfamily ext.}l ccc}
92 \toprule
93 \multicolumn{1}{l}{Extension} & warn & pre 0.6 & 0.6 \\ \midrule
94 \multicolumn{1}{l}{\ttfamily pgfcalendar-ext} & \Xdef & \X & -- \\
95 \multicolumn{1}{l}{\quad\ttfamily ext.calendar-plus} & & & \\ \midrule[.5\lightrulewidth]
96 arrows & \Xdef & \X & -- \\
97 layers & \Xdef & \X & -- \\
98 node-families & \Xdef & \X & -- \\
99 nodes & \Xdef & \X & -- \\
100 paths.arcto & \Xdef & \X & -- \\ \addlinespace
101 paths.ortho & \Xdef & \X & -- \\
102 paths.timer & \Xdef & \X & -- \\
103 patterns.images & \Xdef & \X & -- \\
104 pgffor-ext & \Xdef & \X & -- \\
105 pgfkeys-plus & \Xdef & \X & -- \\
106 positioning-plus & \Xdef & \X & -- \\ \addlinespace
107 scalepicture & \Xdef & \X & -- \\
108 shapes & \Xdef & \X & -- \\
109 transformations.mirror & \Xdef & \X & -- \\
110 topaths.arcthrough & \Xdef & \X & -- \\ \bottomrule
111 \end{tabular}
112 \end{center}
113
114 For future version, it is planned that the default compatibility setting will not be |warn|.
115 \end{key}
116
117 \newcolumn\noindent
118 For each available extension the compatibility setting can be adjusted as well
119 after the extension is loaded.
120 \begin{keylist}[/\tikzext/compat]{%
121 pgfcalendar-ext=\meta{version} (default pre 0.6),
122 arrows=\meta{version} (default pre 0.6),
123 layers=\meta{version} (default pre 0.6),
124 nodes=\meta{version} (default pre 0.6),
125 node-families=\meta{version} (default pre 0.6),
126 paths.arcto=\meta{version} (default pre 0.6),
127 paths.ortho=\meta{version} (default pre 0.6),
128 paths.timer=\meta{version} (default pre 0.6),
129 patterns.images=\meta{version} (default pre 0.6),
130 pgffor-ext=\meta{version} (default pre 0.6),
131 pgfkeys-plus=\meta{version} (default pre 0.6),
132 positioning-plus=\meta{version} (default pre 0.6),
133 scalepicture=\meta{version} (default pre 0.6),
134 shapes=\meta{version} (default pre 0.6),
135 transformations.mirror=\meta{version} (default pre 0.6),
136 topaths.arcthrough=\meta{version} (default pre 0.6)%
137 }
138 For \meta{version} the same choices are valid as for the main |compat| key.
139 It should be noted that at this point, a compatibility setting can't really be reversed
140 since they only forward arguments from an old key or command to the new version.
141
142 The old names are given as a subtitle to the new one in the sections that introduce them.
143 \end{keylist}
144 \end{multicols}