我正在遵循 tikz 教程并且我的代码已经到达这一点:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,decorations,shadows}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.shapes}
\usetikzlibrary{fadings}
\usetikzlibrary{patterns}
\usetikzlibrary{calc}
\usepackage{verbatim}
\begin{document}
\tikzset{Yasser grid/.style={help lines,color=blue!50}}
\begin{tikzpicture}[scale=5]
\clip (-0.1,-0.2) rectangle (1.1, .75);
\draw [Yasser grid, step=0.5cm] (-1.4,-1.4) grid (1.4,1.4);
\draw (-1.5,0) -- (1.5,0);
\draw (0,1.5) -- (0,-1.5);
\draw (0,0) circle (1cm);
\draw (3mm,0mm) arc (0:30:3mm);
\shadedraw[left color=gray,right color=green, draw=green!50!black]
(0,0) -- (3mm,0mm) arc (0:30:3mm) -- cycle;
\draw [red, very thick] (30:1cm) -- +(0, -0.5);
\draw [blue, very thick] (30:1cm) ++(0, -0.5) -- (0,0);
\draw [green, very thick] (0,0) -- (30:1cm);
\draw [orange, very thick] (1,0) -- (30: 1.1547cm);
\path [name path=upward line](1,0) -- (1,1);
\path [name path=sloped line](0,0) -- (30: 1.5cm);
\draw [name intersections={of=upward line and sloped line, by=x}][very thick , orange] (1,0) -- (x);
\end{tikzpicture}
\end{document}
我看过这些帖子:
我正在使用 TexShop (MacOS),并按照上面第一篇文章中的说明进行操作。在更新 tikz 之前和更新之后,我收到了与上面第二篇文章类似的相同错误:
Package pgfkeys Error: I do not know the key '/tikz/name path' and I am going to ignore it. Perhaps you misspelled it.
如果我注释掉 \path 命令,一切都会好起来。我是否仍然没有使用最新版本的 tikz?但我已经下载了最新版本并进行了相应安装。有没有关于如何完全删除 tikz 并将其安装在 texmf-local 中的手册?
答案1
您需要加载intersections
库:
\usetikzlibrary{intersections}
看13.3.2 任意路径的交点在 TikZ 2.10 手册中,其中也解释了name path=...
和name intersections=...
。