forked from HaxeFoundation/HaxeManual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tikz.tex
98 lines (87 loc) · 1.62 KB
/
tikz.tex
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
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{shapes.geometric, arrows}
\usepackage{tikz-qtree}
\tikzstyle{flowchartitem} = [
minimum width = 2cm,
minimum height = 1cm,
text centered,
draw = black!50,
]
\tikzstyle{startstop} = [
flowchartitem,
rectangle,
rounded corners,
fill = red!20
]
\tikzstyle{io} = [
flowchartitem,
trapezium,
trapezium left angle = 70,
trapezium right angle = 110,
fill = blue!20
]
\tikzstyle{process} = [
flowchartitem,
rectangle,
fill = orange!20
]
\tikzstyle{decision} = [
flowchartitem,
diamond,
fill = green!20
]
% Compact decision shape (cut off rectangle corners if you know how)
\tikzstyle{decisionc} = [
decision,
minimum height = 0.8cm,
rectangle
]
\tikzstyle{valueNone} = [ fill = red!50 ]
\tikzstyle{valueSome} = [ fill = yellow!50 ]
\tikzstyle{valueAll} = [ fill = green!50 ]
\newenvironment*{tikzfigure}[1][]{
\begin{figure}[h!]
\begin{tikzfigureinternal}[#1]
}{
\end{tikzfigureinternal}
\end{figure}
}
\newenvironment*{tikzsubfigure}[1][]{
\begin{subfigure}[b]{0.45\textwidth}
\begin{tikzfigureinternal}[#1]
}{
\end{tikzfigureinternal}
\end{subfigure}
}
\newenvironment*{tikzfigureinternal}[1][]{
\centering
\gdef\tcapt{#1}
\begin{tikzpicture}[scale=1]
}{
\end{tikzpicture}
\caption{\tcapt}
}
\tikzstyle{flowchartArrow} = [
thick,
->,
>=stealth,
decoration = {
markings,
mark = at position 1 with {
\arrow[scale=2]{>}
}
},
postaction = {decorate}
]
\newenvironment*{flowchart}[2]{
\label{#1}
\begin{tikzfigure}[#2]
\tikzset {
level distance = 3cm,
grow = down,
edge from parent/.append style = { flowchartArrow }
}
}{
\end{tikzfigure}
}