# Tikz example not compiling

I'm trying to compile one of the example from the PGF manual, but I am getting lots of errors. Here is the code

\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
\coordinate [label=right:$B$] (B) at (1.25,0.25);

\draw [name path=A--B] (A) -- (B);

\node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {};
\node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {};

\path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];

\draw [name path=C--C’,red] (C) -- (C’);

\path [name intersections={of=A--B and C--C’,by=F}];
\node [fill=red,inner sep=1pt,label=-45:$F$] at (F) {};
\end{tikzpicture}


By the way here are the libraries I'm using, I'm posting them all just because in the past they've turned out to be the problem.

\documentclass[letterpaper]{article}

\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish,es-lcroman]{babel}
\usepackage{parskip}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{tikz-cd}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing,calc,intersections,through,backgrounds}


Also, just for you to know, I'm using LaTeX on linux and I have the package texlive-full installed which I think should have all the tools I need.

The problem with the code seems to be in the line

\path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];


Here I post some of the error messages from the log file in response to the comments:

l.61 ...=above:$C$]C, [label=below:$C’$]C’}}];

I'm ignoring this, since I wasn't doing a \csname.

! Missing \endcsname inserted.
\begingroup
l.61 ...=above:$C$]C, [label=below:$C’$]C’}}];

The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

l.63                    \draw [name path=C--C’,red] (C)
-- (C’);
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

-
Instead of posting code snippets, could you edit your question to include a complete minimal working example? That is, a complete document, starting from \documentclass and containing only the minimum of packages and code necessary to reproduce the problem. Also, please let us know what error message you get, and what version of TikZ you're using. – Jake Dec 14 '13 at 12:12
Well, the problem is that if I do so, then it runs perfectly, so the problem with the code must be precisely related to all the packages I'm using, which by the way, I do need since I'm not only doing a TikZ diagram. – PJOX Dec 14 '13 at 12:20
I mainly meant that you should make an example document that can just be copy-pasted into a .tex file and compiled to reproduce the error. Egreg uses that structure in his answer. It just saves people the hassle of first having to copy your preamble, then adding \begin{document}, then copying the tikzpicture code from your question, then adding \end{document}. Also, are you sure that the problem goes away when you remove \usepackage{pgfplots} from your code? Or \pgfplotsset{compat=newest}? – Jake Dec 14 '13 at 12:41

The error is in using C’ instead of the undirected quote C'; the apostrophe ’ is not suitable, as other non ASCII characters, in node names. But also in formulas it's better to use $C'$ rather than $C’$, because that's not an apostrophe.

\documentclass[letterpaper]{article}

\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish,es-lcroman]{babel}
\usepackage{parskip}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{tikz-cd}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing,calc,intersections,through,backgrounds}

\begin{document}
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
\coordinate [label=right:$B$] (B) at (1.25,0.25);

\draw [name path=A--B] (A) -- (B);

\node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {};
\node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {};

\path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C'$]C'}}];

\draw [name path=C--C',red] (C) -- (C');

\path [name intersections={of=A--B and C--C',by=F}];
\node [fill=red,inner sep=1pt,label=-45:$F$] at (F) {};
\end{tikzpicture}
\end{document}


-