我按节点/子节点创建一棵树,如下所示:
\begin{tikzpicture}
\tikzstyle{nodestyle} = [circle,draw,minimum size=5pt]
\node [nodestyle, inner sep=0pt] {$\{X\}|_{\aleph_0}$}
child {node {$\vdots$}
child {node [nodestyle, inner sep=4pt] (a) {$X$}}
};
\path (0,0.7) node[above] {$X,X_1,X_2\in\mathcal{E}$};
\begin{scope}[xshift=2.7cm]
\node [nodestyle, inner sep=0pt] {$\{S\}|_{\aleph_0}$}
child {node {$\vdots$}
child {node [nodestyle, inner sep=3pt] (a) {$S$}
child {node [nodestyle,inner sep=0pt] {$\{X_1\}$}
child {node [nodestyle, inner sep=1pt] {$X_1$}}
}
child {node [nodestyle,inner sep=1pt] (e) {$X_2$}}
}
};
\path (0,0.7) node[above] {$S=\{\{X_1\},X_2\}$};
\end{scope}
\end{tikzpicture}
我想将 cdots 上方分支的距离设置为与 cdots 下方分支的距离相同。谢谢。
答案1
如果您确实想为此使用节点,您可能需要查看此代码片段。 (我还将 tikzstyle 更新为 tikzset。)
更新:你说得对。我实际上从未意识到点状并不真正产生点。
第二次更新:我希望我正确理解了您的请求。现在点从 1mm 以下开始。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.shapes,calc}
\begin{document}
% from https://tex.stackexchange.com/a/52849/121799
\tikzset{decorate sep/.style 2 args=
{decorate,decoration={shape backgrounds,shape=circle,shape size=#1,shape sep=#2}}}
\begin{tikzpicture}
\tikzset{nodestyle/.style={circle,draw,minimum size=5pt}} % changed
\node [nodestyle, inner sep=0pt] {$\{X\}|_{\aleph_0}$}
child {node[minimum size=1cm] (dummy1) {}
child {node [nodestyle, inner sep=4pt] (a) {$X$}}
};
\draw[decorate sep={0.4mm}{2mm},fill] ($(dummy1.north)-(0,1mm)$) -- (dummy1.south);
\path (0,0.7) node[above] {$X,X_1,X_2\in\mathcal{E}$};
\begin{scope}[xshift=2.7cm]
\node [nodestyle, inner sep=0pt] {$\{S\}|_{\aleph_0}$}
child {node[minimum size=1cm] (dummy2) {}
child {node [nodestyle, inner sep=3pt] (a) {$S$}
child {node [nodestyle,inner sep=0pt] {$\{X_1\}$}
child {node [nodestyle, inner sep=1pt] {$X_1$}}
}
child {node [nodestyle,inner sep=1pt] (e) {$X_2$}}
}
};
\draw[decorate sep={0.4mm}{2mm},fill] ($(dummy2.north)-(0,1mm)$) -- (dummy2.south);
\path (0,0.7) node[above] {$S=\{\{X_1\},X_2\}$};
\end{scope}
\end{tikzpicture}
\end{document}