Revision | c0e02f31f416ca47e81f0a05a4545343c2dfd99d (tree) |
---|---|
Time | 2016-02-08 05:57:45 |
Author | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
A script to show several things which can be achieved with tikz.
@@ -0,0 +1,215 @@ | ||
1 | +\documentclass{article} % say | |
2 | +\usepackage{tikz} | |
3 | +\usetikzlibrary{arrows.meta} | |
4 | +\usetikzlibrary{angles} | |
5 | +\usetikzlibrary{trees} | |
6 | +\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} | |
7 | +\usetikzlibrary{graphs} | |
8 | +\usetikzlibrary{bending} | |
9 | +\usetikzlibrary{automata} | |
10 | +%\usetikzlibrary{graphdrawing,graphs} | |
11 | +% \usegdlibrary{layered} | |
12 | + | |
13 | +\begin{document} | |
14 | + | |
15 | + | |
16 | + | |
17 | +We are working on | |
18 | +\begin{tikzpicture} | |
19 | +\draw (-1.5,0) -- (1.5,0); | |
20 | +\draw (0,-1.5) -- (0,1.5); | |
21 | +\end{tikzpicture}. | |
22 | + | |
23 | + | |
24 | +\tikz \draw (-1.5,0) -- (1.5,0) -- (0,-1.5) -- (0,1.5); | |
25 | + | |
26 | + | |
27 | + | |
28 | +\begin{tikzpicture} | |
29 | +\draw (-1.5,0) -- (1.5,0); | |
30 | +\draw (0,-1.5) -- (0,1.5); | |
31 | +\draw (0,0) circle [radius=1cm]; | |
32 | +\end{tikzpicture} | |
33 | + | |
34 | + | |
35 | +\begin{tikzpicture}[rounded corners,ultra thick] | |
36 | +\shade[top color=yellow,bottom color=black] (0,0) rectangle +(2,1); | |
37 | +\shade[left color=yellow,right color=black] (3,0) rectangle +(2,1); | |
38 | +\shadedraw[inner color=yellow,outer color=black,draw=yellow] (6,0) rectangle +(2,1); | |
39 | +\shade[ball color=green] (9,.5) circle (.5cm); | |
40 | +\end{tikzpicture} | |
41 | + | |
42 | + | |
43 | + | |
44 | +\begin{tikzpicture} | |
45 | +\draw [<->] (0,0) arc [start angle=180, end angle=30, radius=10pt]; | |
46 | +\draw [<->] (1,0) -- (1.5cm,10pt) -- (2cm,0pt) -- (2.5cm,10pt); | |
47 | +\end{tikzpicture} | |
48 | + | |
49 | + | |
50 | +\begin{tikzpicture}[>=Stealth] | |
51 | +\draw [->] (0,0) arc [start angle=180, end angle=30, radius=10pt]; | |
52 | +\draw [<<-,very thick] (1,0) -- (1.5cm,10pt) -- (2cm,0pt) -- (2.5cm,10pt); | |
53 | +\end{tikzpicture} | |
54 | + | |
55 | + | |
56 | + | |
57 | +\begin{tikzpicture} | |
58 | +\foreach \x in {1,2,...,5,7,8,...,12} | |
59 | +\foreach \y in {1,...,5} | |
60 | +{ | |
61 | +\draw (\x,\y) +(-.5,-.5) rectangle ++(.5,.5); | |
62 | +\draw (\x,\y) node{\x,\y}; | |
63 | +} | |
64 | +\end{tikzpicture} | |
65 | + | |
66 | + | |
67 | +\begin{tikzpicture} | |
68 | +\draw (0,0) .. controls (6,1) and (9,1) .. | |
69 | +node[near start,sloped,above] {near start} | |
70 | +node {midway} | |
71 | +node[very near end,sloped,below] {very near end} (12,0); | |
72 | +\end{tikzpicture} | |
73 | + | |
74 | + | |
75 | + | |
76 | + | |
77 | +\begin{tikzpicture} | |
78 | +\draw (0,0) -- (1,1); | |
79 | +\end{tikzpicture} | |
80 | + | |
81 | +\begin{tikzpicture} | |
82 | +\path ( 0,2) node [shape=circle,draw] {} | |
83 | +( 0,1) node [shape=circle,draw] {} | |
84 | +( 0,0) node [shape=circle,draw] {} | |
85 | +( 1,1) node [shape=rectangle,draw] {} | |
86 | +(-1,1) node [shape=rectangle,draw] {}; | |
87 | +\end{tikzpicture} | |
88 | + | |
89 | +\begin{tikzpicture} | |
90 | +[place/.style={circle,draw=blue!50,fill=blue!20,thick}, | |
91 | +transition/.style={rectangle,draw=black!50,fill=black!20,thick}] | |
92 | +\node at ( 0,2) [place] {}; | |
93 | +\node at ( 0,1) [place] {}; | |
94 | +\node at ( 0,0) [place] {}; | |
95 | +\node at ( 1,1) [transition] {}; | |
96 | +\node at (-1,1) [transition] {}; | |
97 | +\end{tikzpicture} | |
98 | + | |
99 | + | |
100 | + | |
101 | +\begin{tikzpicture}[auto,bend right] | |
102 | +\node (a) at (0:1) {$0^\circ$}; | |
103 | +\node (b) at (120:1) {$120^\circ$}; | |
104 | +\node (c) at (240:1) {$240^\circ$}; | |
105 | +\draw (a) to node {1} node [swap] {1’} (b) | |
106 | +(b) to node {2} node [swap] {2’} (c) | |
107 | +(c) to node {3} node [swap] {3’} (a); | |
108 | +\end{tikzpicture} | |
109 | + | |
110 | + | |
111 | +\tikz \draw[line width=2pt,color=red] (1,0) -- (0,0) -- (0,1) -- | |
112 | +cycle; | |
113 | + | |
114 | + | |
115 | +\begin{tikzpicture} | |
116 | +\node {root} | |
117 | +child {node {left}} | |
118 | +child {node {right} | |
119 | +child {node {child}} | |
120 | +child {node {child}} | |
121 | +}; | |
122 | +\end{tikzpicture} | |
123 | + | |
124 | + | |
125 | +\begin{tikzpicture} | |
126 | +[edge from parent fork down, sibling distance=15mm, level distance=15mm, | |
127 | +every node/.style={fill=red!30,rounded corners}, | |
128 | +edge from parent/.style={red,-o,thick,draw}] | |
129 | +\node {root} | |
130 | +child {node {left}} | |
131 | +child {node {right} | |
132 | +child {node {child}} | |
133 | +child {node {child}} | |
134 | +}; | |
135 | +\end{tikzpicture} | |
136 | + | |
137 | + | |
138 | + | |
139 | +\begin{tikzpicture} | |
140 | +[parent anchor=east,child anchor=west,grow=east, | |
141 | +sibling distance=15mm, level distance=15mm, | |
142 | +every node/.style={ball color=red,circle,text=white}, | |
143 | +edge from parent/.style={draw,dashed,thick,red}] | |
144 | +\node {root} | |
145 | +child {node {left}} | |
146 | +child {node {right} | |
147 | +child {node {child}} | |
148 | +child {node {child}} | |
149 | +}; | |
150 | +\end{tikzpicture} | |
151 | + | |
152 | +\tikz \graph [grow down, branch right] { | |
153 | +root -> { left, right -> {child, child} } | |
154 | +}; | |
155 | + | |
156 | + | |
157 | + | |
158 | + | |
159 | + | |
160 | +\tikz \draw (0,0) -- (1,1) | |
161 | +{[rounded corners] -- (2,0) -- (3,1)} | |
162 | +-- (3,0) -- (2,1); | |
163 | + | |
164 | + | |
165 | + | |
166 | +\begin{tikzpicture}[->] | |
167 | +\draw (0,0) -- (1,0); | |
168 | +\draw (0,0) -- (0,1,0); | |
169 | +\draw (0,0) -- (0,0,1); | |
170 | +\end{tikzpicture} | |
171 | + | |
172 | + | |
173 | +\tikz { | |
174 | +\node [circle,draw] (A) {A}; | |
175 | +\node [circle,draw] (B) [right=of A] {B}; | |
176 | +\draw [draw = blue, thick, | |
177 | +arrows={ | |
178 | +Computer Modern Rightarrow [sep] | |
179 | +- Latex[blue!50,length=8pt,bend,line width=0pt] | |
180 | +Stealth[length=8pt,open,bend,sep]}] | |
181 | +(A) edge [bend left=45] (B) | |
182 | +(B) edge [in=-110, out=-70,looseness=8] (B); | |
183 | +} | |
184 | + | |
185 | + | |
186 | + | |
187 | +\begin{tikzpicture} | |
188 | +\draw[->] (0,0) -- (1,0); | |
189 | +\draw[>-Stealth] (0,0.3) -- (1,0.3); | |
190 | +\end{tikzpicture} | |
191 | + | |
192 | +\begin{tikzpicture} | |
193 | +\draw[-{Stealth[red]}] (0,0) -- (1,0); | |
194 | +\end{tikzpicture} | |
195 | + | |
196 | + | |
197 | +\tikz [ultra thick] \draw [red, arrows = {-Stealth[color=blue]}] (0,0) -- (1,0); | |
198 | + | |
199 | +\tikz [ultra thick] \draw [draw=red, fill=red!50, | |
200 | +arrows = {-Stealth[length=15pt, fill=pgffillcolor]}] | |
201 | +(0,0) -- (1,1) -- (2,0); | |
202 | + | |
203 | + | |
204 | + | |
205 | +% \tikz [nodes={text height=.7em, text depth=.2em, | |
206 | +% draw=black!20, thick, fill=white, font=\footnotesize}, | |
207 | +% % >=spaced stealth’, | |
208 | +% rounded corners, semithick] | |
209 | +% \graph [layered layout, level distance=1cm, sibling sep=.5em, sibling distance=1cm] { | |
210 | +% "5th Edition" -> { "6th Edition", "PWB 1.0" }; | |
211 | +% }; | |
212 | + | |
213 | + | |
214 | +\end{document} | |
215 | + |