2

The code

\documentclass[12pt,a4paper]{article}
\usepackage[american]{circuitikz}

\begin{document}
\begin{circuitikz}
  \draw (1,0) to[short, i<=2] (1.5,-2);
\end{circuitikz}
\end{document}

gives an error

! Undefined control sequence.
\tikz@anchor ->\pgf@circ@dir 

If I change e.g., to

\draw (0.8,0) to[short, i<=2] (1.5,-2);

or I remove the i<=2 it compiles fine. I use a standard installation of macTeX on macOS 10.12.1.

Dimitar
  • 23

1 Answers1

1

This appears to be a bug. Until it is fixed you can use

\documentclass[12pt,a4paper]{article}
\usepackage[american]{circuitikz}

\makeatletter
\let\pgf@circ@dir=\pgf@circ@direction
\makeatother

\begin{document}
\begin{circuitikz}
  \draw (1,0) to[short, i<=2] (1.5,-2);
\end{circuitikz}
\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120
  • Thanks for the answer. Actually, I get the same error (after considering your suggestions). – Dimitar Nov 17 '16 at 14:30
  • If you are still getting the error, you should update your packages. I update every week. – John Kormylo Nov 17 '16 at 20:48
  • I removed mactex-2015 (deleted /usr/local/texlive/2015) and installed mactex-20161009 but I keep getting the same error (with or without your suggestion). – Dimitar Nov 17 '16 at 22:46
  • It seems that fetching the latest mactex was not enough. After updating using the "tex live utility" the problem was solved (using \makeatletter ... \makeatother). Thanks for the help. – Dimitar Nov 18 '16 at 08:41