0

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.

\documentclass[tikz]{standalone}
\usepackage{tikz}
\tikzset{
  my box/.style = {draw, minimum width = 2em, minimum height=1em},
}
\begin{document}
\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);
\end{tikzpicture
\end{document}
3
  • 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?) Commented Apr 7, 2013 at 14:11
  • @Qrrbrbirlbel thanks, I have draw the line, however, I don;t know how to adjust the location of "k"?
    – sweetyBaby
    Commented Apr 7, 2013 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. Commented Apr 7, 2013 at 14:53

0

Browse other questions tagged .