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.
\documentclass{minimal}
\usepackage[a4paper,margin=1cm,landscape]{geometry}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows,arrows}

\begin{document}
\tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=blue!40, drop shadow,
        text centered, anchor=north, text=white, text width=3cm]
\tikzstyle{comment}=[rectangle, draw=black, rounded corners, fill=green, drop shadow,
        text centered, anchor=north, text=white, text width=3cm]
\tikzstyle{myarrow}=[->, >=open triangle 90, thick]
\tikzstyle{line}=[-, thick]

\begin{center}
\begin{tikzpicture}[node distance=2cm]
    \node (Item) [abstract, rectangle split, rectangle split parts=2]
        {
            \textbf{ITEM}
            \nodepart{second}name
        };
    \node (AuxNode01) [text width=4cm, below=of Item] {};
    \node (Component) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode01]
        {
            \textbf{COMPONENT}
            \nodepart{second}nil
        };
    \node (System) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode01]
        {
            \textbf{SYSTEM}
            \nodepart{second}parts
        };

    \draw[myarrow] (Component.north) -- ++(0,0.8) -| (Item.south);
    \draw[line] (Component.north) -- ++(0,0.8) -| (System.north);

\end{tikzpicture}
\end{center}
\end{document}

Hi I modified the example posted here. http://www.texample.net/tikz/examples/class-diagram/ The author put dummy node below "ITEM" \node (AuxNode01) [text width=4cm, below=of Item] {}; and created two nodes one to the right and one to the left.

Now my question is how to create a third node exactly below the item, at the place where the dummy node is. Intuitively I tried "at" & "over" but did not work.

share|improve this question
    
If you want another node at the same place where the dummy node is, why you not just use below=of Item again? PS: Please use backticks ` for inline code. –  Martin Scharrer Jan 25 '11 at 18:53
add comment

2 Answers

up vote 2 down vote accepted

If I understand correctly what you are trying to do, the "at" is actually correct, but you put it at a different place:

\node (Blah) at (AuxNode01) [abstract, rectangle split, rectangle split parts=2]
    {
        \textbf{BLAH}
        \nodepart{second}parts
    };

For proper positioning, you should remove the anchor=north from the definition of the abstract style (I am not quite sure why it is there, anyway).

share|improve this answer
add comment

Is this what you want?

flowchart

In that case you can use at (<node name>), and you need to use the option anchor=center for the new node, because it's set to north in a global option.

\documentclass{minimal}
\usepackage[a4paper,margin=1cm,landscape]{geometry}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows,arrows}

\begin{document}
\tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=blue!40, drop shadow,
        text centered, anchor=north, text=white, text width=3cm]
\tikzstyle{comment}=[rectangle, draw=black, rounded corners, fill=green, drop shadow,
        text centered, anchor=north, text=white, text width=3cm]
\tikzstyle{myarrow}=[->, >=open triangle 90, thick]
\tikzstyle{line}=[-, thick]

\begin{center}
\begin{tikzpicture}[node distance=2cm]
    \node (Item) [abstract, rectangle split, rectangle split parts=2]
        {
            \textbf{ITEM}
            \nodepart{second}name
        };
    \node (AuxNode01) [text width=4cm, below=of Item] {};
    \node (Component) [abstract, rectangle split, rectangle split parts=2, left=of AuxNode01]
        {
            \textbf{COMPONENT}
            \nodepart{second}nil
        };
    \node (System) [abstract, rectangle split, rectangle split parts=2, right=of AuxNode01]
        {
            \textbf{SYSTEM}
            \nodepart{second}parts
        };

    \node (New) [abstract, rectangle split, rectangle split parts=2,anchor=center] at (AuxNode01)
        {
            \textbf{SYSTEM}
            \nodepart{second}parts
        };

    \draw[myarrow] (Component.north) -- ++(0,0.8) -| (Item.south);
    \draw[line] (Component.north) -- ++(0,0.8) -| (System.north);

\end{tikzpicture}
\end{center}
\end{document}
share|improve this answer
    
yes thats what I want to achieve. 'anchor=center' is what I am looking for –  Aku Jan 25 '11 at 22:51
add comment

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.