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.

This is my first time posting in this site

So I have the following code:

 \documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}

\begin{document}

\begin{figure}
  \begin{centering}
    \begin{tikzpicture}[->, >=stealth',shorten >=1pt,auto, main node/.style={rectangle,fill=lightgray!10,draw, minimum size=1cm, minimum width=2.875cm, minimum height=1cm, node distance=5cm}, t_object node/.style={circle,fill=lightgray!10, draw, node distance=2cm}]

      \node[main node, rectangle split, rectangle split parts=4] (t_object)
      at (0,0) {\quad \ Object $o_{1}$ \nodepart{second}\quad Old Versions$_{}$
        \nodepart{third} \quad Latest Version$_{}$
      \nodepart{fourth}\quad Lock};

           % object O1
      \node[t_object node] (O1_0) [right of=t_object, above of=t_object, node distance=4cm] {$v: 5$};
      \node[t_object node] (O1_1) [below of=O1_0] {$v: 11$};
      \node[t_object node] (O1_2) [below of=O1_1] {$v: 13$};
      \node[t_object node] (O1_3) [below of=O1_2] {$v: 29$};

      \path (t_object.second) edge [dashed] node [above, sloped, ->] {} (O1_0);
      \path (t_object.second) edge [dashed] node [above, sloped, ->] {} (O1_1);
      \path (t_object.second) edge [dashed] node [above, sloped, ->] {} (O1_2);
      \path (t_object.third) edge node [above, sloped, ->] {} (O1_3);


      %\path (C) edge node[below, sloped, ->] {} (O1_1);
      %\path (B) edge node[below, sloped, ->] {} (O1_0);

    \end{tikzpicture}
  \end{centering}
\end{figure}




\end{document}

which creates:

enter image description here

Of course, this is not what I want to do, i want the arrows to start form the right part of the rectangle, not the left.

Any ideas how to do it?

share|improve this question
    
Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Mar 22 '12 at 1:17
    
@PeterGrill I see! I fixed it, thanks :) –  equality Mar 22 '12 at 1:37

1 Answer 1

up vote 10 down vote accepted

You could use

\path (t_object.second east) edge [d...

which gives

enter image description here

 \documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}

\begin{document}

\begin{figure}
  \begin{centering}
    \begin{tikzpicture}[->, >=stealth',shorten >=1pt,auto, main node/.style={rectangle,fill=lightgray!10,draw, minimum size=1cm, minimum width=2.875cm, minimum height=1cm, node distance=5cm}, t_object node/.style={circle,fill=lightgray!10, draw, node distance=2cm}]

      \node[main node, rectangle split, rectangle split parts=4] (t_object)
      at (0,0) {\quad \ Object $o_{1}$ \nodepart{second}\quad Old Versions$_{}$
        \nodepart{third} \quad Latest Version$_{}$
      \nodepart{fourth}\quad Lock};

           % object O1
      \node[t_object node] (O1_0) [right of=t_object, above of=t_object, node distance=4cm] {$v: 5$};
      \node[t_object node] (O1_1) [below of=O1_0] {$v: 11$};
      \node[t_object node] (O1_2) [below of=O1_1] {$v: 13$};
      \node[t_object node] (O1_3) [below of=O1_2] {$v: 29$};

      \path (t_object.second east) edge [dashed] node [above, sloped, ->] {} (O1_0);
      \path (t_object.second east) edge [dashed] node [above, sloped, ->] {} (O1_1);
      \path (t_object.second east) edge [dashed] node [above, sloped, ->] {} (O1_2);
      \path (t_object.third east) edge node [above, sloped, ->] {} (O1_3);


      %\path (C) edge node[below, sloped, ->] {} (O1_1);
      %\path (B) edge node[below, sloped, ->] {} (O1_0);

    \end{tikzpicture}
  \end{centering}
\end{figure}




\end{document}
share|improve this answer
    
thank :) you very much –  equality Mar 22 '12 at 2:48

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.