summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-texte.tex
blob: 8b7fb13c4849bdab62aa1ac2e48b00eb54691a40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
\section{Textes et Légendes} 

\subsection{Placer un titre}  
On peut bien sûr utiliser \TIKZ, mais la macro que je propose permet de placer le texte en utilisant les unités choisies pour le dessin.

\emph{les options sont toujours celles de \TIKZ, en particulier les suivantes~:} 
\begin{NewMacroBox}{tkzText}{\oarg{local options}\parg{point}\var{text}}
Le point peut soit être donné par ses coordonnées, soit par son nom.
\hypertarget{text}{}

\begin{tabular}{lll}  
\toprule
options  & défaut & définition\\
\midrule
\TOline{color   }{|black|}{couleur courante}
\TOline{text    }{|black|}{couleur du texte}
\TOline{fill    }{|white|}{couleur du fond} 
\TOline{opacity }{|1|    }{opacité} 
\end{tabular}
\end{NewMacroBox}

\subsubsection{Un titre} 

\begin{tkzexample}[latex=8cm]
\begin{tikzpicture}
  \tkzInit[xmax  = 6,   ymin  = 1000,%
           ymax  = 4000,ystep = 1000]
  \tkzAxeXY 
  \tkzText[draw,
           line width = 1pt,%
           color    = red,%
           fill = orange!20](3,4000)%
           {Recette en fonction du mois}
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Draft} 

\begin{tkzexample}[latex=8cm]
\begin{tikzpicture}
  \tkzInit[xmax  = 6,   ymin  = 1000,%
           ymax  = 4000,ystep = 1000]
  \tkzGrid   \tkzAxeXY
  \tkzText[draw,opacity=.2,
           rotate=45,inner sep=.6 cm,
           line width = 1pt,
           color = black,
           fill = purple!20](3,2500)
           {\Huge DRAFT}
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Texte avec un point}
Il est possible de donner la référence d'un point à la place de ses coordonnées.

\begin{tkzexample}[latex=8cm]
\begin{tikzpicture}
  \tkzInit[ymax=5,xmax=6]
  \tkzAxeXY 
  \tkzDefPoint(3,3){A}
  \tkzText[draw,opacity=.6,
           inner sep=.6 cm,
           line width = 1pt,
           color    = black,
           fill = purple!20](A)
           {Mon texte}
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Format du texte}
 L'option \tkzname{text width} est intéressante, voir le pgfmanual pour plus d'informations.
\begin{tkzexample}[latex=8cm,small]
\begin{tikzpicture}
  \tkzInit[ymax=5,xmax=6]
  \tkzAxeXY 
  \tkzText[draw,opacity=.6,
           inner sep=.6 cm,
           line width = 1pt,
           color    = black,
           fill = purple!20,
           text width=3cm](3,3)
           {Mon texte\\ Référence}
\end{tikzpicture}
\end{tkzexample}    

\subsection{Placer des légendes}
Il y a deux façons d'utiliser cette macro. Soit on place des légendes pour des courbes. Alors, il faut représenter des lignes avec leur style propre, soit il s'agit de différencier des symboles (mark).

\begin{NewMacroBox}{tkzLegend}{\oarg{local options}\var{mark/couleur/size/text}}\hypertarget{legend}{}
Les arguments diffèrent en fonction du booléen \tkzname{line}. 

\medskip
\begin{tabular}{lll}  
\toprule
options  & défaut & définition\\
\midrule
\TOline{line}{false}{booléen  :ligne ou  symbole}
\end{tabular}
 
Avec |line=true|

\begin{tabular}{lll}  
\toprule
arguments  & défaut & exemple\\
\midrule
\TAline{style/line width/couleur/texte}{pas de défaut}{dashed/1pt/red/Recette}
\end{tabular}  

\medskip
Avec |line=false|
  
\begin{tabular}{lll}  
\toprule
arguments  & défaut & exemple\\
\midrule
\TAline{mark/mark size/couleur/texte}{pas de défaut}{heart/1ex/red!30/Recette produit A}
\end{tabular}

\medskip
{On peut modifier la longueur de la ligne dans \tkzname{tkz-base.cfg}} 
\begin{tkzltxexample}[]
  \def\tkz@legend@line@len{.5cm}
\end{tkzltxexample}  
\end{NewMacroBox}

\subsubsection{Légendes avec des symboles}

\begin{tkzexample}[vbox]
 \begin{tikzpicture}
\tkzInit[xmax=12,ymin=1000,ymax=11000,ystep=2000]
\tkzGrid[color=orange!30]
\tkzDrawX[below right,label=Mois]
\tkzDrawY[above left,label=Recette]
\tkzLabelX
\tkzLabelY
\tkzDefSetOfPoints{1/2000,2/3000,3/2000,4/2500,5/4200,6/4800,7/4600,
                   8/5200,9/6200,10/7000,11/7400,12/10000}
\tkzDefSetOfPoints[prefix=P]{1/3200,2/4100,3/3300,4/3300,5/5000,6/5500,7/5200,8/4000,
         9/3000,10/6000,11/8400,12/9000}
\tkzSetUpMark[mark=heart,color=black,fill=red!30,size=4pt]
\tkzJoinSetOfPoints[thick,color=brown,double]
\tkzDrawSetOfPoints
\tkzJoinSetOfPoints[prefix=P,thick,color=orange,double]
\tkzDrawSetOfPoints[prefix=P,mark=square*,mark size=4pt,
                    mark options={color=blue,fill=blue!40}]
\tkzLegend[draw,rounded corners,fill=orange!20,text=brown,
          line width=2pt](5,10000){heart/1ex/red!30/Recette produit A,%
                                   square*/0.75ex/blue!40/Recette produit B}
\end{tikzpicture}
\end{tkzexample}



\endinput