Graphics, Figures & TablesArrow in middle of loop

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
psionman
Posts: 30
Joined: Thu Nov 10, 2011 3:33 pm

Arrow in middle of loop

Post by psionman »

I am attempting to produce an arrow half way along a loop. I can produce an arrow half way along a line, but how can I get the arrow in the middle of the loop?

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}

\begin{document}

\begin{tikzpicture}[scale=1]
      \draw[fill=black](0,0) circle (0.5mm) coordinate(1);
      \draw[fill=black](3,0) circle (0.5mm) coordinate(2);

      \begin{scope}[thick,decoration={markings, mark=at position 0.5 with {\arrow{>}}}]
	\draw[postaction={decorate}] (1) -- (2);

    \tikzset{loop/.style={min distance=10mm,in=-45,out=45}}
    \path [postaction={decorate}](2) edge [loop left] (2);
    \end{scope}
   \end{tikzpicture}
 
\end{document}
Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

psionman
Posts: 30
Joined: Thu Nov 10, 2011 3:33 pm

Arrow in middle of loop

Post by psionman »

As no one seems to able to help I've used a workaround using

Code: Select all

\draw [postaction={decorate}] (1) .. controls (a) and (b) .. (1);
Thanks to all who read
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: Arrow in middle of loop

Post by Stefan Kottwitz »

Thank you for posting your solution!
I was also wondering how to do it.

Stefan
LaTeX.org admin
Post Reply