I have no idea why your example doesn't work, but specifying the arrow tip with ->, >=triangle 60
instead works for me.
\documentclass[a4paper,abstracton,11pt]{scrreprt}
\usepackage{tikz}
\usetikzlibrary{automata}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\node (loop-node) at (0,0) {node};
\node (path-start) at (2,0) {start};
\node (path-end) at (2,2) {goal};
\path (path-start) edge [-triangle 60] node {path} (path-end)
(loop-node) edge [loop above,->, >=triangle 60] node {edge} ();
\end{tikzpicture}
\end{document}
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 not tkz-berge
and tkz-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 at EdgeStyle
, then at LoopStyle
and at the end applies a local style if this style exists. For the labels, you have LabelStyle
and then labelstyle
The code is
\def\tkzGR@loop[#1](#2){%
\setkeys[GR]{loop}{#1}%
\protected@edef\@tempa{%
\noexpand \draw[\cmdGR@loop@color] (#2)%
edge [EdgeStyle,LoopStyle,\cmdGR@loop@style]%
node [LabelStyle,\cmdGR@loop@labelstyle]%
{\cmdGR@loop@label} (#2)}\@tempa;%
}%
A possible solution is
\documentclass{minimal}
\usepackage{fixltx2e}
\usepackage{tkz-berge}
\tikzset{LabelStyle/.style= {fill=yellow}}
\begin{document}
\begin{tikzpicture}[scale=1]
\Vertex{A}
\Vertex[x=2,y=0]{B}
\Loop[dist=1.5cm,dir=WE,label=\(x\),
labelstyle={left=12pt,color=red,fill=white,draw}](A)
\Edges[label=$y$](A,B)
\end{tikzpicture}
\end{document}
I agree if you find the styles unclear or confused but I will make something better with pgfkeys
in the next version. I need to make the versions compatible because tkz-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.
Best Answer
For some reason, the TikZ
every loop
style contains an arrow. So you simple have to remove that:or remove it globally with
in the preamble.