答案1
这是一个直接的 Ti钾Z 解决方案。仅放置节点并绘制线条,但是:
- 我为节点文本制作了一个宏
\nt
。可以说我很懒,但我不想$\langle...\rangle$
每次都写。 - 这些
tikzpicture
选项[x=1.4cm,y=1.8cm]
控制节点之间的水平和垂直分离。 - 我使用了
preaction
在 中绘制和style
white border
之间线所需的白色边框。(A5)
(B1)
代码:
\documentclass[tikz,border=2mm]{standalone}
\tikzset{white border/.style={preaction={draw,white,line width=4pt}}}
\newcommand{\nt}[1]{$\langle#1\rangle$} % node text
\begin{document}
\begin{tikzpicture}[x=1.4cm,y=1.8cm]% <-- change this numbers if you need (separations)
% nodes
\node at (0,0) (I) {$1$};
\node at (-4,1) (A1) {\nt{\tau\sigma^2}};
\node at (-3,1) (A2) {\nt{**}};
\node at (-2,1) (A3) {\nt{**}};
\node at (-1,1) (A4) {\nt{\tau}};
\node at (0,1) (A5) {\nt{\sigma^4}};
\node at (-3,2) (B1) {\nt{**}};
\node at (-1.5,2) (B2) {\nt{\sigma^4,\tau}};
\foreach\i in {3,4,5}
\node at (1.5*\i-4.5,2) (B\i) {\nt{**}};
\node at (-1.5,3) (C1) {\nt{\sigma^2,\tau}};
\node at (0,3) (C2) {\nt{\sigma}};
\node at (1.5,3) (C3) {\nt{\sigma^2,\tau\sigma}};
\node at (0,4) (G) {$G$};
% lines
\foreach\i in {1,...,5}
\draw (I) -- (A\i);
\foreach\i in {1,2} \foreach\j[evaluate={\jj=int(2*\i+\j-2);}] in {1,2}
\draw (B\i) -- (A\jj);
\foreach\i in {1,3} \foreach\j[evaluate={\jj=int(\i+\j-1);}] in {1,2,3}
\draw (C\i) -- (B\jj);
\draw (C2) -- (B3);
\foreach\i in {1,2,3}
\draw (G) -- (C\i);
\foreach\i in {1,...,5}
\draw[white border] (A5) -- (B\i);
\end{tikzpicture}
\end{document}