summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/visualtikz/Source/tkzfig.tex
blob: 13a4d553b4f1f74c5b9e6941b8d3e24fcddf4407 (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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
\SbSSCT{Dans le texte}{In the text}


\subsubsection{Sans option de décalage}

\RRR{12-2}

\TFRGB{dessin directement  dans le texte}{picture in the text}  \tikz \draw[blue] (0,0) rectangle(2,2); \tikz \draw[blue] (0,0) circle (1);\TFRGB{ici est inclus le code suivant}{here is the following code} : \BS{tikz} \BS{Draw} (0,0) rectangle(2,2);\BS{tikz} \BS{Draw} (0,0) circle (1);
\bigskip

\subsubsection{Avec décalage nul}

\TFRGB{dessin directement  dans le texte}{picture in the text}  \tikz[baseline=0pt] \draw[blue] (0,0) rectangle(2,2); \tikz[baseline=0pt] \draw[blue] (0,0) circle (1);\TFRGB{ici est inclus le code suivant}{here is the following code} : \BS{tikz}[\RDD{baseline}=0pt] \BS{Draw} (0,0) rectangle(2,2);\BS{tikz}[\RDD{baseline}=0pt] \BS{Draw} (0,0) circle (1);
\bigskip


\subsubsection{Avec décalage }

\TFRGB{dessin directement  dans le texte}{picture in the text}  \tikz[baseline=1cm] \draw[blue] (0,0) rectangle(2,2); \tikz[baseline=1cm] \draw[blue] (0,0) circle (1);\TFRGB{ici est inclus le code suivant}{here is the following code} : \BS{tikz}[\RDD{baseline}=1cm] \BS{Draw} (0,0) rectangle(2,2);\BS{tikz}[\RDD{baseline}=1cm] \BS{Draw} (0,0) circle (1);


\newpage
%----------------------------------------------------------
\SbSSCT{Dans un environnement tikzpicture}{In a tikzpicture environment}

\RRR{12-1}

\begin{tabular}{|l|l|} \hline  
 
\TFRGB{texte avant}{text before} 
\begin{tikzpicture}[blue]
\draw (0,0) rectangle(2,2); 
 \draw (0,0) circle (1);
\end{tikzpicture}
\TFRGB{texte après}{text after} 
&  
\parbox[b]{8cm}{
\TFRGB{texte avant}{text before} \\
\ESS{begin\AC{tikzpicture}}[blue] \\
\BS{draw} (0,0) rectangle(2,2);  \\
\BS{draw} (0,0) circle (1); \\
\ESS{end\AC{tikzpicture}}\\
\TFRGB{texte après}{text after} \\
}
\\ \hline 
\end{tabular} 

\bigskip


\begin{tabular}{|l|l|} \hline 
\TFRGB{texte avant}{text before} 
\begin{tikzpicture}[blue,baseline=0pt]
\draw (0,0) rectangle(2,2); 
 \draw (0,0) circle (1);
\end{tikzpicture}
\TFRGB{texte après}{text after} 
&  
\parbox[c]{8cm}{
\TFRGB{texte avant}{text before} \\
\BS{begin}\AC{tikzpicture}[blue,\RDD{baseline}=0pt] \\
\BS{draw} (0,0) rectangle(2,2);  \\
\BS{draw} (0,0) circle (1); \\
\BS{end}\AC{tikzpicture} \\
\TFRGB{texte après}{text after} \\
}
\\ \hline 
\end{tabular} 

\bigskip

\begin{tabular}{|l|l|} \hline 
\TFRGB{texte avant}{text before} 
\begin{tikzpicture}[blue,baseline=1cm]
\draw (0,0) rectangle(2,2); 
 \draw (0,0) circle (1);
\end{tikzpicture}
\TFRGB{texte après}{text after} 
&  
\parbox[t]{8cm}{
\TFRGB{texte avant}{text before} \\
\BS{begin}\AC{tikzpicture}[blue,\RDD{baseline}=1cm] \\
\BS{draw} (0,0) rectangle(2,2);  \\
\BS{draw} (0,0) circle (1); \\
\BS{end}\AC{tikzpicture} \\
\TFRGB{texte après}{text after} \\
}
\\ \hline 
\end{tabular} 

\subsection{Dans un environnement fbox}



\begin{tabular}{|l|l|} \hline 
\TFRGB{texte avant}{text before}
\fbox{ 
\begin{tikzpicture}[blue,baseline=0pt]
\draw (0,0) rectangle(2,2); 
 \draw (0,0) circle (1);
\end{tikzpicture}}
\TFRGB{texte après}{text after} 
&  
\parbox[c]{8cm}{
\TFRGB{texte avant}{text before}\\
\BSS{fbox}\{ \\ 
\BS{begin}\AC{tikzpicture}[blue,\RDD{baseline}=0pt] \\
\BS{draw} (0,0) rectangle(2,2);  \\
\BS{draw} (0,0) circle (1); \\
\BS{end}\AC{tikzpicture} \\
 \}\\
\TFRGB{texte après}{text after} \\
}
\\ \hline 
\end{tabular}

\subsection{Modification du cadrage}

\begin{tabular}{|c|c|}  \hline  
\multicolumn{2}{|l|}{\BS{draw} [\RDD{use as bounding box}] (1,0) rectangle (2,1);}\\ 
\multicolumn{2}{|l|}{\BS{draw}[blue] (-1,0) - - (3,1);} \\\hline 
texte avant\begin{tikzpicture}
\draw [use as bounding box] (1,0) rectangle (2,1);
\draw[blue] (-1,0) - - (3,1);
\draw [red](1,0) rectangle (2,1);
\end{tikzpicture}texte après
&
texte avant 
\begin{tikzpicture}
\draw [use as bounding box] (0,0) rectangle (0,0);
\draw[blue] (-1,0) - - (3,1);
\draw [red](0,0) rectangle (0,0);
\end{tikzpicture}
texte après  
\\ \hline 
(1,0) rectangle (2,1) & (0,0) rectangle (0,0)
\\ \hline 
\end{tabular} 

\bigskip

\begin{tabular}{|c|c|} \hline
\multicolumn{2}{|l|}{texte avant. \BS{begin\AC{tikzpicture}} [\RDD{trim left}=1cm] }\\ 
\multicolumn{2}{|l|}{\BS{draw}[blue] (-1,0) - - (3,1); \BS{draw}[red] (0,0) grid (2,1);} \\
\multicolumn{2}{|l|}{ \BS{end\AC{tikzpicture}}texte après }\\ 
\hline 
  
texte avant.%
\begin{tikzpicture}[trim left=1cm]
\draw[blue] (-1,0) - - (3,1);
\draw [red](0,0) grid (2,1);
\end{tikzpicture}%
texte après
&  
texte avant.%
\begin{tikzpicture}[trim right= 1cm]
\draw[blue] (-1,0) - - (3,1);
\draw [red](0,0) grid(2,1);
\end{tikzpicture}%
texte après
\\ \hline  
[\RDD{trim left}=1cm]
&  
[\RDD{trim right}= 1cm]
\\ \hline 
\end{tabular} 


\SbSSCT{Coupure de l'image}{Clipping the picture}	

\begin{tabular}{|c|c|} \hline  
\tikzpicture[red]
\draw[help lines] (-2,-2) grid (2,2);
\draw[blue] (-1,-1) --(0,2) -- (1,-1) -- cycle;
\draw (0,0) circle (.5);
\draw (0,0) circle (1);
\draw (0,0) circle (1.5);
\endtikzpicture
&  
\tikzpicture[red]
\clip (-1,-1) --(0,2) -- (1,-1) -- cycle;
\draw[help lines] (-2,-2) grid (2,2);
\draw[blue] (-1,-1) --(0,2) -- (1,-1) -- cycle;
\draw (0,0) circle (.5);
\draw (0,0) circle (1);
\draw (0,0) circle (1.5);
\endtikzpicture
\\ \hline  
sans coupure
&  
\BSS{clip} (-1,-1) - -(0,2) - - (1,-1) - - cycle;
\\ \hline 
\end{tabular} 


\SbSSCT{Rognage partiel}{ Partial clipping}

\begin{tabular}{|c|c|} \hline  
 
\tikzpicture[red,scale=.7,baseline=0pt]
\draw[help lines] (-2,-2) grid (2,2);
\draw[blue] (-1.1,-0.2) rectangle (2,1.5);
\draw (0,0) circle (1.5);
\clip (-1.1,-0.2) rectangle (2,1.5);
\draw (0,0) circle (.5);
\draw (0,0) circle (1);
\endtikzpicture
& 
\parbox{8cm}{ 
\BS{tikzpicture}[red,scale=.7] \\
\BS{draw}[help lines] (-2,-2) grid (2,2); \\
\BS{draw}[blue] (-1.1,-0.2) rectangle (2,1.5); \\
\BS{draw} (0,0) circle (1.5); \\
\BSS{clip} (-1.1,-0.2) rectangle (2,1.5); \\
\BS{draw} (0,0) circle (.5); \\
\BS{draw} (0,0) circle (1); \\
\BS{endtikzpicture}} 
\\ \hline 
\end{tabular}

\subsubsection{Changement d'échelle}

\begin{tabular}{|c|c|} \hline  
\tikzpicture[blue]
\draw[help lines] (-2,-2) grid (2,2);
\draw (0,0) circle (.5);
\draw (0,0) circle (1);
\draw (0,0) circle (1.5);
\endtikzpicture
&  
\tikzpicture[blue,scale=.5]
\draw[help lines] (-2,-2) grid (2,2);
\draw (0,0) circle (.5);
\draw (0,0) circle (1);
\draw (0,0) circle (1.5);
\endtikzpicture
\\ \hline  
Taille normale
&  
\BS{tikzpicture}[blue,\RDD{scale}=.5]
\\ \hline 
\end{tabular}