Debian Codegraph @

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

raw
1 % !TEX TS-program = lualatex
2 %---------%---------%---------%---------%---------%---------%---------%---------
3 % First version created by Alain Matthes le 2012-02-22.
4 % Copyright (C) 2020 Alain Matthes
5 % This file may be distributed and/or modified
6 %
7 % 1. under the LaTeX Project Public License , either version 1.3
8 % of this license or (at your option) any later version and/or
9 % 2. under the GNU Public License.
10 %---------%---------%---------%---------%---------%---------%---------%---------
11 % Version 1.3 2024/08/14
12 \RequirePackage{luatex85}
13 \RequirePackage{silence}
14 \WarningsOff[latex]
15 \WarningsOff[latexfont]
16 \documentclass[a4paper,nofonts]{tufte-handout}
17 %---------%---------%---------%---------%---------%---------%---------%---------
18 \usepackage{fontspec}
19 \setmainfont{texgyrepagella}%
20 [ Extension = .otf ,
21 UprightFont = *-regular,
22 ItalicFont = *-italic,
23 BoldFont = *-bold,
24 BoldItalicFont = *-bolditalic,
25 Ligatures=TeX,
26 Numbers={Lowercase,Monospaced}]
27 \setsansfont{texgyreheros}%
28 [ Extension = .otf,
29 UprightFont = *-regular ,
30 ItalicFont = *-italic ,
31 BoldFont = *-bold ,
32 BoldItalicFont = *-bolditalic]
33 \setmonofont{lmmono10-regular.otf}%
34 [ Numbers={Lining,SlashedZero},
35 ItalicFont=lmmonoslant10-regular.otf,
36 BoldFont=lmmonolt10-bold.otf,
37 BoldItalicFont=lmmonolt10-boldoblique.otf]
38 \newfontfamily\ttcondensed{lmmonoltcond10-regular.otf}
39 %% (La)TeX font-related declarations:
40 \linespread{1.05}% Pagella needs more space between lines
41 \frenchspacing
42 %---------%---------%---------%---------%---------%---------%---------%---------
43 \usepackage[dvipsnames,svgnames]{xcolor}
44 \usepackage{graphicx,rotating}
45 \usepackage[object=vectorian]{pgfornament}
46 \usetikzlibrary{chains,
47 calc,
48 scopes,
49 decorations,
50 decorations.text,
51 decorations.markings,
52 positioning,
53 shapes.geometric}
54
55 \usepackage{tkzexample,tikzrput,pict2e,picture}
56
57 \usepackage{eso-pic,calc}
58 \usepackage{fancyvrb}
59 \usepackage{fourier}
60 \usepackage{amsmath,lipsum} % extended mathematics
61 \usepackage{array,booktabs} % book-quality tables
62 \usepackage{multicol} % multiple column layout facilities
63 \usepackage[babel=true]{microtype}
64 \DisableLigatures{encoding = *, family = *}
65 \usepackage[english]{babel}
66 \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
67 \graphicspath{{graphics/}} % set of paths to search for images
68 %\geometry{showframe} % display margins for debugging page layout
69 \fvset{fontsize=\small}
70 \hypersetup{%
71 pdfauthor = {Alain Matthes},
72 pdftitle = {pgfornament},
73 pdfsubject = {Documentation de pgfornament},
74 colorlinks=true,
75 linkcolor=orange,
76 urlcolor=orange}
77
78 % section (end)
79 %---------%---------%---------%---------%---------%---------%---------%---------
80 \title{The Ornaments package}
81 \author{Alain Matthes}
82 \input{usefulcommands}
83 \usepackage{makeidx}
84 \makeindex
85 \renewenvironment{theindex}
86 {\renewcommand\item{\par\hangindent 40pt}
87 \renewcommand\subitem{\item\hspace*{20pt}}
88 \renewcommand\subsubitem{\item\hspace*{30pt}}
89 \renewcommand\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
90 \section{\indexname}
91 \begin{multicols}{2}%
92 \parindent=0pt
93 \small%
94 }
95 {\end{multicols}%
96 }
97
98 \makeatletter
99 \newcommand{\getpgfornamentDim}[1]{%
100 {\@pgfornamentDim{#1}%
101 X:~\@pgfornamentX\\Y:~\@pgfornamentY}%
102 }
103 \newcommand{\adjustpgfornamentDim}[1]{%
104 \@pgfornamentDim{#1}%
105 \pgfmathsetmacro{\pgfcoeff}{\@pgfornamentX/\@pgfornamentY}%
106 }
107 \makeatother
108
109 \newcommand{\ornamentview}[1]{%
110 \foreach \n in {#1} {%
111 \begin{tikzpicture}
112 \adjustpgfornamentDim{\n}
113 \ifdim\pgfcoeff pt >1 pt \relax \def\adjustXY{2}
114 \else
115 \pgfmathsetmacro{\adjustXY}{2*\pgfcoeff}
116 \fi
117 \draw[Maroon](-1.25cm,-1.25cm) rectangle (1.25cm,1.25cm);
118 \node[inner sep=0pt] (element) {\pgfornament[width=\adjustXY cm]{\n}};
119 \node[anchor=north west,inner sep=0pt,font=\small\bfseries\sffamily,color=red] at (2.05cm,1.05cm) {\n};
120 \node[anchor=west,text width=4em,font=\footnotesize] at (1.85cm,0) {\getpgfornamentDim{\n}};
121 \end{tikzpicture}%
122 \space\space\space\space}}%
123
124 %---------%---------%---------%---------%---------%---------%---------%---------
125 %---------%---------%---------%---------%---------%---------%---------%---------
126 \begin{document}
127
128 \maketitle
129 \noindent\pgfornament[symmetry=c,width=2cm]{46}
130 \begin{marginfigure}
131 \begin{tikzpicture}[baseline={(current bounding box.center)}] \tikzset{pgfornamentstyle/.style={
132 draw=Goldenrod,fill=Red,line width=1pt}}
133 \node[fill=black,circle,draw=Red,line width=2pt,inner sep=8pt]
134 at (0,0) {\pgfornament[scale=0.38]{56}};
135 \end{tikzpicture}
136 \end{marginfigure}
137
138
139 \bigskip
140 \noindent\pgfornament[width=0.75 cm]{152}\ (Version 1.3 2024/08/14)
141 \begin{abstract}
142
143 This document describes the \LaTeX\ package \emph{\docpkg{pgfornament}} and presents the syntax and parameters of the macro "pgfornament".
144 It also provides examples and comments on the package's use.
145
146 Firstly, I would like to thank {Till \textsc{Tantau}} for the beautiful \LaTeX\ package, namely \TIKZ.
147
148 I am grateful to Vincent \textsc{Le Moign} for allowing us to distribute the ornaments \sidenote{ \url{http://www.vectorian.net/} (free sample)} in the format Pstricks and \PGF/\TIKZ.
149
150 I also thank \textsc{P. Fradin} who first created a package on ornaments in relation to PStricks, which gave me the idea to do the same thing in relation to \TIKZ.
151
152 I would like to thank also {Enrico \textsc{Gregorio}} for some great ideas used in this package. You will find at the end of this document the 196 symbols provided with the package.
153
154 With this new version comes a new family of ornaments.
155 \textsc{Chennan Zhang} drew the motifs using a CAD application, re-drew them in TikZ, and granted permission for these to be turned into a library (\emph{\docpkg{pgfornament-han}}) suitable for use with the pgfornament package by \textsc{LianTze Lim}.
156 It is now possible to use directly the library for Chinese traditional motifs and patterns.
157
158 Next to the document you are reading, you will find documentation on the package \emph{\docpkg{tikzrput}}.
159 \end{abstract}
160
161 %---------%---------%---------%---------%---------%---------%---------%---------
162 \vspace{1cm}
163 \hfil \pgfornament[width=4cm]{84}\hfil
164
165 \tableofcontents
166
167 \vspace{1cm}
168 \hfil \pgfornament[width=4cm]{84}\hfil
169
170 \listoffigures
171
172 \vspace{1cm}
173 \hfil \pgfornament[width=4cm]{84}\hfil
174
175 \section{How to install the package}
176 \label{sec:how_to_install}
177 With \docdist{TeXLive}, if you need to install it by yourself, a TDS compliant zip archive is
178 provided (pgfornament.zip). Just download that file, and unpack it in
179 your TDS directory (~/texmf for Unix-like systems).
180 \begin{itemize}
181 \item \docpkg{pgfornament} must to be in \texttt{~/texmf/tex/latex}
182 \item pgflibraryvectorian.code.tex must to be in \texttt{~/texmf/tex/latex}
183 \item pgflibraryhan.code.tex must to be in \texttt{~/texmf/tex/latex}
184 \item pgflibraryam.code.tex must to be in \texttt{~/texmf/tex/latex}
185 \item the folder vectorian must to be in \texttt{~/texmf/tex/generic}
186 \item the folder han must to be in \texttt{~/texmf/tex/generic}
187 \item the folder am must to be in \texttt{~/texmf/tex/generic}
188 \end{itemize}
189
190 With \docdist{MiKTeX}, copy the folder {\color{black}\texttt{pgfornament}} into \verb+C:\texmf\tex\latex+, then
191 run {\color{red}\texttt{MiKTeX Options}} . In the {\color{black}\texttt{File name database}} section, click on {\color{red}\texttt{Refresh now}}.
192
193 \section{How to use the package}
194 \label{sec:how_to_use}
195 You only need to add \\
196 {\color{black}\verb+\usepackage{pgfornament}+} \\ or \\{\color{black}\verb+\usepackage[object=vectorian]{pgfornament}+}\\
197 in your preamble. The pgfornament package loads \TIKZ.
198
199 Without any options, pgfornament package uses the \docfamily{vectorian} symbols. If you want to use other symbols, you give the name of the list of symbols like this : \\
200 {\color{black}\verb+\usepackage[object=pgfhan]{pgfornament}+}.\\
201 "\docfamily{pgfhan}" is the family for Chinese traditional motifs and patterns.
202
203 I create \docfamily{am} to show you how to create new symbols and how to use it (see the section \ref{am1def}).
204 You can see below, the minimum code to get a vector ornament.
205 \colorlet{graphicbackground}{blue!10!white}%
206 \colorlet{codebackground}{red!10}%
207
208 \begin{marginfigure}%
209 \begin{center}
210 \pgfornament[width = 2cm,
211 color = red]{1}
212 \end{center}
213 \caption{Result of the minimal code}
214 \end{marginfigure}
215
216 \begin{tkzexample}[code only,very small]
217 \documentclass{scrartcl}
218 \usepackage{pgfornament}
219 \begin{document}
220 \pgfornament[width = 2cm,
221 color = red]{1}
222 \end{document}
223 \end{tkzexample}
224
225 If you want to work with the Han library
226
227 \newpgfornamentfamily{pgfhan}
228 \begin{marginfigure}%
229 \begin{center}
230 \pgfornament[width = 2cm,
231 color = SeaGreen]{78}
232 \end{center}
233 \caption{Result of the minimal code}
234 \end{marginfigure}
235
236 \begin{tkzexample}[code only,very small]
237 \documentclass{scrartcl}
238 \usepackage[object=pgfhan]{pgfornament}
239 \begin{document}
240 \pgfornament[width = 2cm,
241 color = SeaGreen]{78}
242 \end{document}
243 \end{tkzexample}
244 \newpgfornamentfamily{vectorian}
245
246 How to use different families of ornaments?
247
248 You have two possibilities: the macro \doccmd{newpgfornamentfamily} or
249 an environment \docenv{newfamily}
250
251 For example:
252 \newpgfornamentfamily{pgfhan}
253 \pgfornament[width = 2cm, color = SeaGreen]{59}
254 \newpgfornamentfamily{vectorian}
255 \pgfornament[width = 2cm, color = SeaGreen]{59}
256
257 with the code:
258 \begin{tkzexample}[code only, very small]
259 \newpgfornamentfamily{pgfhan}
260 \pgfornament[width = 2cm, color = SeaGreen]{59}
261 \newpgfornamentfamily{vectorian}
262 \pgfornament[width = 2cm, color = SeaGreen]{59}
263 \end{tkzexample}
264
265 Now with the environment. At the end, you will find the previous ornament library.
266
267 \begin{newfamily}[pgfhan]
268 \begin{tikzpicture}
269 \node{ \pgfornament[color=Dandelion,width=2cm]{1}};
270 \end{tikzpicture}
271 \end{newfamily}
272
273 \begin{tikzpicture}
274 \node{\pgfornament[color=MidnightBlue,width=2cm]{1}};
275 \end{tikzpicture}
276
277 with the code:
278 \begin{tkzexample}[code only, very small]
279 \begin{newfamily}[pgfhan]
280 \begin{tikzpicture}
281 \node{ \pgfornament[color=Dandelion,width=2cm]{1}};
282 \end{tikzpicture}
283 \end{newfamily}
284
285 \begin{tikzpicture}
286 \node{\pgfornament[color=MidnightBlue,width=2cm]{1}};
287 \end{tikzpicture}
288 \end{tkzexample}
289
290 \section{The main macro}
291 \label{sec:the_main_macro}
292
293 The macro \doccmd{pgfornament} draws the object linked to the given number, with the vectorian family this number is between $1$ and now $196$. This macro can be used alone, or inside a picture. It's defined by an environment \emph{\docenv{tikzpicture}} placed at the current point.
294
295 The objects displayed depend of the option used when \doccmd{pgfornament} is called.
296 The specifications of the {\color{red}\Verb|\pgfornament|} command is:
297 \begin{docspec}
298 \color{black} \doccmd{pgfornament[\docopt{options}]\{\docarg{number}\}}
299 \end{docspec}
300
301 The result is a picture defined by a \emph{\docenv{tikzpicture}} environment.
302
303 \subsection{Number argument}
304 \label{sub:arg_number}
305
306 The number designs an object of a list by a rank.
307 \begin{marginfigure}
308 \begin{center}
309 \pgfornament[width=2cm,color=RubineRed]{1}
310 \end{center}
311 \caption{Vectorian ornament n° 1}
312 \end{marginfigure}
313 \begin{tkzexample}[code only,width=5cm,very small]
314 \usepackage{pgfornament}
315 ...
316 \pgfornament[width=2cm]{1}
317 \end{tkzexample}
318
319 \medskip
320 \begin{marginfigure}
321 \begin{center}
322 \pgfornament[width=2cm,color=SeaGreen]{2}
323 \end{center}
324 \caption{Vectorian ornament n° 2}
325 \end{marginfigure}
326 \begin{tkzexample}[code only,width=5cm,very small]
327 \usepackage{pgfornament}
328 ...
329 \pgfornament[width=2cm]{2}
330 \end{tkzexample}
331
332 \medskip
333 \begin{marginfigure}
334 \begin{center}
335 \begin{newfamily}[pgfhan]
336 \begin{tikzpicture}
337 \node {\pgfornament[color=red,width=2cm]{57}};
338 \end{tikzpicture}
339 \end{newfamily}
340 \end{center}
341 \caption{Chinese ornament n° 57}
342 \end{marginfigure}
343 \begin{tkzexample}[code only,width=5cm,very small]
344 \usepackage[object=pgfhan]{pgfornament}
345 ...
346 \pgfornament[color=Mahogany,width=2cm]{57}
347 \end{tkzexample}
348
349 \medskip
350 \begin{tkzexample}[code only,width=5cm,very small]
351 \usepackage[object=am]{pgfornament}
352 ...
353 \pgfornament[width=4cm]{1}
354 \end{tkzexample}
355 \begin{marginfigure}
356 \begin{newfamily}[am]
357 \begin{tikzpicture}
358 \pgfornament[color=Dandelion,width=2cm]{1}
359 \end{tikzpicture}
360 \end{newfamily}
361 \newpgfornamentfamily{vectorian}
362 \caption{am ornament n° 1}
363 \end{marginfigure}
364
365 \subsection{Argument and options}
366 \label{sub:the_options}
367 The macro has six options. You have four possibilities for the last option \Verb+symmetry+.
368 The next table describes these options.
369
370 \begin{table}[h]\index{pgfornament!options}
371 { \small \begin{tabular}{lll}
372 \toprule
373 name & default & definition \\
374 \midrule
375 \docoption{scale}{pgfornament} & 1 & ratio of height to width is unchanged\\
376 \docoption{width}{pgfornament} & \{\} & set the width, ratio unchanged \\
377 \docoption{height}{pgfornament} & \{\} & set the height, ratio unchanged \\
378 \docoption{color}{pgfornament} & black & color of the ornament \\
379 \docoption{opacity}{pgfornament} & 1 & nb inf 1, opacity of the ornament \\
380 \docoption{ydelta}{pgfornament} & 0 pt & value to adjust vertically the ornament \\
381 \docoption{symmetry=v}{pgfornament} & none & vertical symmetry\\
382 \docoption{symmetry=h}{pgfornament} & none & horizontal symmetry \\
383 \docoption{symmetry=c}{pgfornament} & none & central symmetry \\
384 \docoption{symmetry=none}{pgfornament} & none & no symmetry by default \\
385 \bottomrule
386 \end{tabular} }
387 \caption{List of options for the pgfornament macro.}
388 \label{tab:pgfornament-options}
389 \end{table}
390
391 \subsection{Examples of the use of options}
392 \label{sub:examples}
393 \begin{enumerate}\setlength{\itemsep}{30pt}
394 \item Option \docoption{scale}{pgfornament}
395 \begin{tkzexample}[code only,very small]
396 \pgfornament[scale=0.25]{77}
397 \end{tkzexample}
398 \begin{marginfigure}
399 \pgfornament[scale=0.25]{77}
400 \caption{Option \tkzname{scale}}
401 \end{marginfigure}
402 \item Option \docoption{width}{pgfornament}
403 \begin{tkzexample}[code only,very small]
404 \pgfornament[width=5cm]{77}
405 \end{tkzexample}
406 \begin{marginfigure}
407 \pgfornament[width=5cm]{77}
408 \caption{Option \tkzname{width}}
409 \end{marginfigure}
410 \item Option \docoption{height}{pgfornament}
411 \begin{tkzexample}[code only,very small]
412 \pgfornament[height=1cm]{77}
413 \end{tkzexample}
414 \begin{marginfigure}
415 \pgfornament[height=1cm]{77}
416 \caption{Option \tkzname{height}}
417 \end{marginfigure}
418
419 \item Option \docoption{color}{pgfornament}
420 \begin{tkzexample}[code only,very small]
421 \pgfornament[height=1cm,color=green!20!black]{77}
422 \end{tkzexample}
423 \begin{marginfigure}
424 \pgfornament[height=1cm,color=green!20!black]{77}
425 \caption{Option \tkzname{color}}
426 \end{marginfigure}
427
428
429 \begin{marginfigure}
430 \pgfornament[color=MidnightBlue,width=3cm]{24}%
431 \caption{How to use \tkzname{color}}
432 \end{marginfigure}
433 \begin{tkzexample}[code only,very small]
434 \pgfornament[color=MidnightBlue,width=3cm]{24}%
435 \end{tkzexample}
436
437 \item Option \docoption{opacity}{pgfornament}
438 \begin{tkzexample}[code only,very small]
439 \pgfornament[height=1cm,color=green!20!black,opacity=0.2]{77}
440 \end{tkzexample}
441 \begin{marginfigure}
442 \pgfornament[height=1cm,color=green!20!black,opacity=0.2]{77}
443 \caption{Option \tkzname{opacity}}
444 \end{marginfigure}
445
446 \begin{marginfigure}
447 \pgfornament[width=5cm]{2}
448 \caption{Example for symmetry}
449 \end{marginfigure}
450
451 \item Option \docoption{symmetry=h}{pgfornament}
452 (Symmetry horizontal axis)
453 \begin{marginfigure}
454 \tikzset{pgfornamentstyle/.style={draw=BlueGreen,
455 fill=BlueGreen!20,fill opacity=.5,thick}}%
456 \pgfornament[width=5cm,symmetry=h]{2}
457 \caption{Horizontal symmetry}
458 \end{marginfigure}
459
460
461 \item Option \docoption{symmetry=v}{pgfornament}
462 (Symmetry vertical axis)
463 \begin{marginfigure}
464 \tikzset{pgfornamentstyle/.style={draw=MidnightBlue,
465 fill=MidnightBlue!20,fill opacity=.5,thick}}%
466 \pgfornament[width=5cm,symmetry=v]{2}
467 \caption{Vertical symmetry}
468 \end{marginfigure}
469
470 \item Option \docoption{symmetry=c}{pgfornament}
471 (Symmetry with respect to the origin)
472 \begin{marginfigure}
473 \tikzset{pgfornamentstyle/.style={draw=RubineRed,
474 fill=RubineRed!20,fill opacity=.5,thick}}%
475 \pgfornament[width=5cm,symmetry=c]{2}%
476 \caption{Central symmetry}
477 \end{marginfigure}
478
479 \item Option \docoption{ydelta}{pgfornament}
480
481 \begin{marginfigure}%
482 \pgfornament[color=MidnightBlue,width=1cm,ydelta=-10pt]{25}%
483 \pgfornament[color=PineGreen,width=1cm]{25}%
484 \pgfornament[color=Periwinkle,width=1cm,ydelta=+10pt]{25}%
485 \caption{How to use \tkzname{ydelta}}
486 \end{marginfigure}
487 \begin{tkzexample}[code only,very small]
488 \pgfornament[color=MidnightBlue,width=2cm,ydelta=-10pt]{25}%
489 \pgfornament[color=PineGreen,width=2cm]{25}%
490 \pgfornament[color=Periwinkle,width=2cm,ydelta=+10pt]{25}%
491 \end{tkzexample}
492 \end{enumerate}
493
494 \clearpage\newpage
495 \subsection{Style \docStyle{pgfornamentstyle}}
496 \label{sub:pgfornamentstyle}
497 This style can modify some options like the color and also how to fill the symbol when it's possible.
498 \begin{marginfigure}%
499 \begin{tikzpicture}
500 \tikzset{pgfornamentstyle/.style={
501 fill=SpringGreen,
502 fill opacity=.5,
503 line width=1pt}}%
504 \pgfornament[color=OliveGreen,scale=1.25,anchor=south]{24}%
505 \end{tikzpicture}
506 \caption{How to use the style \tkzname{pgfornamentstyle}}
507 \end{marginfigure}
508 \begin{tkzexample}[code only,very small]
509 \begin{tikzpicture}
510 \tikzset{pgfornamentstyle/.style={
511 fill=SpringGreen,
512 fill opacity=.5,
513 line width=1pt}}%
514 \pgfornament[color=OliveGreen,scale=1.25,anchor=south]{24}%
515 \end{tikzpicture}
516 \end{tkzexample}
517
518 \subsection{Advanced options from \docpkg{\TIKZ}}
519 \label{sub:advanced_options}
520 \begin{marginfigure}
521 \begin{tikzpicture}
522 \tikzset{pgfornamentstyle/.style={draw=Periwinkle,
523 fill=SpringGreen}}%
524 \node[draw=Periwinkle,circle,anchor=center,
525 inner sep=0pt,fill=GreenYellow] at (0,0){%
526 \pgfornament[anchor=center]{24}};
527 \end{tikzpicture}
528 \caption{How to add \TIKZ ' styles}
529 \end{marginfigure}
530 \begin{tkzexample}[code only,very small]
531 \begin{tikzpicture}
532 \tikzset{pgfornamentstyle/.style={draw=Periwinkle,
533 fill=SpringGreen}}%
534 \node[draw=Periwinkle,circle,anchor=center,
535 inner sep=0pt,fill=GreenYellow] at (0,0){%
536 \pgfornament[anchor=center]{24}};
537 \end{tikzpicture}
538 \end{tkzexample}
539
540 \section{What is a (pgf)ornament?}
541 \label{sec:what_is_a_pgf_ornament}
542 When you write in your document \Verb|\pgfornament{1}|, you get the first ornament of a family (by default \docfamily{vectorian}'s family). This ornament is a vector object defined by an environment \emph{\docenv{tikzpicture}}.
543 \begin{tkzexample}[code only,very small]
544 \begin{tikzpicture}[baseline={([yshift=\pgfornamentydelta]%
545 current bounding box.\pgfornamentanchor)},pgfornamentstyle]
546 \pgftransformscale{\pgfornamentscale}%
547 \pgf@@ornament{#2}%
548 \end{tikzpicture}%
549 \end{tkzexample}
550
551 \medskip
552 You can modify the aspect of the picture if you change
553
554 \doccmd{pgfornamentscale}, or \docStyle{pgfornamentstyle}. With \doccmd{pgfornamentydelta}, or \doccmd{pgfornamentanchor}, you can move the picture but this depends on the different environments. The next code gives the picture \ref{fig:minimum}. I chose this method so that the use is as simple as possible.
555 \begin{marginfigure}
556 \pgfornament[anchor=center,scale=1]{1}
557 \caption{Minimal code to get an ornament}
558 \label{fig:minimum}
559 \end{marginfigure}
560 \begin{tkzexample}[code only,very small]
561 \documentclass{scrartcl}
562 \usepackage{pgfornament}
563 \begin{document}
564 \pgfornament{1}
565 \end{document}
566 \end{tkzexample}
567
568 \medskip
569 The ornament is placed in a rectangle\sidenote{You can find the dimensions of this shape in the file pgflibraryvectorian.code.tex. The name of this file depends of the name of the vector family By default actually it's \docfamily{vectorian}.}.
570
571 \medskip
572 \begin{tikzpicture}[every node/.style={inner sep=0pt}]
573 \tikzset{image/.style={circle,
574 fill=red,
575 minimum size = 4pt,
576 inner sep = 0pt,
577 outer sep = 1pt}
578 }
579
580 \node[inner sep = 1cm] (wrapper){\tikz
581 \node[draw](image) {\pgfsetfillopacity{0.2}\pgfornament{1}};};
582
583 \foreach \ancre in {north,north east,east,south east,south,south west,west,north west,east}
584 {%
585 \node [image] (i\ancre) at (image.\ancre) {};
586 \node [outer sep=2pt] (w\ancre) at (wrapper.\ancre) {\small\ancre};
587 \draw [red,->,>=stealth] (w\ancre)--(i\ancre);
588 }
589 \node[image,label=below:{\tiny center}] at (wrapper.center) {};
590 \end{tikzpicture}
591
592 On the last figure, I represent all the anchors \index{anchors} that you can use. Now you will see how to place this picture on a page, in the flow of text or inside a complex picture.
593
594 \section{Placing a vector ornament on a page}
595 \label{sec:placement_on_a_page}
596
597 \unitlength=1pt
598 \noindent\eachpageornament
599 \subsection{On each page with the package \docpkg{eso-pic}}
600 \label{sub:with_the_package_eso_pic}
601
602 You may have noticed the existence of an ornament placed at each corner of the pages. The next code explains how to do this. The only part of the code linked to \docpkg{pgfornament} is to use the macro \doccmd{pgfornament}. To put the object at the right place on the page, we need to consider its width.
603
604 Perhaps you saw the ornaments in each corner of each page
605
606 I used the package \docpkg{eso-pic} and the next code. The macro \doccmd{put} places the ornament at a point but you need to change correctly the anchor.
607
608 \begin{tkzexample}[code only,very small]
609 \usepackage{eso-pic}
610 \makeatletter
611 \AddToShipoutPicture{%
612 \begingroup
613 \setlength{\@tempdima}{2mm}%
614 \setlength{\@tempdimb}{\paperwidth-\@tempdima-2cm}%
615 \setlength{\@tempdimc}{\paperheight-\@tempdima}%
616 \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimc}){%
617 \pgfornament[anchor=north west,width=2cm]{63}}
618 \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdima}){%
619 \pgfornament[anchor=south west,width=2cm,symmetry=h]{63}}
620 \put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdimc}){%
621 \pgfornament[anchor=north east,width=2cm,symmetry=v]{63}}
622 \put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdima}){%
623 \pgfornament[anchor=south east,width=2cm,symmetry=c]{63}}
624 \endgroup
625 }
626 \makeatother
627 \end{tkzexample}
628 \Imacro{AddToShipoutPicture} \Imacro{LenToUnit} \Imacro{anchor}
629
630 \subsection{On one page with the picture environment}
631 \label{sub:with_the_picture_environment}
632
633 The next code is used to delimit the text area on the page defined by the tufte class.
634 \sidenote{\tkzcname{strippt} is defined by \tkzcname{let}\doccmd{strippt}\doccmd{strip@pt}}
635 \begin{tkzexample}[code only,very small]
636 \newcommand{\eachpageornament}{%
637 \unitlength=1pt
638 \begin{picture}(0,0)%
639 \put(0,0){\pgfornament[width=1cm]{41}};%
640 \put(\strippt\textwidth,0){%
641 \pgfornament[width=1cm,symmetry=v]{41}};%
642 \put(0,-\strippt\textheight){%
643 \pgfornament[width=1cm,symmetry=h]{41}};%
644 \put(\strippt\textwidth,-\strippt\textheight){%
645 \pgfornament[width=1cm,symmetry=c]{41}};%
646 \end{picture}}%
647
648 \eachpageornament
649 \end{tkzexample}
650
651 \subsection{With \docpkg{\TIKZ}[\tkzname{remember picture},\tkzname{overlay}]}
652 \label{sub:with_tikz}
653
654 You can without \docpkg{eso-pic} but with \docpkg{\TIKZ}\ get the same result on one page with the next macro. \tkzname{remember picture} is obligatory, this option tells \TIKZ\ that it should attempt to remember the position of the current picture on the page, you need to compile twice if you use such code. The option \tkzname{overlay}\index{overlay}\ switches the computation of the bounding box so the pictures are not in the flow of the text and they don't modify the layout.
655
656 \begin{tkzexample}[code only,very small]
657 \newcommand{\eachpageornament}{%
658 \begin{tikzpicture}[remember picture, overlay]
659 \node[anchor=north west] at (current page.north west){%
660 \pgfornament[width=2cm]{63}};
661 \node[anchor=north east] at (current page.north east){%
662 \pgfornament[width=2cm,symmetry=v]{63}};
663 \node[anchor=south west] at (current page.south west){%
664 \pgfornament[width=2cm,symmetry=h]{63}};
665 \node[anchor=south east] at (current page.south east){%
666 \pgfornament[width=2cm,symmetry=c]{63}};
667 \end{tikzpicture}
668 }
669 \end{tkzexample}
670 \index{current page}
671
672 \section{Placing a vector ornament in the flow}
673 \label{sec:placing-ornament}
674 \subsection{\protect\pgfornament[anchor=south,width=1cm]{78}\ Directly\ \protect\pgfornament[anchor=south,width=1cm,symmetry=v]{78}}
675 \label{sub:directly}
676
677 The next code show you the effect of different choice of anchor.
678 \setlength{\fboxsep}{0pt}
679
680 {\color{black}baseline
681 \pgfsetfillopacity{0.2}%
682 \fbox{\pgfornament[anchor=south,width=2cm]{69}}%
683 \fbox{\pgfornament[width=2cm]{69}}%
684 \fbox{\pgfornament[anchor=north,width=2cm]{69}}%
685 \pgfsetfillopacity{1} baseline }
686
687 \begin{tkzexample}[code only,very small]
688 { \color{black}baseline \pgfsetfillopacity{0.2}%
689 \fbox{\pgfornament[anchor=south,width=2cm]{69}}%
690 \fbox{\pgfornament[width=2cm]{69}}%
691 \fbox{\pgfornament[anchor=north,width=2cm]{69}}%
692 \pgfsetfillopacity{1} baseline }
693 \end{tkzexample}
694
695 \medskip
696 \noindent Perhaps you are interesting by the code to modify the subsection?
697
698 \begin{tkzexample}[code only,very small]
699 \subsection{\protect\pgfornament[anchor=south,width=1cm]{78}\
700 Directly \
701 \protect\pgfornament[anchor=south,width=1cm,symmetry=v]{78}}
702 \end{tkzexample}
703
704 \subsection{In the flow with \TIKZ}
705 \label{sub:in_the_flow_with_tikz}
706
707 \medskip
708 Generally, the best way is to place the ornament inside a node and the node inside an environment \emph{tikzpicture}. You can need to specify the position of the node inside the \emph{\docenv{tikzpicture}} and you can add an anchor to place exactly the ornament like you want.
709
710 \begin{marginfigure}
711 \begin{center}
712 \begin{tikzpicture}
713 \foreach \a in {0,45,...,315}
714 \node[anchor=west,rotate=\a,inner sep=0pt,xshift=12pt] {%
715 \pgfornament[width=1cm]{88}};
716 \end{tikzpicture}
717 \end{center}
718 \caption{Assembling of ornaments version 2}
719 \end{marginfigure}
720
721 \begin{tkzexample}[code only,very small]
722 \begin{tikzpicture}
723 \foreach \a in {0,45,...,315}
724 \node[anchor=west,rotate=\a,inner sep=0pt,xshift=12pt] {%
725 \pgfornament[width=1cm]{88}};
726 \end{tikzpicture}
727 \end{tkzexample}
728
729 \begin{marginfigure}
730 \begin{center}
731 \begin{tikzpicture}
732 \foreach \a in {0,45,...,315}
733 \node[anchor=west,rotate=\a,inner sep=0pt] {%
734 \pgfornament[width=1cm]{88}};
735 \end{tikzpicture}
736 \end{center}
737 \caption{Assembling of ornaments version 1}
738 \end{marginfigure}
739
740 \begin{tkzexample}[code only,very small]
741 \begin{tikzpicture}
742 \foreach \a in {0,45,...,315}
743 \node[anchor=west,rotate=\a,inner sep=0pt] {%
744 \pgfornament[width=1cm]{88}};
745 \end{tikzpicture}
746 \end{tkzexample}
747
748 \medskip
749 \emph{Remark : It's difficult to get the same result with \emph{\doccmd{put}} and \emph{\doccmd{rotatebox}} but it's easy with the \emph{\docpkg{rotating}} package.}
750
751 \begin{marginfigure}
752 \begin{center}
753 \foreach \a in {0,45,...,315}{%
754 \turnbox{\a}{\pgfornament[width=1cm]{88}}}%
755 \end{center}
756 \end{marginfigure}
757
758 \begin{tkzexample}[code only,very small]
759 \foreach \a in {0,45,...,315}{%
760 \turnbox{\a}{\pgfornament[width=1cm]{88}}}%
761 \end{tkzexample}
762
763 \section{Ornament inside a node}
764 \label{sec:inside}
765 This method is very useful and flexible because it's possible to use the options and styles with the command \doccmd{node}. You can modify the style \docoption{pgfornamentstyle}{pgfornament} \sidenote{I you want to rest the style you can use \doccmd{resetpgfornamentstyle}}.
766
767 \begin{marginfigure}
768 \tikzset{pgfornamentstyle/.style={draw=green!20!black,inner sep=0pt,
769 fill=orange,fill opacity=.5,scale=1.25,ultra thick}}%
770 \tikz\node {\fbox{\pgfornament{3}}};
771 \caption{Style with node}
772 \end{marginfigure}
773 \begin{tkzexample}[code only,very small]
774 \tikzset{pgfornamentstyle/.style={%
775 draw=green!20!black,inner sep=0pt,fill=orange,
776 fill opacity=.5,scale=1.25,ultra thick}}%
777 \tikz\node {\fbox{\pgfornament{3}}};
778 \end{tkzexample}
779
780
781
782 {\textcolor{red}{\pgfornament[width=0.5 cm]{152} \hskip1em}} If we use a tikzpicture inside the flow then it's very useful to know how to place the picture. The important part of the code is : \\
783
784 \begin{tkzexample}[code only,very small]
785 \tikz[baseline=(current bounding box.south)]
786 \end{tkzexample} \index{current bounding box}
787
788 \medskip
789 {\textcolor{red}{\pgfornament[width=0.5 cm]{152}} Don't forget to use \tkzname{inner sep =0pt}\index{inner sep} because you can get undesirable space around the object.\\
790
791 \begin{tkzexample}[code only,very small]
792 baseline\tikz[baseline]
793 \node[inner sep=0pt]{\fbox{\pgfornament[width=2cm]{3}}};
794 baseline
795 \tikz[baseline=(current bounding box.south)]
796 \node[inner sep=0pt]{\fbox{\pgfornament[width=2cm]{3}}};
797 baseline
798 \tikz[baseline=(current bounding box.north)]
799 \node[inner sep=0pt]{\fbox{\pgfornament[width=2cm]{3}}};
800 baseline
801 \end{tkzexample} \index{baseline}
802
803 \begin{figure}
804 baseline\tikz[baseline]\node[inner sep=0pt] {\fbox{\pgfornament[width=1.5cm]{3}}};%
805 baseline\tikz[baseline=(current bounding box.south)]\node[inner sep=0pt] {\fbox{\pgfornament[width=1.5cm]{3}}};%
806 baseline\tikz[baseline=(current bounding box.north)]\node[inner sep=0pt] {\fbox{\pgfornament[width=1.5cm]{3}}};baseline
807 \caption{Node in the flow}
808 \end{figure}
809
810 \section{One ornament between two nodes}
811 \label{sec:between}
812 I created an option for the \emph{\tkzname{to}} command\index{to}. You only need to call an ornament with \Verb+ornament=number+.
813
814 \begin{docspec}
815 \color{black}\Verb+\draw+ (A) \Verb+to+ [\Verb+ornament+ = \docopt{number}] (B) ;
816 \end{docspec}
817 \resetpgfornamentstyle
818
819
820 \subsection{How to use \emph{\tkzname{to [ornament= ...]}}}
821 \label{sub:how_to_use_}
822
823 This code shows how to place an ornament between to node. The width of the ornament is automatically calculate.
824
825 \begin{tkzexample}[code only,very small]
826 \begin{tikzpicture}
827 \node (A) at (0,0) {};
828 \node (B) at (4,2) {};
829 \draw [help lines,color=Maroon!60] (0,0) grid (4,2);
830 \draw [fill=Maroon!30] (A) circle (2pt) (B) circle (2pt);
831 \draw [orange] (A) to [ornament=88] (B);
832 \end{tikzpicture}
833 \end{tkzexample}
834
835 \begin{marginfigure}[-3cm]
836 \begin{tikzpicture}
837 \node (A) at (0,0) {};
838 \node (B) at (4,2) {};
839 \draw [help lines,color=Maroon!60] (0,0) grid (4,2);
840 \draw [fill=Maroon!30] (A) circle (2pt) (B) circle (2pt);
841 \draw [orange] (A) to [ornament=88] (B);
842 \end{tikzpicture}
843 \caption{One ornament between two nodes}
844 \end{marginfigure}
845
846 \medskip
847 The next code shows how to place two ornaments between two nodes.
848
849 \begin{tkzexample}[code only,very small]
850 \begin{tikzpicture}
851 \node (A) at (0,0) {};
852 \node (B) at (5,2) {};
853 \draw [help lines,color=Maroon!60] (0,0) grid (5,2);
854 \draw [fill=Maroon!30] (A) circle (2pt) (B) circle (2pt);
855 \path (A)--(B) coordinate[pos=.5] (c1);
856 \draw [orange] (A) to [ornament=84]
857 (c1) to [ornament=84] (B);
858 \end{tikzpicture}
859 \end{tkzexample}
860
861
862 \begin{marginfigure}[-3cm]
863 \begin{tikzpicture}
864 \node (A) at (0,0) {};
865 \node (B) at (4,2) {};
866 \draw [help lines,color=Maroon!60] (0,0) grid (4,2);
867 \draw [fill=Maroon!30] (A) circle (2pt) (B) circle (2pt);
868 \path (A)--(B) coordinate[pos=.5] (c1);
869 \draw [orange] (A) to [ornament=84]
870 (c1) to [ornament=84] (B);
871 \end{tikzpicture}
872 \caption{Two ornaments between two nodes}
873 \end{marginfigure}
874
875 \medskip
876 Example with a pentagon
877
878 \begin{tkzexample}[code only,very small]
879 \begin{tikzpicture}[every node={anchor=center,
880 inner sep=0pt}]
881 \node[regular polygon, regular polygon sides=5,
882 rotate=36,minimum size=5cm,inner sep=0pt](s) {};
883 \path (s.side 1) to [ornament=83] (s.side 2)
884 to [ornament=83] (s.side 3)
885 to [ornament=83] (s.side 4)
886 to [ornament=83] (s.side 5)
887 to [ornament=83] (s.side 1);
888 \end{tikzpicture}
889 \end{tkzexample}
890
891 \begin{marginfigure}
892 \begin{tikzpicture}[every node={anchor=center,
893 inner sep=0pt}]
894 \node[regular polygon, regular polygon sides=5,
895 rotate=36,minimum size=5cm,inner sep=0pt](s) {};
896 \path (s.side 1) to [ornament=83] (s.side 2)
897 to [ornament=83] (s.side 3)
898 to [ornament=83] (s.side 4)
899 to [ornament=83] (s.side 5)
900 to [ornament=83] (s.side 1);
901 \end{tikzpicture}
902 \caption{A pentagon}
903 \end{marginfigure}
904
905 \subsection{How to use the option \tkzname{ornament/at}} \index{ornament/at}
906 \label{sub:how_to_use_the_option_at}
907
908 It's possible to move the ornament on the line AB. You only need to write \tkzname{at = number} where number is a percent like \tkzname{pos}.
909 \begin{tkzexample}[code only,very small]
910 \begin{tikzpicture}
911 \node (A) at (0,0) {};
912 \node (B) at (4,0) {};
913 \draw [help lines,color=red!60] (0,-1) grid (4,1);
914 \path (A.center) to [ornament=67,ornament/at=0,
915 options/.append style={scale=.25}] (B.center);
916 \path (A.center) to [ornament=67,ornament/at=1,
917 options/.append style={scale=.25}] (B.center);
918 \end{tikzpicture}
919 \end{tkzexample}
920
921 \begin{marginfigure}
922 \begin{tikzpicture}
923 \node (A) at (0,0) {};
924 \node (B) at (4,0) {};
925 \draw [help lines,color=red!60] (0,-1) grid (4,1);
926 \path (A.center) to [ornament=67,ornament/at=0,
927 options/.append style={scale=.25}] (B.center);
928 \path (A.center) to [ornament=67,ornament/at=1,
929 options/.append style={scale=.25}] (B.center);
930 \end{tikzpicture}
931 \caption{option at}
932 \end{marginfigure}
933
934
935 \subsection{How to use the option \tkzname{options}}
936 \label{sub:how_to_use_the_option_options}
937
938 If an ornament is misplaced we can move it up or down. Look at the code to see how to use \tkzname{options}. \index{options}
939
940 \begin{tkzexample}[code only,very small]
941 \begin{tikzpicture}
942 \node (A) at (0,0) {};
943 \node (B) at (4,2) {};
944 \draw [help lines,color=Maroon!40] (0,0) grid (4,2);
945 \draw [fill=Maroon!20] (A) circle (2pt) (B) circle (2pt);
946 \path (A.center) to [ornament=84,
947 options/.append style={yshift=10pt}] (B.center);
948 \end{tikzpicture}
949 \end{tkzexample}
950
951 \begin{marginfigure}[-3cm]
952 \begin{tikzpicture}
953 \node (A) at (0,0) {};
954 \node (B) at (4,2) {};
955 \draw [help lines,color=Maroon!40] (0,0) grid (4,2);
956 \draw [fill=Maroon!20] (A) circle (2pt) (B) circle (2pt);
957 \path (A.center) to [ornament=84,
958 options/.append style={yshift=10pt}] (B.center);
959 \end{tikzpicture}
960 \caption{How options}
961 \end{marginfigure}
962
963 \section{How to make a line of ornaments}
964 \subsection{With the chains library}
965 \begin{marginfigure}
966 \begin{tikzpicture}
967 \node[draw,circle,minimum size=4pt,inner sep=0] (A) at (0,0){};
968 \coordinate (B) at (8,0);
969 {[start chain,node distance=0,inner sep=0]
970 \node[anchor=west] [on chain] at (A){\pgfornament[width=1cm]{70}};
971 \node [on chain] {\pgfornament[width=1cm]{70}};
972 \node [on chain] {\pgfornament[width=1cm]{70}};
973 \node [on chain] {\pgfornament[width=1cm]{70}};}
974 \end{tikzpicture}
975 \caption{Line with \doclib{chains} library}
976 \end{marginfigure}
977
978 \begin{tkzexample}[code only,very small]
979 \begin{tikzpicture}
980 \node[draw,circle,
981 minimum size=4pt,inner sep=0] (A) at (0,0){};
982 \coordinate (B) at (8,0);
983 {[start chain,node distance=0,inner sep=0]
984 \node[anchor=west] [on chain] at (A){\pgfornament[width=1cm]{70}};
985 \node [on chain] {\pgfornament[width=1cm]{70}};
986 \node [on chain] {\pgfornament[width=1cm]{70}};
987 \node [on chain] {\pgfornament[width=1cm]{70}};}
988 \end{tikzpicture}
989 \end{tkzexample}
990
991 \subsection{With the macro \doccmd{pgfornamentline}}
992
993 Autopsy of this macro, you need 4 mandatory arguments: first of all two points between which the line is placed, the number of ornaments to create the line and of course the number of the ornament.
994 An optional argument allows you to set options.
995
996 \begin{marginfigure}
997 \begin{tikzpicture}[bullet/.style={circle,draw,fill=black!30,inner sep=2pt}]
998 \draw [help lines,color=black!60] (0,0) grid (6,4);
999 \node[bullet] (A) at (0,0) {};
1000 \node[bullet] (B) at (6,4) {};
1001 \pgfornamentline[color=red]{A}{B}{4}{88}
1002 \end{tikzpicture}
1003 \caption{A line with ornaments}
1004 \end{marginfigure}
1005
1006 \begin{tkzexample}[code only, very small]
1007 \begin{tikzpicture}[bullet/.style={%
1008 circle,draw,fill=black!30,inner sep=2pt}]
1009 \draw [help lines,color=black!60] (0,0) grid (5,2);
1010 \node[bullet] (A) at (0,0) {};
1011 \node[bullet] (B) at (6,4) {};
1012 \pgfornamentline[color=red]{A}{B}{4}{88}
1013 \end{tikzpicture}
1014 \end{tkzexample}
1015
1016
1017
1018 \section{Place ornaments with \doclib{chains} on a circle}
1019 \begin{marginfigure}
1020 \begin{tikzpicture}[start chain=circle placed {at=(\tikzchaincount*30:2)}]
1021 \foreach \i in {1,...,12} \node [on chain] {\pgfornament[width=1cm]{4}};
1022 \end{tikzpicture}
1023 \caption{ A circle with ornaments}
1024 \end{marginfigure}
1025
1026 \begin{tkzexample}[code only,very small]
1027 \begin{tikzpicture}[start chain=circle placed %
1028 {at=(\tikzchaincount*30:2)}]
1029 \foreach \i in {1,...,12} \node [on chain]%
1030 {\pgfornament[width=1cm]{4}};
1031 \end{tikzpicture}
1032 \end{tkzexample}
1033
1034
1035 \section{Vectorian Library}
1036 \label{sec:vectorian}
1037 \subsection{Ornaments : Vector Symbols}
1038 \label{sec:ornaments_symbols}
1039 Here a list of the first thirty elements
1040 \subsection{Symbols part 1}
1041 \label{sub:symbol1}
1042 \index{ornament!symbols1a}
1043 \ornamentview{1,...,30,97,98,140,141}%
1044 \label{tab:ornaments : symbol1}
1045
1046 \subsection{Symbols part 2}
1047 \label{sub:symbol2}
1048 Tsubhe next list is about symbols of decoration. The design is more sophisticated. Be careful indices range from sixty-five to seventy-nine.
1049 \index{ornament!symbols2}%
1050 \parindent=0pt
1051
1052 \medskip
1053 \ornamentview{65,...,79}%
1054 \label{tab:ornaments : symbol2}
1055
1056 \subsection{Ornaments : Vector Corners}
1057 \label{sec:corners}
1058 The next list of ornaments concerns objects to place in the corners of a figure. Half of them is not useful because it is obtained by symmetry of the other.
1059
1060 \index{ornament!corners1}
1061 \ornamentview{31,...,42,61,62,63,64}%
1062 \label{tab:ornaments : corners1}
1063
1064 \index{ornament!corners2}
1065 \ornamentview{131,132,194,195}%
1066 \label{tab:ornaments : corners2}
1067
1068 \subsection{Ornaments : Vector Lines}
1069 \label{sec:lines}
1070 The next list concerns symbols used to make a line.
1071 \index{ornament!lines}
1072
1073 \medskip
1074 \ornamentview{80,89}%
1075 \label{tab:ornaments : lines}
1076
1077 \subsection{Ornaments : Animals}
1078 \label{sec:animal }
1079 The next list concerns symbols with animals.
1080 \index{ornament!Animals}
1081
1082 \medskip
1083 \ornamentview{90,91,100,102,104,106,107,108,109,110,111,112,113,122,123,124,158,159,133,134,135,136,156,157,158,159,190,193,137}%
1084 \label{tab:ornaments : animal}
1085
1086 \subsection{Ornaments : Hands}
1087 \label{sec:hands }
1088 Remark : Ornaments 154 and 155 are identic but their sizes are smaller.
1089
1090 \medskip
1091 \ornamentview{152,153,154,155}%
1092 \label{tab:ornaments : hands}
1093
1094 \subsection{Ornaments : Humans}
1095 \label{sec:humans}
1096 Remark : Ornaments 143, 144 and 145, 146 are identic but their sizes are different.
1097
1098 \medskip
1099 \ornamentview{95,103,105,125,143,144,160,164}%
1100 \label{tab:ornaments : humans}
1101
1102 \subsection{Ornaments : Objects}
1103 \label{tab:ornaments : objects}
1104
1105 \medskip
1106 \ornamentview{92,...,95,114,...,121,126,...,131,147,148,151,162,...,189,191,192}
1107
1108 \newpage
1109 \section{Chinese traditional motifs}
1110
1111 This library of Chinese motifs is the work of two people: \emph{LianTze Lim} and \emph{Chennan Zhang}. They've been trying to provide some of the traditional patterns of the Han style using the existing mechanism of \texttt{pgfornament}. All patterns were finalized by \emph{Chennan Zhang} in CAD, drawn by TikZ, and converted by \emph{LianTze Lim} into macro package code suitable for the \texttt{pgfornament} mechanism. Thispackage is called \texttt{pgfornament-han}. Now I've incorporated the patterns directly...
1112 \ClearShipoutPictureBG
1113 \newpgfornamentfamily{pgfhan}
1114
1115 \begingroup
1116 \color{MidnightBlue}
1117 \subsection{Corner symbols for connecting simple lines}
1118 \label{sub:corner simple}
1119 \ornamentview{1,...,8}%
1120
1121 \subsection{Corner symbols for connecting double lines}
1122 \label{sub:corner double}
1123 \ornamentview{9,...,14}%
1124
1125 \subsection{Corner symbols}
1126 \label{sub:corner symbols}
1127 \ornamentview{19,...,28}%
1128
1129 \subsection{Single line, double line, straight line}
1130 \label{sub:corner symbols}
1131 \ornamentview{29,...,32}%
1132
1133 \subsection{Other symbols}
1134 \label{sub:other symbols}
1135 \ornamentview{33,...,78}%
1136 \endgroup
1137
1138
1139 \newpgfornamentfamily{vectorian}
1140
1141
1142 \subsection{Frame around a page}
1143 Here the code to the frame auround the page
1144 \begin{tkzexample}[code only,very small]
1145 \AddToShipoutPicture{%
1146 \begingroup
1147 \setlength{\@tempdima}{2mm}%
1148 \setlength{\@tempdimb}{\paperwidth-\@tempdima-1cm}%
1149 \setlength{\@tempdimc}{\paperheight-\@tempdima}%
1150 \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimc}){%
1151 \pgfornament[color=Maroon,anchor=north west,width=1cm]{39}}
1152 \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdima}){%
1153 \pgfornament[color=Maroon,anchor=south west,width=1cm,symmetry=h]{39}}
1154 \put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdimc}){%
1155 \pgfornament[color=Maroon,anchor=north east,width=1cm,symmetry=v]{39}}
1156 \put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdima}){%
1157 \pgfornament[color=Maroon,anchor=south east,width=1cm,symmetry=c]{39}}
1158 \endgroup
1159 }
1160 \let\strippt\strip@pt
1161 \end{tkzexample}
1162
1163 \clearpage\newpage
1164 \section{Application: Placing corners}
1165 \label{sec:application_placement}
1166 Remark : Corners are the same dimensions ( width = height )
1167
1168 \begin{figure}[h!]
1169 \begin{tikzpicture}[color=Maroon,every node/.style={inner sep=0pt}]
1170 \draw[help lines] (-5,-5) grid (5,5);
1171 \node[minimum size=10cm](vecbox){};
1172 \node[anchor=north west] at (vecbox.north west){\pgfornament[width=2cm]{61}};
1173 \node[anchor=north east] at (vecbox.north east){\pgfornament[width=2cm,symmetry=v]{61}};
1174 \node[anchor=south west] at (vecbox.south west){\pgfornament[width=2cm,symmetry=h]{61}};
1175 \node[anchor=south east] at (vecbox.south east){\pgfornament[width=2cm,symmetry=c]{61}};
1176 \end{tikzpicture}
1177 \caption{Placing corners}
1178 \end{figure}
1179
1180
1181 \begin{tkzexample}[code only,very small]
1182 \begin{tikzpicture}[color=Maroon,
1183 every node/.style={inner sep=0pt}]
1184 \draw[help lines] (-6,-6) grid (6,6);
1185 \node[minimum size=12cm](vecbox){};
1186 \node[anchor=north west] at (vecbox.north west)
1187 {\pgfornament[width=5cm]{61}};
1188 \node[anchor=north east] at (vecbox.north east)
1189 {\pgfornament[width=5cm,symmetry=v]{61}};
1190 \node[anchor=south west] at (vecbox.south west)
1191 {\pgfornament[width=5cm,symmetry=h]{61}};
1192 \node[anchor=south east] at (vecbox.south east)
1193 {\pgfornament[width=5cm,symmetry=c]{61}};
1194 \end{tikzpicture}
1195 \end{tkzexample}
1196 \index{minimum size}
1197 \index{anchor}
1198
1199 \section{Application: Create a frame for the page}
1200
1201 \begin{tikzpicture}[remember picture, overlay]
1202 \node[anchor=north west] (nw) at (current page.north west){%
1203 \pgfornament[width=2cm]{63}};
1204 \node[anchor=north east] (ne) at (current page.north east){%
1205 \pgfornament[width=2cm,symmetry=v]{63}};
1206 \node[anchor=south west] (sw) at (current page.south west){%
1207 \pgfornament[width=2cm,symmetry=h]{63}};
1208 \node[anchor=south east] (se) at (current page.south east){%
1209 \pgfornament[width=2cm,symmetry=c]{63}};
1210 \coordinate (nw) at ([shift={(-.82cm,-1cm)}]nw);
1211 \coordinate (sw) at ([shift={(-.82cm,+1cm)}]sw);
1212 \coordinate (ne) at ([shift={(+.82cm,-1cm)}]ne);
1213 \coordinate (se) at ([shift={(+.82cm,+1cm)}]se);
1214 \pgfornamentline[color=Maroon]{nw}{sw}{4}{88}
1215 \pgfornamentline[color=Maroon]{ne}{se}{4}{88}
1216 \coordinate (nw) at ([shift={(1.8 cm,1.845 cm)}]nw);
1217 \coordinate (ne) at ([shift={(-1.8 cm,1.845 cm)}]ne);
1218 \pgfornamentline[color=Maroon]{nw}{ne}{3}{88}
1219 \coordinate (sw) at ([shift={(1.8 cm,-1.845 cm)}]sw);
1220 \coordinate (se) at ([shift={(-1.8 cm,-1.845 cm)}]se);
1221 \pgfornamentline[color=Maroon]{sw}{se}{3}{88}
1222 \pgfornamentline[color=Maroon]{sw}{se}{3}{88}
1223 \end{tikzpicture}
1224
1225
1226 \section{Application: Frame around a text}
1227 \label{sec:application_poem}
1228 I chose a poem to illustrate this theme.
1229
1230
1231 \begin{center}
1232 \begin{figure}[h!]
1233 \begin{tikzpicture}
1234 \node[text width=8cm,align=center](Text){%
1235 In visions of the dark night\\
1236 I have dreamed of joy departed-\\
1237 But a waking dream of life and light\
1238 Hath left me broken-hearted.\\
1239
1240 Ah! what is not a dream by day\\
1241 To him whose eyes are cast \\
1242 On things around him with a ray \\
1243 Turned back upon the past? \\
1244
1245 That holy dream- that holy dream,\\
1246 While all the world were chiding,\\
1247 Hath cheered me as a lovely beam\\
1248 A lonely spirit guiding.\\
1249
1250 What though that light, thro' storm and night,\\
1251 So trembled from afar- \\
1252 What could there be more purely bright \\
1253 In Truth's day-star? \\
1254 \vspace{24pt}
1255 A Dream (1827) by Edgar Allan Poe
1256 } ;
1257
1258 \node[inner sep=0pt,shift={(-.5cm,.5cm)},anchor=north west](CNW) at (Text.north west)
1259 {\pgfornament[width=1.75cm]{61}};
1260 \node[inner sep=0pt,shift={(.5cm,.5cm)},anchor=north east](CNE) at (Text.north east)
1261 {\pgfornament[width=1.75cm,symmetry=v]{61}};
1262 \node[inner sep=0pt,shift={(-.5cm,-.5cm)},anchor=south west](CSW) at (Text.south west)
1263 {\pgfornament[width=1.75cm,symmetry=h]{61}};
1264 \node[inner sep=0pt,shift={(.5cm,-.5cm)},anchor=south east](CSE) at (Text.south east)
1265 {\pgfornament[width=1.75cm,symmetry=c]{61}};
1266 \pgfornamenthline{CNW}{CNE}{north}{87}
1267 \pgfornamenthline{CSW}{CSE}{south}{87}
1268 \pgfornamentvline{CNW}{CSW}{west}{87}
1269 \pgfornamentvline{CNE}{CSE}{east}{87}
1270 \end{tikzpicture}
1271 \caption{A poem}
1272 \end{figure}
1273 \end{center}
1274
1275 The poem is placed in a node named \Verb+Text+.
1276 Then we can place the corners relatively to four anchors of the node \Verb+Text+.
1277 Finally with the macros \doccmd{pgfornamenthline} and \doccmd{pgfornamentvline} it's possible to finish the frame.
1278
1279 \begin{tkzexample}[code only,very small]
1280 \begin{tikzpicture}[every node/.style={inner sep=0pt}]
1281 \node[text width=8cm,align=center](Text){%
1282 In visions of the dark night ...} ;
1283 \node[shift={(-1cm,1cm)},anchor=north west](CNW)
1284 at (Text.north west) {\pgfornament[width=1.75cm]{61}};
1285 \node[shift={(1cm,1cm)},anchor=north east](CNE)
1286 at (Text.north east) {\pgfornament[width=1.75cm,symmetry=v]{61}};
1287 \node[shift={(-1cm,-1cm)},anchor=south west](CSW)
1288 at (Text.south west) {\pgfornament[width=1.75cm,symmetry=h]{61}};
1289 \node[shift={(1cm,-1cm)},anchor=south east](CSE)
1290 at (Text.south east) {\pgfornament[width=1.75cm,symmetry=c]{61}};
1291 \pgfornamenthline{CNW}{CNE}{north}{87}
1292 \pgfornamenthline{CSW}{CSE}{south}{87}
1293 \pgfornamentvline{CNW}{CSW}{west}{87}
1294 \pgfornamentvline{CNE}{CSE}{east}{87}
1295 \end{tikzpicture}
1296 \end{tkzexample}
1297
1298 \section{Application: Text inside a frame}
1299 \label{sec:frame}
1300 Firstly we build the frame with the help of nodes and the we place the text in a node relatively to others nodes.
1301
1302 \begin{figure}[h!]
1303 \begin{center}
1304 \newcommand{\framesize}{8 cm}
1305 \begin{tikzpicture}[color=Maroon,
1306 transform shape,
1307 every node/.style={inner sep=0pt}]
1308 \node[minimum size=\framesize,fill=Beige!20](vecbox){};
1309 \node[anchor=north west] at (vecbox.north west){%
1310 \pgfornament[width=0.2*\framesize]{63}};
1311 \node[anchor=north east] at (vecbox.north east){%
1312 \pgfornament[width=0.2*\framesize,symmetry=v]{63}};
1313 \node[anchor=south west] at (vecbox.south west){%
1314 \pgfornament[width=0.2*\framesize,symmetry=h]{63}};
1315 \node[anchor=south east] at (vecbox.south east){%
1316 \pgfornament[width=0.2*\framesize,symmetry=c]{63}};
1317 \node[anchor=north] at (vecbox.north){%
1318 \pgfornament[width=0.6*\framesize,symmetry=h]{46}};
1319 \node[anchor=south] at (vecbox.south){%
1320 \pgfornament[width=0.6*\framesize]{46}};
1321 \node[anchor=north,rotate=90] at (vecbox.west){%
1322 \pgfornament[width=0.6*\framesize,symmetry=h]{46}};
1323 \node[anchor=north,rotate=-90] at (vecbox.east){%
1324 \pgfornament[width=0.6*\framesize,symmetry=h]{46}};
1325 \node[inner sep=6pt] (text) at (vecbox.center){\Huge Ornaments};
1326 \node[anchor=north] at (text.south){%
1327 \pgfornament[width=0.5*\framesize]{75}};
1328 \node[anchor=south] at (text.north){%
1329 \pgfornament[width=0.5*\framesize,symmetry=h]{75}};
1330 \end{tikzpicture}
1331 \caption{Text inside a frame with a tikzpicture's environment}
1332 \end{center}
1333 \end{figure}
1334
1335 \begin{tkzexample}[code only,very small]
1336 \newcommand{\framesize}{8 cm}
1337 \begin{tikzpicture}[color=Maroon,
1338 transform shape,
1339 every node/.style={inner sep=0pt}]
1340 \node[minimum size=\framesize,fill=Beige!10](vecbox){};
1341 \node[anchor=north west] at (vecbox.north west){%
1342 \pgfornament[width=0.2*\framesize]{63}};
1343 \node[anchor=north east] at (vecbox.north east){%
1344 \pgfornament[width=0.2*\framesize,symmetry=v]{63}};
1345 \node[anchor=south west] at (vecbox.south west){%
1346 \pgfornament[width=0.2*\framesize,symmetry=h]{63}};
1347 \node[anchor=south east] at (vecbox.south east){%
1348 \pgfornament[width=0.2*\framesize,symmetry=c]{63}};
1349 \node[anchor=north] at (vecbox.north){%
1350 \pgfornament[width=0.6*\framesize,symmetry=h]{46}};
1351 \node[anchor=south] at (vecbox.south){%
1352 \pgfornament[width=0.6*\framesize]{46}};
1353 \node[anchor=north,rotate=90] at (vecbox.west){%
1354 \pgfornament[width=0.6*\framesize,symmetry=h]{46}};
1355 \node[anchor=north,rotate=-90] at (vecbox.east){%
1356 \pgfornament[width=0.6*\framesize,symmetry=h]{46}};
1357 \node[inner sep=6pt] (text) at (vecbox.center){\Huge Ornaments};
1358 \node[anchor=north] at (text.south){%
1359 \pgfornament[width=0.5*\framesize]{75}};
1360 \node[anchor=south] at (text.north){%
1361 \pgfornament[width=0.5*\framesize,symmetry=h]{75}};
1362 \end{tikzpicture}
1363 \end{tkzexample}
1364 \index{transform shape}
1365 \index{color}
1366 \index{every node}
1367
1368 \section{Application: Other way to get a pentagon}
1369 \label{sec:application_other_way_to_get_a_pentagon}
1370 We can place ornaments manually but the last method can also be used .
1371 \sidenote{\tkzcname{getornamentlength} is ...}
1372
1373 \begin{tkzexample}[code only,very small]
1374 \begin{tikzpicture}[every node={anchor=center,inner sep=0pt}]
1375 \node[regular polygon,
1376 regular polygon sides=5,
1377 minimum size=5cm,
1378 inner sep=0pt](s) {};
1379 \getornamentlength{s}{corner 1}{s}{corner 2}
1380 \node[rotate=216] at (s.side 1)
1381 {\pgfornament[width=\ornamentlen]{88}};
1382 \node[rotate=288] at (s.side 2)
1383 {\pgfornament[width=\ornamentlen]{88}};
1384 \node[rotate=0] at (s.side 3)
1385 {\pgfornament[width=\ornamentlen]{88}};
1386 \node[rotate=72] at (s.side 4)
1387 {\pgfornament[width=\ornamentlen]{88}};
1388 \node[rotate=144] at (s.side 5)
1389 {\pgfornament[width=\ornamentlen]{88}};
1390 \end{tikzpicture}
1391 \end{tkzexample} \index{rotate} \index{regular polygon}
1392
1393
1394 \begin{marginfigure}[-1cm]
1395 \begin{tikzpicture}[every node={anchor=center,inner sep=0pt}]
1396 \node[regular polygon, regular polygon sides=5,
1397 minimum size=5cm,inner sep=0pt](s) {};
1398 \getornamentlength{s}{corner 1}{s}{corner 2}
1399 \node[rotate=216] at (s.side 1){\pgfornament[width=\ornamentlen]{88}};
1400 \node[rotate=288] at (s.side 2){\pgfornament[width=\ornamentlen]{88}};
1401 \node[rotate=0] at (s.side 3){\pgfornament[width=\ornamentlen]{88}};
1402 \node[rotate=72] at (s.side 4){\pgfornament[width=\ornamentlen]{88}};
1403 \node[rotate=144] at (s.side 5){\pgfornament[width=\ornamentlen]{88}};
1404 \end{tikzpicture}
1405 \caption{A pentagon}
1406 \end{marginfigure}
1407
1408 \vspace{60pt}
1409 \section{Package \docpkg{tikzrput}}
1410 \label{sec:package_rput}
1411
1412 Pstricks Users are accustomed to placing objects with \doccmd{rput}\index{rput}, so I created a package \tkzname{\docpkg{tikzrput}} with only one macro \tkzcname{rput}. This macro is used as that of Pstricks with the same argument and options. Next to the document you are reading, you will find documentation on this package. The display of an object at the point $(x,y)$ is realized with \verb|\rput| of \emph{pstricks} like this :\par\medskip
1413
1414 \begin{docspec}
1415 \color{black} \doccmd{rput}[\docopt{refpoint}]\{\docarg{angle}\}%
1416 \docparen{x,y}\{\doccmd{pgfornament[\docopt{options}]\{\docarg{number}\}}\}
1417 \end{docspec}
1418
1419 \subsection{Example with \tkzcname{rput}}
1420 \label{sub:example_with_rput}
1421
1422 \begin{tkzexample}[code only,very small]
1423 \foreach \a in {0,4,...,356}{%
1424 \rput(\a;2){$\bullet$}%
1425 }
1426 \rput[B](0;0){Circle}%
1427 \end{tkzexample} \Imacro{foreach}
1428
1429 \begin{marginfigure}[-3cm]
1430 \hspace*{2cm}
1431 \foreach \a in {0,16,...,356}{%
1432 \rput(\a;2){$\bullet$}%
1433 }
1434 \rput[B](0;0){Circle}%
1435
1436 \vspace*{3cm}
1437 \caption{Example with \tkzcname{rput}}
1438 \end{marginfigure}
1439
1440 \subsection{Ornament with \tkzcname{rput}}
1441 \label{sub:ornament_with}
1442
1443 \setlength{\fboxsep}{0pt}
1444
1445 \begin{tkzexample}[code only,very small]
1446 \begin{picture}(5,4)
1447 \rput(2,1){\pgfornament[width=2cm]{1}}
1448 \rput(4,2){\pgfornament[width=2cm]{2}}
1449 \end{picture}
1450 \end{tkzexample} \Imacro{rput}
1451
1452 \begin{marginfigure}
1453 \begin{picture}(5,4)
1454 \rput(2,1){\pgfornament[color=CadetBlue,width=2cm]{1}}
1455 \rput(4,2){\pgfornament[color=CadetBlue,width=2cm]{2}}
1456 \end{picture}
1457 \caption{Placement with rput}
1458 \end{marginfigure}
1459
1460 \section{Examples from pgfornamenthan}
1461 \label{sec:pgfornamenthan}
1462 \ClearShipoutPictureBG
1463 \newpgfornamentfamily{pgfhan}
1464
1465 \subsection{Example 1 from LianTze Lim}
1466 \label{sub:LianTze1}
1467 \url{https://github.com/liantze/pgfornament-han}
1468
1469 \begin{marginfigure}
1470 \begin{center}
1471 \begin{tikzpicture}
1472 \tikzset{every node/.append style={inner sep=0pt,color=MidnightBlue!50}}
1473 \tikzset{pgfornamentstyle/.style={draw=green!20!black,
1474 fill=orange,fill opacity=.5,thick}}%
1475 \node (nw) {\pgfornament[scale=0.25]{12}};
1476 \node[right=50bp of nw] (ne) {\pgfornament[scale=0.25,symmetry=v]{12}};
1477 \node[below=50bp of nw] (sw) {\pgfornament[scale=0.25,symmetry=h]{12}};
1478 \node[below=50bp of ne] (se) {\pgfornament[scale=0.25,symmetry=c]{12}};
1479 \node[anchor=north west] at (nw.north east) {\pgfornament[scale=0.25]{32}};
1480 \node[anchor=south west] at (sw.south east) {\pgfornament[scale=0.25]{32}};
1481 \node[anchor=south west,rotate=-90] at (nw.south west)
1482 {\pgfornament[scale=0.25]{32}};
1483 \node[anchor=south east,rotate=90] at (ne.south east)
1484 {\pgfornament[scale=0.25]{32}};
1485
1486 \node[anchor=center,shift={(25bp,-25bp)}] at (nw.south east) {\pgfornament[scale=0.5]{57}};
1487 \end{tikzpicture}
1488 \caption{Example 1 LianTze Lim }
1489 \end{center}
1490 \end{marginfigure}
1491 \begin{tkzexample}[code only,very small]
1492 \begin{tikzpicture}
1493 \tikzset{every node/.append style={inner sep=0pt,color=MidnightBlue!50}}
1494 \tikzset{pgfornamentstyle/.style={draw=green!20!black,
1495 fill=orange,fill opacity=.5,thick}}%
1496 \node (nw) {\pgfornament[scale=0.25]{12}};
1497 \node[right=50bp of nw] (ne){\pgfornament[scale=0.25,symmetry=v]{12}};
1498 \node[below=50bp of nw] (sw){\pgfornament[scale=0.25,symmetry=h]{12}};
1499 \node[below=50bp of ne] (se){\pgfornament[scale=0.25,symmetry=c]{12}};
1500 \node[anchor=north west] at (nw.north east)%
1501 {\pgfornament[scale=0.25]{32}};
1502 \node[anchor=south west] at (sw.south east)%
1503 {\pgfornament[scale=0.25]{32}};
1504 \node[anchor=south west,rotate=-90] at (nw.south west)
1505 {\pgfornament[scale=0.25]{32}};
1506 \node[anchor=south east,rotate=90] at (ne.south east)
1507 {\pgfornament[scale=0.25]{32}};
1508 \node[anchor=center,shift={(25bp,-25bp)}] at (nw.south east)
1509 {\pgfornament[scale=0.5]{57}};
1510 \end{tikzpicture}
1511 \end{tkzexample}
1512
1513 \subsection{Example 2 from LianTze Lim}
1514
1515
1516 \begin{marginfigure}
1517 \begin{center}
1518 \begin{tikzpicture}
1519 \tikzset{every node/.append style={color=Goldenrod,inner sep=0pt}}
1520 \node (nw) {\pgfornament[scale=0.25]{23}};
1521 \node[right=53bp of nw] (ne)
1522 {\pgfornament[scale=0.25,symmetry=v]{23}};
1523 \node[anchor=north west,xshift=-2bp] at (nw.north east)
1524 {\pgfornament[scale=0.25]{41}};
1525 \node[anchor=north east,xshift=2bp] at (ne.north west)
1526 {\pgfornament[scale=0.25,symmetry=v]{41}};
1527 \end{tikzpicture}
1528 \end{center}
1529 \caption{Example 2 LianTze Lim }
1530 \end{marginfigure}
1531 \begin{tkzexample}[code only,very small]
1532 \begin{tikzpicture}
1533 \tikzset{every node/.append style={color=Goldenrod,inner sep=0pt}}
1534 \node (nw) {\pgfornament[scale=0.25]{23}};
1535 \node[right=53bp of nw] (ne){\pgfornament[scale=0.4,symmetry=v]{23}};
1536 \node[anchor=north west,xshift=8bp] at (nw.north east)
1537 {\pgfornament[scale=0.25]{41}};
1538 \node[anchor=north east,xshift=-8bp] at (ne.north west)
1539 {\pgfornament[scale=0.25,symmetry=v]{41}};
1540 \end{tikzpicture}
1541 \end{tkzexample}
1542
1543
1544 \clearpage\newpage
1545 \subsection{Example 3 (based on an example of LianTze Lim)}
1546 \newpgfornamentfamily{pgfhan}
1547
1548 \newbox{\fortyseven}
1549 \savebox{\fortyseven}{\pgfornament[scale=0.20,color=MidnightBlue]{47}}
1550 \tikzset{every node/.append style={inner sep=0pt}}
1551 \AddToShipoutPictureBG{\begin{tikzpicture}[overlay,remember picture,color=MidnightBlue]
1552 \node[anchor=north west,shift={(0.7,-0.85)}] at (current page.north west)
1553 (nw) {\pgfornament[scale=0.2]{25}};
1554 \node[anchor=north east,shift={(-0.7,-0.85)}] at (current page.north east)
1555 (ne) {\pgfornament[scale=0.2,symmetry=v]{25}};
1556 \node[anchor=south west,shift={(0.7,0.85)}] at (current page.south west)
1557 (sw) {\pgfornament[scale=0.2,symmetry=h]{25}};
1558 \node[anchor=south east,shift={(-0.7,0.85)}] at (current page.south east)
1559 (se) {\pgfornament[scale=0.2,symmetry=c]{25}};
1560 \begin{scope}[start chain,node distance=-3pt]
1561 \node[anchor=north west,on chain] at (nw.north east) {\usebox{\fortyseven}};
1562 \foreach \i in {1,...,14} {\node[on chain]{\usebox{\fortyseven}};}
1563 \end{scope}
1564 \begin{scope}[start chain,node distance=-3pt]
1565 \node[anchor=south west,on chain] at (sw.south east) {\usebox{\fortyseven}};
1566 \foreach \i in {1,...,6} \node[on chain]{\usebox{\fortyseven}};
1567 \end{scope}
1568 \begin{scope}[start chain=going left,node distance=-3pt]
1569 \node[anchor=south east,on chain,xshift={3pt}] at (se.south west) {\usebox{\fortyseven}};
1570 \foreach \i in {1,...,6} \node[on chain]{\usebox{\fortyseven}};
1571 \end{scope}
1572 \foreach \i in {0,...,22}
1573 \node[anchor=south west,rotate=-90,shift={($\i*(31bp,0)$)}] at (nw.south west)
1574 {\usebox{\fortyseven}};
1575 \foreach \i in {0,...,22}
1576 \node[anchor=south east,rotate=90,shift={($\i*(-31bp,0)$)}] at ([yshift={+3pt}]ne.south east)
1577 {\usebox{\fortyseven}};
1578 \node[yshift=32pt] at (current page.south) {\pgfornament[scale=0.1]{51}};
1579 \node[yshift=32pt,text=black] at (current page.south) {\large\thepage};
1580 \end{tikzpicture}}
1581
1582 \begin{center}
1583 \begin{tikzpicture}
1584 \tikzset{every node/.append style={MidnightBlue,inner sep=0pt,node distance=0pt}}
1585 \node (nw) {\pgfornament[scale=0.2]{6}};
1586 \node[right=100bp of nw] (ne){\pgfornament[scale=0.2,symmetry=v]{16}};
1587 \node[below=-8bp of nw] (sw) {\pgfornament[scale=0.2,symmetry=h]{16}};
1588 \node[below=-8bp of ne] (se) {\pgfornament[scale=0.2,symmetry=c]{6}};
1589 \node[anchor=north west,xscale=2.5] at (nw.north east)
1590 {\pgfornament[scale=0.2]{30}};
1591 \node[anchor=south west,xscale=2.5] at (sw.south east)
1592 {\pgfornament[scale=0.2]{30}};
1593 \node[font=\Large,text=black,shift={(50bp,4bp)}] at (nw.south east) {Code from the frame};
1594 \end{tikzpicture}
1595 \end{center}
1596
1597 \begin{tkzexample}[code only, very small]
1598 \newpgfornamentfamily{pgfhan}
1599 \newbox{\fortyseven}
1600 \savebox{\fortyseven}{\pgfornament[scale=0.20,color=MidnightBlue]{47}}
1601 \tikzset{every node/.append style={inner sep=0pt}}
1602 \AddToShipoutPictureBG{%
1603 \begin{tikzpicture}[overlay,remember picture,color=MidnightBlue]
1604 \node[anchor=north west,shift={(0.7,-0.85)}] at (current page.north west)
1605 (nw) {\pgfornament[scale=0.2]{25}};
1606 \node[anchor=north east,shift={(-0.7,-0.85)}] at (current page.north east)
1607 (ne) {\pgfornament[scale=0.2,symmetry=v]{25}};
1608 \node[anchor=south west,shift={(0.7,0.85)}] at (current page.south west)
1609 (sw) {\pgfornament[scale=0.2,symmetry=h]{25}};
1610 \node[anchor=south east,shift={(-0.7,0.85)}] at (current page.south east)
1611 (se) {\pgfornament[scale=0.2,symmetry=c]{25}};
1612 \begin{scope}[start chain,node distance=-3pt]
1613 \node[anchor=north west,on chain] at (nw.north east)
1614 {\usebox{\fortyseven}};
1615 \foreach \i in {1,...,14} {\node[on chain]{\usebox{\fortyseven}};}
1616 \end{scope}
1617 \begin{scope}[start chain,node distance=-3pt]
1618 \node[anchor=south west,on chain] at (sw.south east)
1619 {\usebox{\fortyseven}};
1620 \foreach \i in {1,...,6} \node[on chain]{\usebox{\fortyseven}};
1621 \end{scope}
1622 \begin{scope}[start chain=going left,node distance=-3pt]
1623 \node[anchor=south east,on chain,xshift={3pt}] at (se.south west)
1624 {\usebox{\fortyseven}};
1625 \foreach \i in {1,...,6} \node[on chain]
1626 {\usebox{\fortyseven}};
1627 \end{scope}
1628 \foreach \i in {0,...,22}
1629 \node[anchor=south west,rotate=-90,
1630 shift={($\i*(31bp,0)$)}] at (nw.south west)
1631 {\usebox{\fortyseven}};
1632 \foreach \i in {0,...,22}
1633 \node[anchor=south east,rotate=90,shift={($\i*(-31bp,0)$)}] at
1634 ([yshift={+3pt}]ne.south east){\usebox{\fortyseven}};
1635 \node[yshift=32pt] at (current page.south){\pgfornament[scale=0.1]{51}};
1636 \node[yshift=32pt,text=black] at (current page.south){\large\thepage};
1637 \end{tikzpicture}
1638 }
1639 \end{tkzexample}
1640
1641 \clearpage \newpage
1642 \subsection{Example 4 (based on an example of LianTze Lim)}
1643 \begin{figure}
1644 \begin{newfamily}[pgfhan]
1645 \begin{center}
1646 \begin{tikzpicture}
1647 \tikzset{every node/.append style={inner sep=0pt,color= MidnightBlue}}
1648 \node[minimum width=180bp,minimum height=100bp] (chframe){};
1649 \node[anchor=north west] (nw) at (chframe.north west)
1650 {\pgfornament[scale=0.25]{1}};
1651 \node[anchor=north east] at (chframe.north east)
1652 {\pgfornament[symmetry=v,scale=0.25]{1}};
1653 \node[anchor=south west] (sw) at (chframe.south west)
1654 {\pgfornament[symmetry=h,scale=0.25]{1}};
1655 \node[anchor=south east] at (chframe.south east)
1656 {\pgfornament[symmetry=c,scale=0.25]{1}};
1657 \node[anchor=south west,xscale=2] at (sw.south east)
1658 {\pgfornament[scale=0.25]{29}};
1659 \node[anchor=north west,xscale=2] at (nw.north east)
1660 {\pgfornament[scale=0.25]{29}};
1661 % circle
1662 \begin{scope}
1663 \tikzset{pgfornamentstyle/.style={draw=Goldenrod,fill=Red,line width=1pt}}
1664 \node[fill=MidnightBlue,circle,draw=Red,line width=2pt,inner sep=-8pt]
1665 at (chframe.center) {\pgfornament[scale=0.40]{56}};
1666 \end{scope}
1667 \end{tikzpicture}
1668 \end{center}
1669 \end{newfamily}
1670 \end{figure}
1671
1672 \begin{tkzexample}[code only, very small]
1673 \begin{newfamily}[pgfhan]
1674 \begin{center}
1675 \begin{tikzpicture}
1676 \tikzset{every node/.append style={%
1677 inner sep=0pt,
1678 color= MidnightBlue}}
1679 \node[minimum width=180bp,minimum height=100bp] (chframe){};
1680 \node[anchor=north west] (nw) at (chframe.north west)
1681 {\pgfornament[scale=0.25]{1}};
1682 \node[anchor=north east] at (chframe.north east)
1683 {\pgfornament[symmetry=v,scale=0.25]{1}};
1684 \node[anchor=south west] (sw) at (chframe.south west)
1685 {\pgfornament[symmetry=h,scale=0.25]{1}};
1686 \node[anchor=south east] at (chframe.south east)
1687 {\pgfornament[symmetry=c,scale=0.25]{1}};
1688 \node[anchor=south west,xscale=2] at (sw.south east)
1689 {\pgfornament[scale=0.25]{29}};
1690 \node[anchor=north west,xscale=2] at (nw.north east)
1691 {\pgfornament[scale=0.25]{29}};
1692 % circle
1693 \begin{scope}
1694 \tikzset{pgfornamentstyle/.style={draw=Goldenrod,
1695 fill=Red,
1696 line width=1pt}}
1697 \node[fill=MidnightBlue,circle,draw=Red,
1698 line width=2pt,inner sep=-8pt]
1699 at (chframe.center) {\pgfornament[scale=0.40]{56}};
1700 \end{scope}
1701 \end{tikzpicture}
1702 \end{center}
1703 \end{newfamily}
1704 \end{tkzexample}
1705
1706 \clearpage \newpage
1707 \ClearShipoutPicture
1708 \newpgfornamentfamily{vectorian}
1709 \section{Examples from psvectorian}
1710 \label{sec:psvectorian}
1711
1712 \subsection{Large Title -- e01}
1713 \label{sub:largetitle}
1714 This example is given here :
1715 \url{http://melusine.eu.org/syracuse/pstricks/vectorian/e01.tex}.
1716
1717 I use the macro \Verb|rput| from my package tikzrput to get the figure with the same code.
1718 I only replace \doccmd{psvectorian} by \doccmd{pgfornament}.
1719
1720 \begin{figure}
1721 \begin{center}
1722 \rput[r](-3pt,3pt){\pgfornament[scale=.35]{72}}
1723 \Large{Motifs d'ornements}%
1724 \rput[l](3pt,3pt){\pgfornament[scale=.35]{73}}\\
1725 \rput(0,0){\pgfornament[scale=.5]{85}}
1726 \end{center}
1727 \caption{Example named e01 in psvectorian}
1728 \end{figure}
1729 \begin{tkzexample}[code only,very small]
1730 \rput[r](-3pt,3pt){\pgfornament[scale=.35]{72}}
1731 \large{Motifs d'ornements}%
1732 \rput[l](3pt,3pt){\pgfornament[scale=.35]{73}}\\
1733 \rput(0,0){\pgfornament[scale=.5]{85}}
1734 \end{tkzexample}
1735
1736 \subsection{Cover with frame -- e02}
1737 This example is given here
1738
1739 {\small\url{http://melusine.eu.org/syracuse/pstricks/vectorian/e02.tex}}
1740
1741 I need \docenv{tikzpicture} and \doccmd{draw} to replace \docenv{pspicture} and \doccmd{psframe}.
1742
1743 \begin{figure}
1744 \begin{center}
1745 \begin{tikzpicture}[color=blue]
1746 \draw[use as bounding box,thin] (-5,-5) rectangle (5,5);
1747 \node {\rput[tl](-3,5){\pgfornament[width=6cm]{71}}
1748 \rput[bl](-3,-5){\pgfornament[width=6cm,,symmetry=h]{71}}
1749 \rput[tl](-5,5){\pgfornament[width=2cm]{63}}
1750 \rput[tr](5,5){\pgfornament[width=2cm,,symmetry=v]{63}}
1751 \rput[bl](-5,-5){\pgfornament[width=2cm,,symmetry=h]{63}}
1752 \rput[br](5,-5){\pgfornament[width=2cm,,symmetry=c]{63}}
1753 \rput[bl]{-90}(-5,3){\pgfornament[width=6cm]{46}}
1754 \rput[bl]{90}(5,-3){\pgfornament[width=6cm]{46}}
1755 \rput(0,0){\Huge Ornaments}
1756 \rput[t](0,-0.5){\pgfornament[width=5cm]{75}}
1757 \rput[b](0,0.5){\pgfornament[width=5cm]{69}}
1758 \rput[tr]{-30}(-1,2.5){\pgfornament[width=2cm]{57}}
1759 \rput[tl]{30}(1,2.5){\pgfornament[width=2cm,symmetry=v]{57}}};
1760 \end{tikzpicture}
1761 \end{center}
1762 \caption{Example named e02 in psvectorian}
1763 \end{figure}
1764
1765 \begin{tkzexample}[code only,very small]
1766 \begin{tikzpicture}[color=blue]
1767 \draw[use as bounding box,thin] (-5,-5) rectangle (5,5);
1768 \node {\rput[tl](-3,5){\pgfornament[width=6cm]{71}}
1769 \rput[bl](-3,-5){\pgfornament[width=6cm,,symmetry=h]{71}}
1770 \rput[tl](-5,5){\pgfornament[width=2cm]{63}}
1771 \rput[tr](5,5){\pgfornament[width=2cm,,symmetry=v]{63}}
1772 \rput[bl](-5,-5){\pgfornament[width=2cm,,symmetry=h]{63}}
1773 \rput[br](5,-5){\pgfornament[width=2cm,,symmetry=c]{63}}
1774 \rput[bl]{-90}(-5,3){\pgfornament[width=6cm]{46}}
1775 \rput[bl]{90}(5,-3){\pgfornament[width=6cm]{46}}
1776 \rput(0,0){\Huge Ornaments}
1777 \rput[t](0,-0.5){\pgfornament[width=5cm]{75}}
1778 \rput[b](0,0.5){\pgfornament[width=5cm]{69}}
1779 \rput[tr]{-30}(-1,2.5){\pgfornament[width=2cm]{57}}
1780 \rput[tl]{30}(1,2.5){\pgfornament[width=2cm,symmetry=v]{57}}};
1781 \end{tikzpicture}
1782 \end{tkzexample}
1783
1784 \vspace{30pt}
1785 \subsection{Little Title -- e03}
1786 This example is given here
1787
1788 {\small\url{http://melusine.eu.org/syracuse/pstricks/vectorian/e03.tex}}
1789
1790 I corrected a little problem with blank space around the text.
1791
1792 \begin{tkzexample}[code only,very small]
1793 \rput[r](-2pt,6pt){\pgfornament[,height=1cm]{21}}
1794 {\Large Texte}%
1795 \rput[l](2pt,6pt){\pgfornament[height=1cm]{23}}
1796 \end{tkzexample}
1797
1798 \begin{marginfigure}
1799 \begin{center}
1800 \rput[r](-2pt,6pt){\pgfornament[height=1cm]{21}}%
1801 {\Large Title}%
1802 \rput[l](2pt,6pt){\pgfornament[height=1cm]{23}}%
1803 \end{center}
1804 \caption{Example named e03}
1805 \end{marginfigure}
1806
1807 \vspace{30pt}
1808 \section{Advanced usage}
1809 \label{sec:advanced_usage}
1810
1811 \subsection{Look at the code}
1812 \label{sub:look_at_the_code}
1813 The package first define the name of the family of ornament \tkzname{\OrnamentsFamily} by default it's \tkzname{vectorian}.
1814
1815 \begin{tkzexample}[code only,very small]
1816 \begin{tikzpicture}[%
1817 baseline={([yshift=\pgfornamentydelta]%
1818 current bounding box.\pgfornamentanchor)},pgfornamentstyle]
1819 \pgftransformscale{\pgfornamentscale}%
1820 \pgf@@ornament{#2}%
1821 \end{tikzpicture}%
1822 \end{tkzexample}
1823
1824 \medskip
1825 Options for placement are \tkzname{yshift=}\doccmd{pgfornamentydelta} and \doccmd{pgfornamentanchor} . Options for aspect are \docStyle{pgfornamentstyle} and \doccmd{pgfornamentscale} .
1826 The object is called by \doccmd{pgf@@ornament}. This macro define locally other macros used for creating the symbols and it loads the symbol with \Verb|\@@input \OrnamentsFamily#1.pgf.|.
1827 The symbol with the rank \Verb|#1| in the family \doccmd{OrnamentsFamily} is loaded.
1828
1829 \begin{tkzexample}[code only,very small]
1830 \def\pgf@@ornament#1{%
1831 \begingroup
1832 \def\i{\pgfusepath{clip}}%
1833 \let\o\pgfpathclose
1834 \let\s\pgfusepathqfillstroke
1835 \def\p ##1##2{\pgfqpoint{##1bp}{##2bp}}%
1836 \def\m ##1 ##2 {\pgfpathmoveto{\p{##1}{##2}}}%
1837 \def\l ##1 ##2 {\pgfpathlineto{\p{##1}{##2}}}%
1838 \def\r ##1 ##2 ##3 ##4 {\pgfpathrectangle{\p{##1}{##2}}{%
1839 \p{##3}{##4}}}%
1840 \def\c ##1 ##2 ##3 ##4 ##5 ##6 {%
1841 \pgfpathcurveto{\p{##1}{##2}}{\p{##3}{##4}}{\p{##5}{##6}}}%
1842 \@@input \OrnamentsFamily#1.pgf%
1843 \endgroup}%
1844 \end{tkzexample}
1845
1846 \medskip
1847 A symbol : the next code is used to define the first object of the family \tkzname{am}. For example I created two very simple vector ornaments am1.pgf \sidenote{The next code defines this ornament\label{am1def}} and am2.pgf . Actually the family \tkzname{am} is only composed by two elements.
1848
1849 The real definition of an object uses a lot of bytes, with the mechanism\thanks{I received an useful help from \emph{Enrico Gregorio}} described above, I can save the object like this :
1850
1851 \begin{tkzexample}[code only,very small]
1852 \m 0 0
1853 \c 50 0 150 0 200 16
1854 \c 250 0 350 0 400 0
1855 \l 400 1
1856 \c 350 0 250 0 200 22
1857 \c 150 0 50 0 0 1
1858 \l 0 0
1859 \s
1860 \endinput
1861 \end{tkzexample}
1862
1863 \vspace{30pt}
1864 \subsection{How to use the code differently}
1865 \label{sub:how_to_use_the_code_differently}
1866 For example you can create a new macro to call an object of another family and you can modifiy the object.
1867
1868 \begin{tkzexample}[code only,very small]
1869 \makeatletter
1870 \newcommand{\callornament}[1]{%
1871 \begingroup
1872 \def\i{\pgfusepath{clip}}%
1873 \let\o\pgfpathclose
1874 \let\s\pgfusepathqfillstroke
1875 \def\p ##1##2{\pgfqpoint{##1bp}{##2bp}}%
1876 \def\m ##1 ##2 {\pgfpathmoveto{\p{##1}{##2}}}%
1877 \def\l ##1 ##2 {\pgfpathlineto{\p{##1}{##2}}}%
1878 \def\r ##1 ##2 ##3 ##4 {\pgfpathrectangle{\p{##1}{##2}}{%
1879 \p{##3}{##4}}}%
1880 \def\c ##1 ##2 ##3 ##4 ##5 ##6 {%
1881 \pgfpathcurveto{\p{##1}{##2}}{\p{##3}{##4}}{\p{##5}{##6}}}%
1882 \@@input #1\relax
1883 \m 0 0 \l 400 0 \o\s
1884 \endgroup}
1885 \makeatother
1886 \end{tkzexample}
1887 \Imacro{pgfusepath} \Imacro{pgfpathclose} \Imacro{pgfqpoint}
1888 \Imacro{pgfpathmoveto} \Imacro{pgfpathlineto} \Imacro{pgfpathcurveto}
1889
1890 \begin{tkzexample}[code only,very small]
1891 \tikz[scale=.5] \callornament{am1.pgf} ;
1892 \end{tkzexample}
1893
1894 \begin{marginfigure}
1895 \tikz[scale=.3] \callornament{am1.pgf} ;
1896 \caption{Usage of another family}
1897 \end{marginfigure}
1898
1899 \vspace{30pt}
1900 \subsection{Define a symbol with Inskape}
1901 \label{sub:define_a_symbol_with_inskape}
1902 You can create a symbol with \tkzname{Inskape}\index{Inskape}, then you save the symbol with the format \tkzname{LaTeX with \docpkg{Pstricks}}.
1903
1904
1905 \begin{tkzexample}[code only,very small]
1906 %LaTeX with PSTricks extensions
1907 %%Creator: inkscape 0.48.2
1908 %%Please note this file requires PSTricks extensions
1909 \psset{xunit=.5pt,yunit=.5pt,runit=.5pt}
1910 \begin{pspicture}(744.09448242,1052.36218262)
1911 {
1912 \newrgbcolor{curcolor}{0 0 0}
1913 \pscustom[linewidth=1,linecolor=curcolor]
1914 {
1915 \newpath
1916 \moveto(231.428,665.714)
1917 \curveto(235.869,658.981)(224.543,656.406)(220.238,658.333)
1918 \curveto(208.570,663.555)(209.816,679.616)(216.666,688.095)
1919 \curveto(228.919,703.261)(252.107,700.575)(265.000,687.857)
1920 \curveto(283.919,669.192)(279.643,638.050)(260.952,620.952)
1921 \curveto(236.039,598.163)(196.704,604.097)(175.476,628.809)
1922 \curveto(148.762,659.906)(156.386,707.535)(187.142,732.857)
1923 \curveto(224.393,763.525)(280.367,754.197)(309.761,717.380)
1924 \curveto(344.402,673.993)(333.361,609.645)(290.476,576.190)
1925 \curveto(240.963,537.565)(168.220,550.325)(130.714,599.285)
1926 \curveto(88.097,654.917)(102.579,736.068)(157.619,777.619)
1927 \curveto(219.364,824.233)(308.932,808.026)(354.523,746.904)
1928 \curveto(405.139,679.048)(387.205,581.057)(319.999,531.428)
1929 \curveto(294.222,512.3928)(262.917,501.397)(230.928,499.848)
1930 }
1931 }
1932 \end{pspicture}
1933 \end{tkzexample}
1934
1935
1936 You modify the code like this : \sidenote{You can also modify all the coordinates if you don't want to use \tkzcname{pgftransformscale} }
1937
1938 \begin{tkzexample}[code only,very small]
1939 \begingroup
1940 \def\i{\pgfusepath{clip}}%
1941 \def\k{\pgfusepath{stroke}}%
1942 \let\o\pgfpathclose
1943 \let\s\pgfusepathqfillstroke
1944 \def\p #1#2{\pgfqpoint{#1bp}{#2bp}}%
1945 \def\m #1 #2 {\pgfpathmoveto{\p{#1}{#2}}}%
1946 \def\r #1 #2 #3 #4 {\pgfpathrectangle{\p{#1}{#2}}{%
1947 \p{#3}{#4}}}%
1948 \def\l #1 #2 {\pgfpathlineto{\p{#1}{#2}}}%
1949 \def\c #1 #2 #3 #4 #5 #6 {%
1950 \pgfpathcurveto{\p{#1}{#2}}{\p{#3}{#4}}{\p{#5}{#6}}}%
1951 \begin{tikzpicture}
1952 \pgftransformscale{.4}
1953 \m 231.428 665.714
1954 \c 235.869 658.981 224.543 656.406 220.238 658.333
1955 \c 208.570 663.555 209.816 679.616 216.666 688.095
1956 \c 228.919 703.261 252.107 700.575 265.000 687.857
1957 \c 283.919 669.192 279.643 638.050 260.952 620.952
1958 \c 236.039 598.163 196.704 604.097 175.476 628.809
1959 \c 148.762 659.906 156.386 707.535 187.142 732.857
1960 \c 224.393 763.525 280.367 754.197 309.761 717.380
1961 \c 344.402 673.993 333.361 609.645 290.476 576.190
1962 \c 240.963 537.565 168.220 550.325 130.714 599.285
1963 \c 88.097 654.917 102.579 736.068 157.619 777.619
1964 \c 219.364 824.233 308.932 808.026 354.523 746.904
1965 \c 405.139 679.048 387.205 581.057 319.999 531.428
1966 \c 294.222 512.392 262.917 501.397 230.928 499.848
1967 \k
1968 \end{tikzpicture}
1969 \endgroup
1970 \end{tkzexample}
1971
1972 \begin{marginfigure}[-5cm]
1973 \begingroup
1974 \def\i{\pgfusepath{clip}}%
1975 \def\k{\pgfusepath{stroke}}%
1976 \let\o\pgfpathclose
1977 \let\s\pgfusepathqfillstroke
1978 \def\p #1#2{\pgfqpoint{#1bp}{#2bp}}%
1979 \def\m #1 #2 {\pgfpathmoveto{\p{#1}{#2}}}%
1980 \def\r #1 #2 #3 #4 {\pgfpathrectangle{\p{#1}{#2}}{%
1981 \p{#3}{#4}}}%
1982 \def\l #1 #2 {\pgfpathlineto{\p{#1}{#2}}}%
1983 \def\c #1 #2 #3 #4 #5 #6 {%
1984 \pgfpathcurveto{\p{#1}{#2}}{\p{#3}{#4}}{\p{#5}{#6}}}%
1985 \begin{tikzpicture}
1986 \pgftransformscale{.5}
1987 \m 231.428 665.714
1988 \c 235.869 658.981 224.543 656.406 220.238 658.333
1989 \c 208.570 663.555 209.816 679.616 216.666 688.095
1990 \c 228.919 703.261 252.107 700.575 265.000 687.857
1991 \c 283.919 669.192 279.643 638.050 260.952 620.952
1992 \c 236.039 598.163 196.704 604.097 175.476 628.809
1993 \c 148.762 659.906 156.386 707.535 187.142 732.857
1994 \c 224.393 763.525 280.367 754.197 309.761 717.380
1995 \c 344.402 673.993 333.361 609.645 290.476 576.190
1996 \c 240.963 537.565 168.220 550.325 130.714 599.285
1997 \c 88.097 654.917 102.579 736.068 157.619 777.619
1998 \c 219.364 824.233 308.932 808.026 354.523 746.904
1999 \c 405.139 679.048 387.205 581.057 319.999 531.428
2000 \c 294.222 512.392 262.917 501.397 230.928 499.848
2001 \k
2002 \end{tikzpicture}
2003 \endgroup
2004 \caption{Symbol from Inskape}
2005 \end{marginfigure}
2006
2007 \vspace{30pt}
2008 \subsection{From .eps or .mps file}
2009 \label{sub:from_eps_or_mps_file}
2010 Another symbol : \sidenote{ You can create a new family name \tkzname{symb} and you save the new code in a file \tkzname{symb1.pgf}. It's the first vector object of the new family}.
2011 \begin{tkzexample}[code only,very small]
2012 \begin{tikzpicture}
2013 \pgftransformscale{.4}
2014 \m 71.43 238.86
2015 \l 310.29 238.86
2016 \l 310.29 332.57
2017 \l 428.57 214.29
2018 \l 310.29 96.00
2019 \l 310.29 189.71
2020 \l 71.43 189.71
2021 \l 71.43 238.86
2022 \s
2023 \m 453.14 381.71
2024 \l 500.00 381.71
2025 \l 500.00 46.86
2026 \l 453.14 46.86
2027 \l 453.14 381.71
2028 \s
2029 \end{tikzpicture}
2030 \end{tkzexample}
2031
2032 \begin{marginfigure}[-5cm]
2033 \begingroup
2034 \def\i{\pgfusepath{clip}}%
2035 \def\k{\pgfusepath{stroke}}%
2036 \let\o\pgfpathclose
2037 \let\s\pgfusepathqfillstroke
2038 \def\p #1#2{\pgfqpoint{#1bp}{#2bp}}%
2039 \def\m #1 #2 {\pgfpathmoveto{\p{#1}{#2}}}%
2040 \def\r #1 #2 #3 #4 {\pgfpathrectangle{\p{#1}{#2}}{%
2041 \p{#3}{#4}}}%
2042 \def\l #1 #2 {\pgfpathlineto{\p{#1}{#2}}}%
2043 \def\c #1 #2 #3 #4 #5 #6 {%
2044 \pgfpathcurveto{\p{#1}{#2}}{\p{#3}{#4}}{\p{#5}{#6}}}%
2045 \begin{tikzpicture}
2046 \pgftransformscale{.3}
2047 \m 71.43 238.86
2048 \l 310.29 238.86
2049 \l 310.29 332.57
2050 \l 428.57 214.29
2051 \l 310.29 96.00
2052 \l 310.29 189.71
2053 \l 71.43 189.71
2054 \l 71.43 238.86
2055 \s
2056 \m 453.14 381.71
2057 \l 500.00 381.71
2058 \l 500.00 46.86
2059 \l 453.14 46.86
2060 \l 453.14 381.71
2061 \s
2062 \end{tikzpicture}
2063 \endgroup
2064 \caption{Symbol from .eps file}
2065 \end{marginfigure}
2066
2067 \section{Problem}
2068 \label{sec:problem}
2069 If you got an error like "Package tikz Error: + or - expected.", perhaps there is a conflict with the babel package.
2070 It's possible to resolve this type of conflict with \Verb|\shorthandoff{!}| just before your tikzpicture. You can also write in your preamble
2071
2072 \begin{tkzexample}[code only,very small]
2073 \tikzset{every picture/.prefix style={%
2074 execute at begin picture=\shorthandoff{!}}}
2075 \end{tkzexample} \index{shorthandoff}
2076
2077 and finally you can use \Verb|\usetikzlibrary{babel}| only with pgf 3.0
2078 In french, you can get an error with ! : , and ;. Babel makes these characters activ
2079
2080 If you got a problem with the option \Verb|at| replace \Verb|at| by \Verb|ornament/at|.
2081
2082 \printindex
2083
2084 \end{document}
2085
2086
2087
2088
2089
2090
2091
2092
2093