\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}
我怎样才能使节点的顶部对齐而不是中心对齐?
以下是图片:
答案1
anchor
在相对定位节点中使用appropiate ,并在right = of ...
选项中指定适当的角点:
[...]
\node(4) [apr, right = of 1.north east, anchor=north west]
[...]