1

I'm having some problems with "circuitikz" package. When I try to use it TexStudio gives me the following error Undefined control sequence. \pgfutil@proteced. The code works correctly but when I call "circuitikz" something goes wrong. I use MikTex as compiler and TexMaker as editor. I tryed to install the package many times but nothing.

\documentclass[11pt, titlepage]{article} 
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[linktocpage=true]{hyperref}
\usepackage{amsmath}
\usepackage{circuitikz}
\usepackage[output-decimal-marker={.}]{siunitx}
\usepackage{graphicx}
\usepackage{amsmath} 
\usepackage{amssymb}  
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize[prefix=tikz/]
\usepackage{booktabs} 
\usepackage{pbox}

\begin{document} Hi all, Hi all ! \end{document}

This code comes from another user who uses it without problems. I ask for some advice because I tryed almost everything I found on the net.

Thanks for any help!!!

Juan Castaño
  • 28,426
  • 1
    It works fine in my computer (with the edit I made, changing the second \begin{document} for \end{document} which I suppose was a typo). It throws an unrelated warning about the pgfplots compat, btw. – Juan Castaño Nov 06 '21 at 08:43
  • 1
    I also can't reproduce your problem. BTW, package amsmath you load twice, hyperref should be loaded last. You may consider to upgrade your LaTeX installation. – Zarko Nov 06 '21 at 08:57
  • 1
    You probably have a old version of circuitikz. See https://tex.stackexchange.com/questions/524328/i-need-to-use-a-different-version-of-circuitikz-how-can-i-do-that, or a too old version of TikZ. – Rmano Nov 06 '21 at 08:59
  • In fact, I use the same code on another PC and it works like a charm! I'll try to update miktek at all. – Lorenzo D'Eleuterio Nov 06 '21 at 09:38
  • Remeber also that to have externalize work you should not use \begin{circuitikz}...\end{circuitikz}, but \begin{tikzpicture}...\end{tikzpicture} (which really is exactly the same). – Rmano Nov 06 '21 at 10:02
  • 1
  • After reinstalling the entire Miktek , everything works well! Case closed ! – Lorenzo D'Eleuterio Nov 06 '21 at 10:38
  • @Rmano newer versions of circuitikz use \pgfutil@protected (the PRs done by me), whereas older versions of pgf/TikZ don't provide it (the switch made there to use \pgfutil@protected is relatively young, iirc). But anyways, the issue is (or was, as it now seems fixed) certainly mismatched package versions. – Skillmon Nov 06 '21 at 10:56
  • 2
    I’m voting to close this question because it was solved in comments ... – Mensch Nov 06 '21 at 11:33
  • @skillmon yes, it's supposed to work always but maybe the "right" combination of circuitikz version and Tikz version can cause it. – Rmano Nov 06 '21 at 14:58
  • 1
    @Rmano would be a fairly recent version of circuitikz and a hopelessly out of date version of pgf.... :) – Skillmon Nov 06 '21 at 15:01

0 Answers0