5

I want to have a state-node with a loop, where the arrow tip is customized (here with -triangle 60). How do change the arrow tip a loop uses?

Heres a short example. I expect the loop to have the same arrow tip as the edge from start to end.

\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}

Now I would like to understand why its not working as I expect, and how I can change the arrow tip for loops.

I also tried to change the style of the loop with loop/.append style{-triangle 60}, with and without \tikzset, but that seemed to be a dead end.

1
  • Oh, and Welcome to TeX.SX! Sep 1, 2011 at 15:03

1 Answer 1

5

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}
1
  • The "correct" way would be to use every loop/.append style={-triangle 60}, as loop above is a shorthand for [above,out=105,in=75,loop], with loop introducing a to path that uses the every loop style. Your way is much more pragmatic, though, and works just as well in this case (some things, like shorten < do not).
    – Jake
    Sep 1, 2011 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .