[Tex/LaTex] How to get a counter-clockwise loop with the TikZ automata package

automatatikz-pgf

Using

\draw [->] (2) to[loop above] node[auto] {$\beta_2$} (2);

I get "clockwise" loop. Is it possible to get a counter-clockwise loop?

Best Answer

Two options:

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\node[circle,draw](2){?};
\draw [->] (2) edge[in=100,out=80,loop] node[above] {$\beta_2$} (2);
\end{tikzpicture}

\begin{tikzpicture}
\node[circle,draw](2){?} edge[in=100,out=80,loop] node[above] {$\beta_2$}();
\end{tikzpicture}
\end{document}

enter image description here

Another way is to change the every loop style. By default this is ->,shorten >=1pt, if you change it to <-,shorten <=1pt, the arrow is turned around.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[every loop/.style={<-,shorten <=1pt}]
\node[circle,draw](2){?} edge[loop above] node[above] {$\beta_2$}();
\end{tikzpicture}
\end{document}

enter image description here