This question already has an answer here:

I wish to draw the picture as following: enter image description here

I write the code to draw the picture, however, I don't know how to draw the line that connects the diamond to the circle.

  my box/.style = {draw, minimum width = 2em, minimum height=1em},
\begin{tikzpicture}[node distance=4mm]
\node[my box,align=center](s1){$S_1$};
\node[draw,circle,left = of s1](start){};
\draw[->] (start)--(s1);
\node[draw,diamond,right = of s1](end){};
\draw[->] (s1)--(end);

marked as duplicate by zeroth, Tobi, Qrrbrbirlbel, Mensch, Claudio Fiandrino Apr 7 '13 at 14:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    This is similar to How to draw a return arrow from node-3 to node-1 Do you still need help with that? (By the way, could you complete your MWE so that it has proper libraries loaded and an existing document environment?) – Qrrbrbirlbel Apr 7 '13 at 14:11
  • @Qrrbrbirlbel thanks, I have draw the line, however, I don;t know how to adjust the location of "k"? – sweetyBaby Apr 7 '13 at 14:42
  • @sweetyBaby I’d use \draw[->] (end) -- ++(0,.5cm) -| (start) node[pos=.25,above] {$k$}; and the k sits right in the middle of the top line. See also Node on a jointed TikZ path for node placement on |-/-| paths. – Qrrbrbirlbel Apr 7 '13 at 14:53

Browse other questions tagged or ask your own question.