I want to include a figure containing an electrical circuit in my file. To ensure the correct filesize I use tikzscale includegraphics
command. However, this yields an error for some of the elements in my figure. Is there a way to fix it?
Consider the following MWE:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usepackage{tikzscale}
\usepackage{filecontents}
\begin{filecontents}{figure1.tikz}
\begin{tikzpicture}[circuit ee IEC,set inductor graphic = var inductor IEC
graphic]
\draw (0,0) to[inductor] (2,0) to[voltage source] (4,0);
\end{tikzpicture}
\end{filecontents}
\begin{document}
\input{figure1.tikz} % Works fine
\bigskip
\includegraphics{figure1.tikz} % Breaks the inductor
\end{document}
The error message is:
pdflatex> ! Package pgfkeys Error: I do not know the key '/tikz/var inductor IECgraphic'
pdflatex> and I am going to ignore it. Perhaps you misspelled it.
pdflatex>
pdflatex> See the pgfkeys package documentation for explanation.
pdflatex> Type H <return> for immediate help.