标签边缘没有按照手册中描述的那样工作?

标签边缘没有按照手册中描述的那样工作?

这是来自 tikz/pgfmanual 第 274 页的内容:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs} 

\begin{document}

\begin{tikzpicture}
\tikz \graph [quick] { "a" --["foo"] "b"[x=1] };
\end{tikzpicture}

\end{document}

当我尝试lualatex此文件时,我得到以下信息:

! Package pgfkeys Error: I do not know the key '/tikz/"foo"' and I am going to
ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.8 \tikz \graph [quick] { "a" --["foo"] "b"[x=1]

我在这里遗漏了什么?

谢谢!

答案1

您必须加载quotes库:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs}
\usetikzlibrary{quotes}%<- added

\begin{document}
\begin{tikzpicture}
\tikz \graph [quick] { "a" --["foo"] "b"[x=1] };
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容