summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-body.tex
blob: e4445d392b4547ee964c313c2dfbb42a59e7e862 (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
% !TeX spellcheck = en_US
% !TeX root = tikz-ext-manual.tex
% Copyright 2022 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.
%
\newcommand*\tikzextname{Ti\textit kZ-Extensions}
\newcommand*\tikzextversion{0.2}

%\includeonly{
%   tikz-ext-manual-en-library-paths.arcto,
%   tikz-ext-manual-en-library-paths.ortho,
%   tikz-ext-manual-en-library-paths.timer,
%   tikz-ext-manual-en-library-patterns.images,
%   tikz-ext-manual-en-library-topaths.arcthrough,
%   tikz-ext-manual-en-library-trans,
%   tikz-ext-manual-en-pgf-trans,
%   tikz-ext-manual-en-library-misc,
%}
\begin{document}

\title{\bfseries The \tikzextname\space Package\\
  \large Manual for version \tikzextversion\\[1mm]
\large\href{https://github.com/Qrrbrbirlbel/tikz-extensions}{\texttt{https://github.com/Qrrbrbirlbel/tikz-extensions}}
\author{Qrrbrbirlbel}}

\maketitle
\label{table-of-contents}

\tableofcontents


\include{tikz-ext-manual-en-intro}

\part{\tikzname\space Libraries}
\label{part:tikz}

These libraries only work with \tikzname.
\vspace{1em}
\begin{center}\tikzsetnextfilename{main-cover}
\begin{tikzpicture}[
  very thick,
  scale=2.7,
  grow cyclic,
  level distance=1cm,
  level/.style={
    level distance/.expanded=\ifnum#1>1 \tikzleveldistance/1.5\else\tikzleveldistance\fi,
    nodes/.expanded={\ifodd#1 fill\else fill=none\fi}
  },
  level 1/.style={sibling angle=120},
  level 2/.style={sibling angle=90},
  level 3/.style={sibling angle=90},
  level 4/.style={sibling angle=45},
  nodes={circle,draw,inner sep=+0pt, minimum size=+5pt},
  ]
\path[rotate=30]
  node {}
  child foreach \cntI in {1,...,3} {
    node {}
    child foreach \cntII in {1,...,2} { 
      node {}
      child foreach \cntIII in {1,...,2} {
        node {}
        child foreach \cntIV in {1,...,2} {
          node {}
          child foreach \cntV in {1,...,2} {}
        }
      }
    }
  };
\end{tikzpicture}
\end{center}

\tikzsetfigurename{calendar-plus}   \include{tikz-ext-manual-en-library-calendar-plus}
\tikzsetfigurename{node-families}   \include{tikz-ext-manual-en-library-node-families}
\tikzsetfigurename{paths.arcto}     \include{tikz-ext-manual-en-library-paths.arcto}
\tikzsetfigurename{paths.ortho}     \include{tikz-ext-manual-en-library-paths.ortho}
\tikzsetfigurename{paths.timer}     \include{tikz-ext-manual-en-library-paths.timer}
\tikzsetfigurename{patterns.images} \include{tikz-ext-manual-en-library-patterns.images}
\tikzsetfigurename{positioning-plus}\include{tikz-ext-manual-en-library-positioning-plus}
\tikzsetfigurename{topaths.arcthrough}\include{tikz-ext-manual-en-library-topaths.arcthrough}
\tikzsetfigurename{trans}             \include{tikz-ext-manual-en-library-trans}

\part{PGF Libraries}
\label{part:pgf}
These libraries (should) work with both PGF and \tikzname.

\begin{center}\tikzsetnextfilename{main-graph}
\begin{codeexample}[width=10cm,preamble=\usetikzlibrary{graphs,graphdrawing,ext.misc} \usegdlibrary{force}]
\tikzset{
  mynode/.style={
    circle, minimum size=10mm, draw, densely dashdotted, thick,
    decide color/.expand once=#1},
  decide color/.style 2 args={
    /utils/TeX/if=c#1
      {/utils/TeX/ifnum={#2<5}{bluelight}{bluedark}}
      {/utils/TeX/ifnum={#2<8}{light}{dark}}},
  light/.style={fill=gray!20},  bluelight/.style={fill=blue!10},
  dark/.style ={fill=gray!60},  bluedark/.style ={fill=blue!30}}
\tikz\graph[
  spring electrical layout, vertical=c2 to p13,
  node distance=1.5cm, typeset=$n_{\tikzgraphnodetext}$,
  nodes={mynode=\tikzgraphnodetext}] {
  % outer ring
  c2 -- {p1, p11, p6};
    p1 -- {p8, c6, p11};
      p8 -- {p3, p10, c6};
       p3 -- {p13, p15, p10};
         p13 -- {p15, c7};
           c7  -- {c3, c4, p15};
           c3  -- {p14, c4};
           p14 -- {p7, c4};
         p7 -- {p9, p2, c4};
       p9 -- {c5, p12, p2};
     c5 -- {c1, p4, p12};
   c1 -- {p6, p4};
  p6 -- {p11, p4};
  % inner ring
  p11 -- {c6, p12, p4};
  p5 -- {c6 -- {p10, p12}, p10 -- p15, p15 -- c4, c4 -- p2, p2 -- p12, p12 -- p4};
};
\end{codeexample}
\end{center}

\tikzsetfigurename{PGF.trans}\include{tikz-ext-manual-en-pgf-trans}

\part{Utilities}

\label{part:misc}
\vfill\tikzsetnextfilename{main-misc}
\begin{codeexample}[width=6cm, preamble=\usetikzlibrary{ext.misc}]
\begin{tikzpicture}[
  declare function={bigR(\n)=smallR+.05*\n;},
  declare constant={smallR=1; segments=20;},
  full arc=segments]
\foreach \iN[evaluate={\endRadius=bigR(\iN+1);}, use int=0 to segments-1]
  \filldraw[fill=gray!50] (\iN R:\endRadius)
    arc [radius=\endRadius, start angle=\iN R, delta angle=+1R] -- (\iN R+1R:smallR)
    arc [radius=smallR,       end angle=\iN R, delta angle=-1R] -- cycle;

\node                                              {$\phi^2$};
\node at (north west:{sqrt 2 * bigR(segments/2)})  {$\{\Omega\}_{i=1}^n$};
\node[rotate=-.5R, right] at (-.5R: bigR segments) {$\partial \varphi$};

\tikzset{yshift=-5cm, declare constant={segments=25;}, full arc=segments}
\filldraw[fill=gray!50] (right:smallR)
  \foreach \iN[evaluate={\endRadius=bigR(\iN+1);}, use int=0 to segments-1] {
    -- (\iN R:\endRadius) arc[radius=\endRadius, start angle=\iN R, delta angle=1R]}
    -- (right:smallR)     arc[radius=smallR,     start angle=0,     delta angle=-360];

\node                                              {$\phi^2$};
\node at (north west:{sqrt 2 * bigR(segments/2)})  {$\{\Omega\}_{i=1}^n$};
\node[rotate=-.5R, right] at (-.5R: bigR segments) {$\partial \varphi$};
\end{tikzpicture}
\end{codeexample}
\vfill

\tikzsetfigurename{misc.calendar}\include{tikz-ext-manual-en-calendar}
\tikzsetfigurename{misc.misc}\include{tikz-ext-manual-en-library-misc}

%%% END
\newcommand*{\addTikz}[1]{Added \tikzname\space library \texttt{ext.#1}.}
\newcommand*{\addPGF}[1]{Added PGF library \texttt{ext.#1}.}
\part{Changelog \& Index}
\section*{Changelog}
\begin{multicols}{2}
Version 0.2
\begin{itemize}
\item \addTikz{positioning-plus}
\item \addTikz{node-families}
\end{itemize}

Version 0.1
\begin{itemize}
\item \addTikz{calendar-plus}
\item \addTikz{misc}
\item \addTikz{paths.arcto}
\item \addTikz{paths.ortho}
\item \addTikz{paths.timer}
\item \addTikz{patterns.images}
\item \addTikz{topaths.arcthrough}
\item \addTikz{transformations.mirror}
\item \addPGF{transformations.mirror}
\end{itemize}
\end{multicols}
\printindex

%\typeout{Examples: \the\codeexamplecount}%
\end{document}