19

I am following the tutorial in the tiKz and PGF manual v3.0.0 with the following LaTeX commands:

\begin{tikzpicture}[scale=3][>=latex']
    \clip (-0.1,-0.2) rectangle (1.1,1.51);
    \draw[step=.5cm,gray,very thin] (-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 [radius=1cm];
    \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm)
    arc [start angle=0, end angle=30, radius=3mm] -- cycle;
    \draw[red,very thick] (30:1cm) -- +(0,-0.5);
    \draw[blue,very thick] (30:1cm) ++(0,-0.5) -- (0,0);
    \path [name path=upward line] (1,0) -- (1,1);
    \path [name path=sloped line] (0,0) -- (30:1.5cm);
    \draw [name intersection={of=upward line and sloped line, by=x}]
    [very thick,orange] (1,0) -- (x);
\end{tikzpicture}

I have included the \usetikzlibrary{intersections} but I still get the following error:

 ! Package pgfkeys Error: I do not know the key '/tikz/name intersection' and Iam going to ignore it. Perhaps you misspelled it. See the pgfkeys package documentation for explanation.Type H <return> for immediate help.... ...on={of=upward line and sloped line, by=x}]

I am using TeXMaker v4.1.1 on a Windows 7 64-bit computer and Any suggestions?

4
  • 4
    Use name intersections={...}. You missed the last s.
    – Jesse
    Jan 16, 2014 at 6:56
  • 2
    Add \usetikzlibrary{intersections} too.
    – user11232
    Jan 16, 2014 at 13:07
  • @Jesse Please, make that an answer ;)
    – yo'
    Jan 29, 2014 at 18:00
  • @tohecz -- I just did. Thank you for your kindness.
    – Jesse
    Jan 29, 2014 at 18:24

1 Answer 1

11

The name intersections={...} has an s with it and you missed the last s. After adding the s with Harish Kumar's comment requiring \usetikzlibrary{intersections}, you will get what follows.

enter image description here

Code

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}

\begin{tikzpicture}[scale=3][>=latex']
    \clip (-0.1,-0.2) rectangle (1.1,1.51);
    \draw[step=.5cm,gray,very thin] (-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 [radius=1cm];
    \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm)
    arc [start angle=0, end angle=30, radius=3mm] -- cycle;
    \draw[red,very thick] (30:1cm) -- +(0,-0.5);
    \draw[blue,very thick] (30:1cm) ++(0,-0.5) -- (0,0);
    \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}]   % <-- Here
    [very thick,orange] (1,0) -- (x);
\end{tikzpicture}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .