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{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

share|improve this question
3  
Welcome to TeX.sx! \node (4) [apr, right = of 1.base east, anchor=base west] could be one way, or north instead of base. –  Qrrbrbirlbel Dec 12 '12 at 18:22
2  
And not related to TikZ, but the correct use of amsmath align environments is & = instead of spacing tricks like = & \:. See Relation spacing error using =& in aligned equations –  Qrrbrbirlbel Dec 12 '12 at 18:25

1 Answer 1

up vote 6 down vote accepted

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]
[...]
share|improve this answer
4  
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. –  Loop Space Dec 12 '12 at 19:42

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.