我想画一个图,但是运行代码的时候提示编译器超时,运行失败。代码如下:
\usepackage{tikz-cd}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{center}
\begin{tikzpicture}
[
roundnode/.style={circle, draw=black!60, thick, minimum size=7mm},
]
\node[roundnode] (leftcircle) {(1\; 2)}
\node[roundnode] (rightcircle) [right=of leftcircle] {(2\; 3)}
\draw[->] (leftcircle.east) -- (rightcircle.west)
\end{tikzpicture}
\end{center}
\end{document}
答案1
您需要添加几个;
和$
符号。更详细地说,每个路径都需要以 、 和 结束;
,\node
并且\draw
命令开始路径。并且为了使用,\;
您需要切换到数学模式,即添加适当的$
符号。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{center}
\begin{tikzpicture}[roundnode/.style={circle, draw=black!60, thick, minimum size=7mm},]
\node[roundnode] (leftcircle) {$(1\; 2)$};
\node[roundnode] (rightcircle) [right=of leftcircle] {$(2\; 3)$};
\draw[->] (leftcircle.east) -- (rightcircle.west);
\end{tikzpicture}
\end{center}
\end{document}