summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-graph/doc/latex/TKZdoc-gr-edge.tex
blob: 1c662139ca84cd35ce8c777ff1fadbbfa67c5c22 (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
\section{Edge avec tkz-graph}

\begin{NewMacroBox}{Edge}{\oarg{local options}\varp{Vertex A}\varp{Vertex B}}

\begin{tabular}{lllc} 
options              & défaut     & définition       \\ \midrule
\TOline{local}       {false}      {booléen désactive EdgeStyle } 
\TOline{color}       {\textbackslash EdgeColor}  {couleur de l'arête}       
\TOline{lw}          {\textbackslash EdgeLineWidth} {épaisseur de l'arête.} 
\TOline{label}       {\{\}}    {le label}                        
\TOline{labeltext}   {black}    {couleur du texte}               
\TOline{labelcolor}  {white}    {couleur du fond du label }      
\TOline{labelstyle}  {\{\}}  {modication du style du label}      
\TOline{style}       {pos=.5}   {modification du style général}                  \bottomrule
\end{tabular}

\medskip
\emph{Cette macro permet de tracer une arête entre deux sommets. Dans les exemples et dans le chapitre sur les styles, l'usage des styles est expliqué.  }
\end{NewMacroBox}



\medskip
\subsection{Utilisation de \addbs{Edge}}
 On peut remarquer qu'il y a deux sortes d'arêtes au niveau de la forme  : les segments et les arcs. De plus, ces arêtes peuvent avoir un label. La notion de style est importante car on peut définir pour toutes les arêtes un même style dès le début.

par défaut :

\begin{tkzexample}[latex=8cm, small]
\begin{tikzpicture}
  \SetGraphUnit{4}
  \Vertex{a}
  \EA(a){b} 
  \SO[unit=2](a){c}
  \EA(c){d}
 {\SetGraphUnit{2}  
  \SO(c){e}}
  \EA(e){f}
  \Edge(a)(b)
  \tikzset{EdgeStyle/.style = {-,bend left}}
  \Edge(c)(d)
  \tikzset{EdgeStyle/.style = {->,bend right=60}}
  \Edge(e)(f)
\end{tikzpicture}
\end{tkzexample}




\vfill
\newpage

\subsection{Arête particulière la boucle : \tkzname{Loop}} 

\begin{NewMacroBox}{Loop}{\oarg{local options}\varp{Vertex}}
\begin{tabular}{lllc}
options              & défaut     & définition       \\
\midrule
\TOline{color}       {black  }  {} 
\TOline{lw}          {0.8pt  }  {} 
\TOline{label}       {\{\}     }  {} 
\TOline{labelstyle}  {\{\}     }  {} 
\TOline{style}       {\{\}     }  {} 
\end{tabular}
\end{NewMacroBox}

\subsubsection{Exemple avec \tkzcname{Loop}}  
\begin{center}
\begin{tkzexample}[vbox, small]
\begin{tikzpicture}
 \useasboundingbox (-1,-2) rectangle (8,2);
 \SetVertexSimple
 \SetGraphUnit{5}  
 \Vertex{A}
 \EA(A){B}
 \Edge[style={->}](A)(B) 
 \Loop[dist=3cm,dir=EA,style={thick,->}](B)  
 \Loop[dist=5cm,dir=WE,style={thick,->}](A)
\end{tikzpicture}
\end{tkzexample} 
\end{center}

\vfill
\newpage
\subsection{Multiple arêtes  \tkzcname{Edges}}  

\begin{NewMacroBox}{Edges}{\oarg{local options}\varp{Vertex A,Vertex B,\dots}}

\begin{tabular}{llc}
options              & défaut     & définition       \\
\midrule
\TOline{color}    {black} {}
\TOline{lw}       {thick} {}
\TOline{label}    {\{\} } {}      
\TOline{labelstyle}{\{\}} {}     
\TOline{style}    {\{\} } {}      
\bottomrule
\end{tabular}

\medskip
\emph{ Cette macro permet de définir une série d'arêtes en une seule fois.}
\end{NewMacroBox} 

\subsubsection{Exemple avec \tkzcname{Edges}}    
\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}
  \SetGraphUnit{4}
  \GraphInit[vstyle=Art]
  \Vertices{circle}{a0,a1,a2,a3,a4,a5,a6,a7} 
  \Edges(a0,a3,a6,a1,a4,a7,a2,a5,a0)
\end{tikzpicture}
\end{tkzexample}
\end{center} 

\endinput