我的代码:
\documentclass[]{article}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{graphs}
\begin{document}
\pagenumbering{gobble}
\begin{tikzpicture}
\graph [nodes={draw, circle}, clockwise, radius=.75cm, empty nodes, n=8] {
subgraph C_n [name=inner] <->[shorten <=1pt, shorten >=1pt]
subgraph C_n [name=outer]
};
\end{tikzpicture}
\end{document}
产生下图:
而不是预期的数字:
为什么会这样?
答案1
手册中似乎有一个错误,因为graphs.standard
要实现此功能需要该库:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{graphs.standard}
\begin{document}
\begin{tikzpicture}
\graph [nodes={draw, circle}, clockwise, radius=.75cm, empty nodes, n=8] {
subgraph C_n [name=inner] <->[shorten <=1pt, shorten >=1pt]
subgraph C_n [name=outer]
};
\end{tikzpicture}
\end{document}