
我正在使用positioning
TikZ 中的庫來放置節點。是否可以對展示位置套用某種乘數,例如類似的乘數(above=of C)*2
?
節點 D 中出現錯誤的最小範例(我嘗試了一些不起作用的方法):
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}\begin{tikzpicture}[node distance=1cm,
entity/.style={
draw, rectangle,
minimum size=1cm, text height=1.5ex, text depth=0.25ex
}
]
\node (C) {};
\node (A) [entity, above left=of C] {A};
\node (B) [entity, above right=of C] {B};
\node (D) [entity, ($(above=of C) * 2$)] {D};
\end{tikzpicture}\end{document}
注意:通常我會用座標指定節點的位置,但對使用定位庫感到好奇。