I'm discovering the great package tkz-graph
and I am experiencing some trouble with the \Loop
macro.
There seem to be some inconsistencies between the \Loop
macro and the \Edge
macro.
For example, in the following document, the labels of the edges are not placed in the same way.
First, the loop has an array but the edge does not.
Second, the syntax \( \)
for math-mode works only in the case of the loop.
\documentclass{minimal}
\usepackage{fixltx2e}
\usepackage{tkz-graph}
\begin{document}
\begin{tikzpicture}[scale=1]
\Vertex{A}
\Vertex[x=2,y=0]{B}
\Loop[dist=1.5cm,dir=WE,label=\(x\)](A)
\Edges[label=$y$](A,B)
\end{tikzpicture}
\end{document}
Third, the macro \tikzset{EdgeStyle/.append style = …}
doesn't work for loops and I did not find a solution in the user manual. For example, \tikzset{EdgeStyle/.append style ={->}}
doesn't use the same arrow tip for the edge and for the loop.
Finally, the use of style={->}
produces different results in the loop than in the edge (the path is thicker in the latter). Here is the output from the code above, but with \tikzset{EdgeStyle/.append style ={->}}
:
Best Answer
Sorry for the french documentation but with the next version I will try to write a english version. The question is about
tkz-graph
and nottkz-berge
andtkz-berge
has an english doc !!A last detail before my answer, I'm not happy about the options(styles) of these packages because I wrote them with xkeyval and it's difficult to get the same options than Tikz. I will write the next version with pgfkeys.
Now the problem appears because there are a lot of method to change the styles.
EdgeStyle
is used to modify a global style for edges,LoopStyle
is a global style for loops and style is local;Loop
first looks atEdgeStyle
, then atLoopStyle
and at the end applies a local style if this style exists. For the labels, you haveLabelStyle
and thenlabelstyle
The code is
A possible solution is
pgfkeys
in the next version. I need to make the versions compatible becausetkz-graph
is used by lot of people.The first solution of Count Zero is fine too
Update : Another solution is to define a personal style and to use only
Tikz
to draw the loops. It's always possible to use tikz.