Debian Codegraph @

texmf-dist/doc/latex/pgfornament/tikzrput.tex

raw
1 % !TEX TS-program = lualatex
2 \RequirePackage{luatex85}
3 \RequirePackage{silence}
4 \WarningsOff[latex]
5 \WarningsOff[latexfont]
6 \documentclass[a4paper]{tufte-handout}
7 %---------%---------%---------%---------%---------%---------%---------%---------
8 \usepackage{fontspec}
9 \setmainfont{texgyrepagella}%
10 [ Extension = .otf ,
11 UprightFont = *-regular,
12 ItalicFont = *-italic,
13 BoldFont = *-bold,
14 BoldItalicFont = *-bolditalic,
15 Ligatures=TeX,
16 Numbers={Lowercase,Monospaced}]
17 \setsansfont{texgyreheros}%
18 [ Extension = .otf,
19 UprightFont = *-regular ,
20 ItalicFont = *-italic ,
21 BoldFont = *-bold ,
22 BoldItalicFont = *-bolditalic]
23 \setmonofont{lmmono10-regular.otf}%
24 [ Numbers={Lining,SlashedZero},
25 ItalicFont=lmmonoslant10-regular.otf,
26 BoldFont=lmmonolt10-bold.otf,
27 BoldItalicFont=lmmonolt10-boldoblique.otf]
28 \newfontfamily\ttcondensed{lmmonoltcond10-regular.otf}
29
30 \usepackage[dvipsnames,svgnames]{xcolor}
31 \usepackage{graphicx,rotating}
32 \usepackage[object=vectorian]{pgfornament}
33 \usepackage{tkzexample,tikzrput,pict2e,picture}
34 \usetikzlibrary{calc}
35 \usepackage{calc}
36 \usepackage{fancyvrb}
37 \fvset{fontsize=\normalsize}
38 \hypersetup{%
39 pdfauthor = {Alain Matthes},
40 pdftitle = {tikzrput},
41 pdfsubject = {Documentation de tikzrput},
42 colorlinks = true,
43 linkcolor = orange,
44 urlcolor = blue}
45
46 \renewenvironment{theindex}
47 {\renewcommand\item{\par\hangindent 40pt}
48 \renewcommand\subitem{\item\hspace*{20pt}}
49 \renewcommand\subsubitem{\item\hspace*{30pt}}
50 \renewcommand\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
51 \section{\indexname}
52 \begin{multicols}{2}%
53 \parindent=0pt
54 \small%
55 }
56 {\end{multicols}%
57 }
58
59 %\usetikzlibrary{external}\tikzexternalize
60
61 \makeatletter
62 \let\strippt\strip@pt
63 \makeatother
64
65 \title{The tikzrput package \thanks{\url{http://altermundus.com/pages/tkz/tikzrput/}}}
66
67 \author{Alain Matthes}
68
69 \usepackage{fourier,lmodern}
70
71 %\geometry{showframe} % display margins for debugging page layout
72
73 \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
74 \graphicspath{{graphics/}} % set of paths to search for images
75 \usepackage{amsmath,lipsum} % extended mathematics
76 \usepackage{array,booktabs} % book-quality tables
77 \usepackage{multicol} % multiple column layout facilities
78 \usepackage[babel=true]{microtype}
79 \usepackage[english]{babel}
80
81 % Standardize command font styles and environments
82 \newcommand{\docparen}[1]{\ensuremath{(#1)}}% optional command argument
83
84 \definecolor{fondpaille}{cmyk}{0,0,0.1,0}
85 \pagecolor{fondpaille}
86 \color{Maroon}
87 \colorlet{graphicbackground}{fondpaille}
88 \colorlet{numbackground}{fondpaille}
89 \colorlet{codebackground}{Periwinkle!10}
90 \colorlet{codeonlybackground}{Periwinkle!10}
91 \colorlet{textcodecolor}{MidnightBlue} % Maroon
92 \colorlet{numcolor}{gray}
93 \newcommand*{\tkzname}[1]{\textbf{\texttt{\textcolor{orange!50!Maroon}{#1}}}}
94 \newcommand*{\PGF}{\tkzname{PGF}}
95 \newcommand*{\TIKZ}{\tkzname{Ti\emph{k}Z}}
96 \newcommand*{\pdf}{\textsc{pdf}}
97 \newcommand*{\pgfname}{\textsc{pgf}}
98 \newcommand*{\tikzname}{Ti\emph{k}Z}
99 \newcommand*{\pstricks}{\textsc{pstricks}} %
100 \newcommand*{\tkzAttention}[3]{\ \\\llap{\textcolor{#3}{#1\hskip #2}}}
101 \newcommand*{\tkzHand}{\ \\\llap{\textcolor{red}{\lefthand\hskip1em}}}
102 \newcommand*{\tkzHandBomb}{\ \\\llap{\textcolor{red}{\lefthand\ \bomb\hskip1em}}}
103 \newcommand*{\tkzBomb}{\ \\\llap{\textcolor{red}{\bomb\hskip1em}}}
104 \newcommand*{\tkzTwoBomb}{\ \\\llap{\textcolor{red}{\bomb\ \bomb\hskip1em}}}
105 \newcommand*{\tkzimp}[1]{\textbf{#1}}
106 \newcommand*{\tkzcname}[1]{\textbf{\texttt{\textcolor{Maroon}{\textbackslash#1}}}}
107 \newcommand*{\tkzhname}[1]{\textbf{\texttt{\textcolor{Maroon}{\textbackslash#1}}}}
108 \providecommand\LaTeX{L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em\TeX}
109
110 % Macros for typesetting the documentation
111 \newcommand{\hlred}[1]{\textcolor{Maroon}{#1}}% prints in red
112 \newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}
113 \newcommand{\hairsp}{\hspace{1pt}}% hair space
114 \newcommand{\hquad}{\hskip0.5em\relax}% half quad space
115 \newcommand{\TODO}{\textcolor{red}{\bf TODO!}\xspace}
116
117 \newcommand{\tuftebs}{\symbol{'134}}% a backslash in tt type in OT1/T1
118 \newcommand{\doccmdnoindex}[2][]{\texttt{\tuftebs#2}}% command name -- adds backslash automatically (and doesn't add cmd to the index)
119 \newcommand{\doccmddef}[2][]{%
120 \hlred{\texttt{\tuftebs#2}}\label{cmd:#2}%
121 \ifthenelse{\isempty{#1}}%
122 {% add the command to the index
123 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2}}% command name
124 }%
125 {% add the command and package to the index
126 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2} (\texttt{#1} package)}% command name
127 \index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}% package name
128 }%
129 }% command name -- adds backslash automatically
130
131 \newcommand{\doccmd}[2][]{%
132 \texttt{\tuftebs#2}%
133 \ifthenelse{\isempty{#1}}%
134 {% add the command to the index
135 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2}}% command name
136 }%
137 {% add the command and package to the index
138 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2} (\texttt{#1} package)}% command name
139 \index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}% package name
140 }%
141 }% command name -- adds backslash automatically
142
143 \newcommand{\docopt}[1]{\ensuremath{\protect\langle}\textrm{\textit{#1}}\ensuremath{\protect\rangle}}% optional command argument
144
145 \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument
146
147 \newenvironment{docspec}{\begin{quotation}\ttfamily\parskip0pt\parindent0pt\ignorespaces}{\end{quotation}}% command specification environment
148
149 \newcommand{\docdist}[1]{\texttt{#1}\index{#1 distribution@\texttt{#1} distribution}\index{distributions!#1@\texttt{#1}}}% environment name
150
151 \newcommand{\docenv}[1]{\texttt{#1}\index{#1 environment@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
152
153 \newcommand{\docenvdef}[1]{\hlred{\texttt{#1}}\label{env:#1}\index{#1 environment@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
154
155 \newcommand{\docoption}[2]{\texttt{#1}\index{#1 option@\texttt{#1} option}\index{options(#2)!#1@\texttt{#1}}}% package name
156
157 \newcommand{\docpkg}[1]{\texttt{#1}\index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}}% package name
158
159 \newcommand{\doccls}[1]{\texttt{#1}}% document class name
160
161 \newcommand{\docclsopt}[1]{\texttt{#1}\index{#1 class option@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name
162
163 \newcommand{\docclsoptdef}[1]{\hlred{\texttt{#1}}\label{clsopt:#1}\index{#1 class option@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name defined
164
165 \newcommand{\docmsg}[2]{\bigskip\begin{fullwidth}\noindent\ttfamily#1\end{fullwidth}\medskip\par\noindent#2}
166
167 \newcommand{\docfilehook}[2]{\texttt{#1}\index{file hooks!#2}\index{#1@\texttt{#1}}}
168 \newcommand{\doccounter}[1]{\texttt{#1}\index{#1 counter@\texttt{#1} counter}}
169
170 \newcommand{\docStyle}[1]{\texttt{#1}\index{#1 style(\TIKZ)@\texttt{#1} style(\TIKZ)}\index{styles(\TIKZ)!#1@\texttt{#1}}}% package name
171
172 \newcommand*{\Imacro}[1]{\index{#1_1@\texttt{\textbackslash#1}}}%n
173
174 \newcommand{\docfamily}[1]{\texttt{#1}\index{#1 family@\texttt{#1} family}\index{families!#1@\texttt{#1}}}% package name
175
176 \newcommand{\docvo}[1]{\texttt{#1}\index{#1 vector ornament@\texttt{#1} vector ornament}\index{vector ornaments!#1@\texttt{#1}}}% package name
177 \usepackage{makeidx}
178 \makeindex
179
180 \begin{document}
181
182 \maketitle
183
184 \begin{abstract}
185 \noindent\lefthand\ (Version 0.2)
186
187 This document describes the \LaTeX\ package \emph{\docpkg{tikzrput}}.
188 It also provides some examples and comments on the package's use. Firstly, I would like to thank a lot of contributors of the site tex.stackexchange \sidenote{ \url{ http://tex.stackexchange.com/ }}. The idea to create this package comes from a question on tex.stackexchange. I would like to thanks also \textbf{Till Tantau} for creating the wonderful tool \href{http://sourceforge.net/projects/pgf/}{Ti\emph{k}Z}.
189
190
191 \end{abstract}
192
193
194
195 \section{How to install the package} % (fold)
196 \label{sec:how_to_install}
197 With \docdist{TeXLive}, if you need to install it by yourself, just download the file \docpkg{tikzrput.sty}, and place it in your TDS directory (~/texmf/tex/latex for Unix-like systems).
198
199 With \docdist{MiKTeX}, copy the file \docpkg{tikzrput.sty} into \verb+C:\texmf\tex\latex+, then
200 run {\color{red}\texttt{MiKTeX Options}} . In the {\color{black}\texttt{File name database}} section, click on {\color{red}\texttt{Refresh now}}.
201 % section how_to_install (end)
202
203
204 \section{How to use the package} % (fold)
205 \label{sec:how_to_use}
206 You only need to add \\
207 {\color{black}\verb+\usepackage{tikzrput}+} in your preamble. The tikzrput package loads \TIKZ. If \docpkg{pstricks}\index{pstricks} is already loaded, the macro \Imacro{rput} is unchanged. The macro \doccmd{rput} of this package is only active with {\color{red}\texttt{pdflatex}\index{pdflatex}}.
208
209
210 \section{The macro} % (fold)
211 \label{sec:the_main_macro}
212 The \doccmd{rput} macro can be used to place objects.
213 The simple form of the \doccmd{rput} macro used below works like the \Verb|\put| macro of the \LaTeX\ \docenv{picture} \index{picture} environment and gives you the ability to place and rotate whatever you want.
214
215 Below you can see the common useage of this command. \Verb|\rput(x,y){text}| to print text at the ref point \Verb|(x,y)|.
216 In the following example the usage of this command is shown practically.
217
218 \begin{tkzexample}[code only]
219 \documentclass{article}
220 \usepackage{tikzrput}
221 \begin{document}
222 ...
223 see code below
224 ...
225 \end{document}
226 \end{tkzexample}
227
228 \begin{tkzexample}[latex=5cm]
229 baseline->\rput(12,1){%
230 \begin{tikzpicture}
231 \node[draw]{First Example};
232 \end{tikzpicture}}
233 \rput(12,0){\fbox{%
234 Second example}}
235 \end{tkzexample}
236
237 \vspace{12pt}
238
239
240 "(x,y)" is the position where "stuff" will be placed."Refpoint" gives the reference point of stuff (text or picture and so on).
241
242 \begin{tkzexample}[latex=5cm]
243 baseline->
244 \rput{45}(12,0){\fbox{Stuff}}
245 \end{tkzexample}
246
247
248
249 The specifications of the \Verb|\rput| command is:
250 \begin{docspec}
251 \large
252 \color{blue!50!black} \doccmd{rput[\docopt{options}]\{\docopt{rotation}\}(\docarg{refpoint})\{\docarg{stuff}\}}
253 \end{docspec}
254
255 The first mandatory argument (in parenthesis) is the coordinate pair of the point where the stuff is placed.\\
256 The second mandatory argument (in curly braces) is the stuff to place.\\
257
258 The first optional argument is given in brackets and it determines the position of the bounding box of the object to place with respect to the "refpoint" (in parenthesis). The admissible values are mc, t, tl, tr, b, bl, br and B, Br, Bl. The default is mc meaning middle – center , t is for top of the box, b for bottom and B for baseline; r and l are for right and left. We can call these points, the anchors.\\
259
260 The second optional argument is given in curly braces. It is a number that stands for the rotation angle.
261
262
263 What is the baseline ?
264
265 As you probably know \TeX\ puts all its objects in boxes. A box has a baseline that determines height and depth.
266 \begin{marginfigure}
267 \centering
268 \includegraphics[width=1\textwidth]{baseline.png}
269 \caption{The baseline}
270 \label{fig:baseline}
271 \end{marginfigure}
272
273 \TeX\ uses the baselines for fixing together the boxes to others. A box has ten anchors:\\
274 - mc the middle-center, the center point,\\
275 - bl br tl tr are the 4 corners (for bottom left and bottom right top left and top right),\\
276 - two anchors Bl and Br (Baseline left and right),\\
277 - the vertical line through the middle-center defines three other points t, B and b on the top line, the baseline and the bottom line.
278
279 \doccmd{rput} command will place the box defined by using the reference point and placing on this, one of the ten anchors box.
280 \begin{marginfigure}
281 \centering
282 \includegraphics[width=1\textwidth]{TeX_box.png}
283 \caption{Anchors of a box}
284 \label{}
285 \end{marginfigure}
286
287 \newpage
288 \subsection{Arguments and options} % (fold)
289 \label{sub:the_options}
290
291 Available anchors:
292
293 \begin{table}[h]\index{tikzrput!options}
294 { \small \begin{tabular}{lll}
295 \toprule
296 name & default & definition \\
297 \midrule
298 \docoption{mc}{rput} & \{ \} & middle center mc or empty\\
299 \docoption{B}{rput} & \{ \} & baseline center\\
300 \docoption{Bl}{rput} & \{ \} & baseline left \\
301 \docoption{Br}{rput} & \{ \} & baseline right \\
302 \docoption{t}{rput} & \{ \} & top center \\
303 \docoption{tl}{rput} & \{ \} & top left \\
304 \docoption{tr}{rput} & \{ \} & top right\\
305 \docoption{b}{rput} & \{ \} & bottom center \\
306 \docoption{bl}{rput} & \{ \} & bottom left\\
307 \docoption{br}{rput} & \{ \} & bottom right \\
308 \midrule
309 \docoption{rotation}{rput} & 0 & angle of rotation around ref point \\
310 \bottomrule
311 \end{tabular} }
312 \caption{List of options for the pgfornament macro.}
313 \label{tab:pgfornament-options}
314 \end{table}
315
316 The angle of \docopt{rotation} is expressed in degrees...\\
317 The \docarg{refpoint} is defined by two coordinates \Verb|(x,y)|.
318 % subsection the_options (end)
319
320
321 \newpage
322
323 \section{Examples} % (fold)
324 \label{sec:examples}
325 \subsection{ex 1 Ornaments patterns} % (fold)
326 \label{sub:ex_1}
327
328
329 \begin{tkzexample}[code only,small]
330 \hspace{1cm}%
331 \rput[r](-3pt,3pt){\pgfornament[scale=.2]{72}}
332 {Ornaments patterns}%
333 \rput[l](3pt,3pt){\large\pgfornament[scale=.2]{73}}
334 \end{tkzexample}
335 \begin{marginfigure}
336 \hspace{1cm}\rput[r](-3pt,3pt)
337 {\pgfornament[scale=.2]{72}}
338 {Ornaments patterns}%
339 \rput[l](3pt,3pt)
340 {\large\pgfornament[scale=.2]{73}}
341 \end{marginfigure}
342 % subsection ex_1 (end)
343 % section examples (end)
344
345 \subsection{ex 2 Ornaments} % (fold)
346 \label{sub:ex_2_ornaments}
347
348 \begin{tkzexample}[code only,small]
349 \documentclass{scrartcl}
350 \usepackage[utf8]{inputenc}
351 \usepackage[T1]{fontenc}
352 \usepackage[dvipsnames]{xcolor}
353 \usepackage{tikzrput}
354 \usepackage{pgfornament}
355 \begin{document}
356 \tikzset{pgfornamentstyle/.style={%
357 draw = Periwinkle,
358 fill = SpringGreen}}
359 \unitlength=1cm
360 \begin{picture}(10,10)%
361 \color{blue}%
362 \put(0,0){\framebox(10,10){%
363 \rput[tl](-3,5){\pgfornament[width=6cm]{71}}%
364 \rput[bl](-3,-5){\pgfornament[width=6cm,
365 symmetry=h]{71}}%
366 \rput[tl](-5,5){\pgfornament[width=2cm]{63}}%
367 \rput[tr](5,5){\pgfornament[width=2cm,
368 symmetry=v]{63}}%
369 \rput[bl](-5,-5){\pgfornament[width=2cm,
370 symmetry=h]{63}}%
371 \rput[br](5,-5){\pgfornament[width=2cm,
372 symmetry=c]{63}}%
373 \rput[bl]{-90}(-5,3){\pgfornament[width=6cm]{46}}%
374 \rput[bl]{90}(5,-3){\pgfornament[width=6cm]{46}}%
375 \rput(0,0){\Huge \color{MidnightBlue} Ornaments}%
376 \rput[t](0,-0.5){\pgfornament[width=5cm]{75}}%
377 \rput[b](0,0.5){\pgfornament[width=5cm]{69}}%
378 \rput[tr]{-30}(-1,2.5){\pgfornament[width=2cm]{57}}%
379 \rput[tl]{30}(1,2.5){\pgfornament[width=2cm,symmetry=v]{57}}}}%
380 \end{picture}
381 \end{document}
382 \end{tkzexample}
383 \begin{marginfigure}
384 \centering
385 \includegraphics[width=1\textwidth]{ornaments.png}
386 \caption{caption}
387 \label{fig:ornaments}
388 \end{marginfigure}
389 % subsection ex_2_blue_ornament (end)
390
391 \subsection{ex3 Picture} % (fold)
392 \label{sub:ex3_picture}
393 \begin{tkzexample}[code only,small]
394 \documentclass{article}
395 \usepackage[utf8]{inputenc}
396 \usepackage[T1]{fontenc}
397 \usepackage[dvipsnames]{xcolor}
398 \usepackage{pict2e,tikzrput}
399 \usepackage[calc]{picture}
400 \usepackage[]{fourier}
401 \begin{document}
402
403 \setlength{\parindent}{0pt}
404 \setlength{\unitlength}{1cm}
405 \begin{picture}(3,3)
406 \put(0,0){\framebox(3,3){}}%
407 \color{blue}%
408 \thicklines
409 \put(0,0){\line(1,1){3}}
410 \color{MidnightBlue}%
411 \rput[b]{45}(2,2){\large \textbf{line}}
412 \end{picture}%
413
414 \end{document}
415 \end{tkzexample}
416 \begin{marginfigure}
417 \centering
418 \setlength{\parindent}{0pt}
419 \setlength{\unitlength}{1cm}
420 \begin{picture}(3,3)
421 \put(0,0){\framebox(3,3){}}%
422 \color{blue}%
423 \thicklines
424 \put(0,0){\line(1,1){3}}
425 \color{MidnightBlue}%
426 \rput[b]{45}(2,2){\large \textbf{line}}
427 \end{picture}%
428 \caption{with picture}
429 \label{fig:picture}
430 \end{marginfigure}
431 % subsection ex3_picture (end)
432
433 \subsection{ex 4 Tikzpicture} % (fold)
434 \label{sub:ex_4_tikzpicture}
435 \begin{tkzexample}[code only,small]
436 \documentclass{article}
437 \usepackage[utf8]{inputenc}
438 \usepackage[T1]{fontenc}
439 \usepackage[dvipsnames]{xcolor}
440 \usepackage{pict2e,tikzrput}
441 \usepackage[calc]{picture}
442 \usepackage{fourier}
443 \begin{document}
444
445 \hrule
446 baseline%
447 \begin{tikzpicture}[baseline=(current bounding box.south west)]
448 \draw[help lines] (0,0) grid (3,3) ;
449 \draw[use as bounding box,color=CadetBlue](0,0)rectangle(3,3);
450 \rput (2,2){Perfect}%
451 \end{tikzpicture}%
452 baseline%
453
454 \end{document}
455 \end{tkzexample}
456 \begin{marginfigure}
457 \hrule
458 baseline%
459 \begin{tikzpicture}[baseline=(current bounding box.south west)]
460 \draw[help lines] (0,0) grid (3,3) ;
461 \draw[use as bounding box,color=CadetBlue] (0,0) rectangle (3,3) ;
462 \rput (2,2){Perfect}%
463 \end{tikzpicture}%
464 baseline%
465 \caption{with tikzpicture}
466 \label{fig:tikzpicture}
467 \end{marginfigure}
468 % subsection ex_4_tikzpicture (end)
469 \newpage
470 \subsection{ex 5 From pstricks doc} % (fold)
471 \label{sub:ex_5_from_pstricks_doc}
472 \begin{marginfigure}
473 \begin{tikzpicture}[baseline=(current bounding box.north)]
474 \draw[help lines] (-1,0) grid (1,5) ;
475 \foreach \x/\y in {0/5,-1/3,1/2,0.5/1} {%
476 \rput(\x,\y ){\tikz\draw[fill=red] circle(2pt);};}
477 \rput(0,5){Center,Middle}
478 \rput[bl](-1,3){$\underbrace{\text{bottom,left}}_{\text{Really!}}$}
479 \rput[Br](1,2){$\underbrace{\text{Baseline,right}}_{\text{Really!}}$}
480 \rput[tr]{45}(0.5,1)
481 {\parbox{5cm}{\flushright Rotated\\
482 by $45^{\circ}$}}
483 \end{tikzpicture}
484 \caption{from pstricks}
485 \label{fig:from pstricks}
486 \end{marginfigure}
487 As we have already seen, the \Verb+{\rput}+ macro can be used to place objects.
488 The second mandatory argument (in curly braces) is the stuff to place the first
489 mandatory argument (in parenthesis) is the coordinate pair of the point where
490 the stuff is placed.
491 Now we turn to the optional arguments of the \Verb+{\rput}+ macro.
492 The first one is given in brackets. It determines the justification of the
493 bounding box of the object to place with respect to the point given in paren-
494 thesis. The admissible values are the same as the values for the option origin
495 of the \verb+{\includegraphics}+ macro. For an instance \Verb+{[br]}+ for bottom-right.
496 The default is mc meaning middle - center.
497 The second optional argument is given in curly braces just before the left
498 parenthesis. It is a number that stands for the rotation angle as illustrated in
499 the last instance of the \Verb+{\rput}+ macro on the slide.
500 The two optional arguments make \Verb+{\rput}+ more
501 exible than the \Verb+{\put}+ macro
502 of the picture environment.
503 \rput[b](-2,0){%
504 \begin{tikzpicture}[%
505 every node/.style={inner sep=0pt}]
506 \tikzset{image/.style={circle,
507 fill=red,
508 minimum size = 4pt,
509 inner sep = 0pt,
510 outer sep = 1pt}
511 }
512 \node[inner sep = 1cm] (wrapper){\tikz
513 \node(image) {\pgfornament[scale=1.5,opacity=0.2]{1}};};
514 \end{tikzpicture}}
515
516 \begin{tkzexample}[code only,small]
517 \rput[b](-2,0){%
518 \begin{tikzpicture}[%
519 every node/.style={inner sep=0pt}]
520 \tikzset{image/.style={circle,
521 fill=red,
522 minimum size = 4pt,
523 inner sep = 0pt,
524 outer sep = 1pt}
525 }
526 \node[inner sep = 1cm] (wrapper){\tikz
527 \node(image) {\pgfornament[scale=1.5,opacity=0.2]{1}};};
528 \end{tikzpicture}}
529 \end{tkzexample}
530 % subsection ex_5_from_pstricks_doc (end)
531
532 \subsection{ex 6 From pstricks again} % (fold)
533 \label{sub:ex_6_from_pstricks_again}
534 \def\myEye{
535 \begin{tikzpicture}
536 \filldraw (-0.4,1.5)--(0.7,1.8)--(0.2,2.2)--(-0.5,1.6)--cycle;
537 \draw [clip] (0,0) circle [x radius=.8cm, y radius=1.5cm];
538 \fill[MidnightBlue] (0,-1) circle [radius=1cm];
539 \end{tikzpicture}
540 }
541 \begin{marginfigure}
542 \rput{30}(2,-6){Tu as de beaux yeux !}
543 \rput(3,-3){\myEye}
544 \rput(1,-3){\reflectbox{\myEye}}
545 \caption{from pstricks again}
546 \label{fig:from pstricks again}
547 \end{marginfigure}
548 \begin{tkzexample}[code only,small]
549 \documentclass{scrartcl}
550 \PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
551 \usepackage{tikzrput}
552 \begin{document}
553
554 \rput{30}(7,-5){Tu as de beaux yeux !}
555 \rput(8,-2){\myEye}
556 \rput(6,-2){\reflectbox{\myEye}}
557 \end{document}
558 \end{tkzexample}
559 \def\myEye{
560 \begin{tikzpicture}
561 \filldraw (-0.4,1.5)--(0.7,1.8)--(0.2,2.2)--(-0.5,1.6)--cycle;
562 \draw [clip] (0,0) circle [x radius=.8cm, y radius=1.5cm];
563 \fill[MidnightBlue] (0,-1) circle [radius=1cm];
564 \end{tikzpicture}
565 }
566
567
568 % subsection ex_6_from_pstricks_again (end)
569
570 \subsection{ex 7 Ancres} % (fold)
571 \label{sub:ex_7_ancres}
572 Utilisation des ancres
573
574 \begin{tkzexample}[code only,small]
575 \documentclass{scrartcl}
576 \PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
577 \usepackage{tikzrput}
578 \begin{document}
579 -->\rput[] (5,0){\tikz \draw[blue] (0,0) rectangle +(1,2);}
580 \rput[tl] (5,0){\tikz \draw[red] (0,0) rectangle +(1,2);}
581 \rput[br] (5,0){\tikz \draw[green] (0,0) rectangle +(1,2);}
582 \rput[Bl] (5,0){\tikz \draw[orange](0,0) rectangle +(1,2);}
583 \end{document}
584 \end{tkzexample}
585 \begin{marginfigure}
586 -->\rput[] (5,0) {\tikz \draw[blue] (0,0) rectangle +(1,2);}
587 \rput[tl] (5,0){\tikz \draw[red] (0,0) rectangle +(1,2);}
588 \rput[br] (5,0){\tikz \draw[green] (0,0) rectangle +(1,2);}
589 \rput[Bl] (5,0){\tikz \draw[orange](0,0) rectangle +(1,2);}
590 \caption{ancres}
591 \label{fig:ancres}
592 \end{marginfigure}
593
594 % subsection ex_7_ancres (end)
595
596
597 \newpage
598
599 \printindex
600
601 \end{document}
602
603
604
605
606
607