PDF/Braids undefined control sequence

I'm trying to compile my script to make a simple braid diagram using the 'braids' package, using the following code:

\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, margin=2.5cm, top=4cm]{geometry}
\usepackage{amssymb,amsmath,braids,tikz}

\begin{document}

\begin{center}
\begin{tikzpicture}
\braid[rotate=90] s_1 s_2^{-1} s_3 s_3 s_1;
\end{tikzpicture}
\end{center}

\end{document}


but I am getting this error message, which means absolutely nothing to me and I cant't find anything similar:

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\braids\braids.sty"
! Undefined control sequence.
<write> ...ing PGF2.10; you are using \pgfversion
.\on@line .
l.20 ...using PGF2.10; you are using \pgfversion.}
%
?

• I think it is trying to see whether you have aTikZ v3 or not. Try updating everything to the newest – percusse Nov 24 '15 at 17:47

1 Answer

You are loading the packages in the wrong order. braids needs tikz to run, but doesn't load it automatically. So it needs to be loaded after tikz.

\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, margin=2.5cm, top=4cm]{geometry}
\usepackage{amssymb,amsmath,tikz,braids}

\begin{document}

\begin{center}
\begin{tikzpicture}
\braid[rotate=90] s_1 s_2^{-1} s_3 s_3 s_1;
\end{tikzpicture}
\end{center}

\end{document}


It might still issue a warning because it checks for PGF version 2.10 (at the time of writing, 2.10 was still slightly cutting edge and not everyone had it).

(This was one of the first packages I wrote so quite a few things are not as ideal as they should be, in particular it ought to load tikz if it hasn't already been loaded, and it shouldn't really issue the warning. One day, I'll update it ...)