我在 math.stackexchange.com 上问了另一个问题(见这里) 我觉得我需要制作一个 TIKZ 节点网格来展示这个问题,这样我就可以显示用箭头连接的答案。我现在正在使用 www.overleaf.com,但遇到了一些麻烦。我只想要一些简单的东西,将守护者和链接的颜色设置为不同,并允许放置半箭头。
这是我的自动更新代码(截至 2015 年 4 月 21 日晚上 8 点 15 分美国/洛杉矶):https://www.overleaf.com/2588660pvgwfg
\documentclass{article}
\usepackage{tikz}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{textcomp}
\usetikzlibrary{arrows}
\pagenumbering{gobble}
\begin{document}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm,
thick,main node/.style={circle,fill=#1!20,draw,font=\sffamily\Large\bfseries}]
\node[main node=white] (1) {};
\node[main node=white] (2) [below of=1] {};
\node[main node=white] (3) [below of=2] {};
\node[main node=white] (4) [right of=1] {};
\node[main node=black] (5) [below of=4] {$\bigoplus$};
\node[main node=white] (6) [below of=5] {};
\node[main node=white] (7) [below of=6] {};
\node[main node=white] (8) [below of=7] {};
\node[main node=red] (9) [right of=5] {$\mathscr{G}_{\text{\textbullet}}$}; %09%
\node[main node=white] (10) [right of=6] {};
\node[main node=green] (11) [right of=7] {$\mathscr{L}$}; %11%
\node[main node=white] (12) [right of=8] {};
\node[main node=red] (13) [below of=12] {$\mathscr{G}_{\text{\textopenbullet}}$}; %13%
\node[main node=black] (15) [right of=9] {$\bigoplus$};
\node[main node=white] (14) [above of=15] {};
\node[main node=white] (16) [right of=10] {};
\node[main node=white] (17) [right of=11] {};
\node[main node=white] (18) [right of=12] {};
\node[main node=white] (19) [right of=14] {};
\node[main node=white] (20) [right of=15] {};
\node[main node=white] (21) [right of=16] {};
%E/S/N/N/N/W/W/S/S/S/E/N/%
\path[every node/.style={font=\sffamily\small}]
%LINK%
(11) edge node [above] {1} (17)
(17) edge [bend right] node [left] {2} (18)
(18) edge [bend right] node [right] {3} (17)
(17) edge node [right] {4} (16)
(16) edge node [right] {5} (15)
(15) edge node [above] {6} (9)
(9) edge node [above] {7} (5)
(5) edge node [left] {8} (6)
(6) edge node [left] {9} (7)
(7) edge node [left] {10} (8)
(8) edge node [above] {11} (12)
(12) edge node [right] {12} (11)
%GUARDIAN BOTTOM%
(13) edge [loop right, color=red, very thick] node {1} (13)
(13) edge [loop below, color=red, very thick] node {2} (13)
(13) edge [color=red, very thick] node [left] {3} (12)
(12) edge [bend left, color=red, very thick] node [left] {4} (11)
(11) edge [color=red, very thick] node [left] {5} (10)
(10) edge [color=red, very thick] node [above] {6} (6)
(6) edge [color=red, very thick] node [above] {7} (3);
\end{tikzpicture}
\end{document}
如何更改节点颜色(参见原来的)并得到半箭?