8
\documentclass{standalone} 
\usepackage{standalone}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{tikz}
\usetikzlibrary{shapes, positioning}

\begin{document}
\begin{tikzpicture}
    \tikzstyle{every node}=[font=\scriptsize]
    \tikzstyle{apr}=[rectangle,
                     align=center,
                     text width = 3cm,
                     node distance = 1cm,
                     rectangle split, rectangle split parts=2,
                     draw, fill=white]

    \node(1) [apr]
        {
        \textbf{Lore Ipsum}\\ \textbf{Dolor}
        \nodepart{second} {$
                          \begin{aligned}
                          x = &\: 10 \\
                          y = &\: 20 \\
                          \dot{x} = &\: 0
                          \end{aligned}
                          $}
        };
    \node(4) [apr, right = of 1]
        {
        \textbf{Lore Ipsum}\\ \textbf{Stupid Descenders}
        \nodepart{second} {$
                          \begin{aligned}
                          x = &\: 10 \\
                          \dot{x} = &\: 0
                          \end{aligned}
                          $}
        };

\end{tikzpicture}
\end{document}

How can I make the tops of the nodes align instead of their centers?

Here is the image:

enter image description here

David Carlisle
  • 757,742
John
  • 579

1 Answers1

7

Result

Use appropiate anchor in the relatively positioned node, and specify the appropiate corner in the right = of ... option:

[...]
\node(4) [apr, right  = of 1.north east, anchor=north west]
[...]
JLDiaz
  • 55,732
  • 6
    Note that the order here is important. right = of ... sets the anchor to west so you need to override it by setting anchor=north west afterwards. Putting anchor=north west before right=of ... has no effect. – Andrew Stacey Dec 12 '12 at 19:42