Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

So I'm using TikZ, not too well-versed in it, and I would like to draw a node (unlabeled, just a dot) and with a dashed circle around it that has an arrow on it (this indicates direction). Basically something like this:

http://s8.postimage.org/4ua9e2ftf/Untitled_2.jpg

So far what I figure I could do: make the node, which I have as

\node[style={circle,draw=black,inner sep=1.4pt,fill}] (a) at (0,0) {};

And then make a circle

\node[style={circle,dashed,draw=black, very thick,inner sep=5pt}] (b) at (0,0) {};

And then I'm not sure how to add the arrow end on that circle, and I was hoping you guys could help!

It would be swell if all this could be done with a single instance of a node (in the text), but any help at all is appreciated.

share|improve this question
    
Welcome to TeX.SE. –  Peter Grill Oct 9 '12 at 22:44
    
Related Question: TikZ - “Circled” arrow. –  Peter Grill Jan 25 '13 at 0:13

1 Answer 1

up vote 15 down vote accepted

A simple adaptation of How to put a symbol inside a circle arrow? yields the desired result (blue circle). However, if you are doing this in a tikzpicture you can just draw it directly (red circle):

enter image description here

Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{calc}

\makeatletter
\newlength\@SizeOfCirc%
\newcommand{\CricArrowRight}[2][]{%
    \setlength{\@SizeOfCirc}{\maxof{\widthof{#2}}{\heightof{#2}}}%
    \tikz [x=1.0ex,y=1.0ex,line width=.15ex, draw=blue, #1]%
        \draw [->,anchor=center, densely dashed]%
            node (0,0) {#2}%
            (0,1.2\@SizeOfCirc) arc (85:-240:1.2\@SizeOfCirc);%
}%

\makeatother

\begin{document}
    \CricArrowRight{$\cdot$}
    %
    \begin{tikzpicture}
    \draw [fill=blue, draw=blue] (0,0) circle (1.5pt);

    \draw [->,anchor=center, densely dashed, thick, draw=red]
        (85:0.25cm)  arc (85:-240:0.25cm);
    \end{tikzpicture}
\end{document}
share|improve this answer
    
Nice! I like the draw command with anchor=center. Now I'm using the latex style arrow, and when I do this (also can be seen in your example above), the arrow tip is tilted slightly to one side. I believe this is because the arrow tip's point of reference is it's very tip, not it's center, hence the imbalance. Is there any way to fix that? –  jlv Oct 10 '12 at 0:15
    
@JimboBimbo: Good point. I don't know how to fix it, but if the circle was larger this problem would be less noticeable. Also would be good to get the dashed line to end at the arrow, but also don't know how to do that. Perhaps a follow up question, so that the real tikz experts can chime in. You can reference this post in your new question. –  Peter Grill Oct 10 '12 at 0:28
    
Sounds like a plan. –  jlv Oct 10 '12 at 0:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.