1

My problem is straightforward, I copied the below code from the package and ran the code, but I keep getting the attached error in the picture.

\documentclass{minimal}

\usepackage{tikz} \usepackage[]{circuitikz}[=2020/02/05] \begin{document} \begin{figure} \begin{circuitikz} \draw (0,0) node[mixer] (mix) {} (mix.w) node[left] {w} (mix.s) node[below] {s} (mix.e) node[right] {e} (mix.n) node[above] {n}; \end{circuitikz} \end{figure} \end{document}

enter image description here

Here is another code that is not working, the nodes should not connect the way it appears in the figure.

\begin{circuitikz} \draw
 (0,0) node[mixer] (mix) {}
 (mix.east) to node[adder,right] (add) {}++(4,0)
 (mix.south) to node[oscillator,below] (osc) {}++(0,-2) ;
\end{circuitikz}

enter image description here

I actually tried to load all versions to see which one can solve the problem, but no one dose (please check my snapshot)

enter image description here

Diana
  • 1,285
  • 7
  • 12
  • 1
    Unrelated: Use article class or other standard class for an MWE, it sets up all the usual document settings; minimal class is intended for testing package-loading dependencies, and is literally minimal (3 lines of code). Eg: minimal class gives this error message: Environment figure undefined.. – Cicada Feb 12 '22 at 11:52
  • remove [=2020/02/05]. and use recent version of circuitikz. Old version doesnt have defined anchors w, s, e and n or instead them use west, south and east) north˙. – Zarko Feb 12 '22 at 12:47
  • 1
    You probably have an old circuitikz package documentation. In recent one is not such example, only is mentioned how you can rollback to use older package version. Apparently tis old version doesn't has defined such syntax for denote shape anchors. – Zarko Feb 12 '22 at 13:02
  • 1
    BTW, the recent circuitikz version is 1.4.6 (2022/02/04). – Zarko Feb 12 '22 at 13:52
  • There is no such a syntax as to node... in circuitikz. Where you did find it? You probably mean (mix.east) -- ++(4,0) node[adder, right](add){}? – Rmano Feb 12 '22 at 15:58
  • Maybe something else needs to be upgraded – Diana Feb 12 '22 at 18:43
  • @Diana, you have an old circuitikz version. You can check https://tex.stackexchange.com/questions/524328/i-need-to-use-a-different-version-of-circuitikz-how-can-i-do-that. Add node {\pgfcircversion} somewhere in your paths and check the version you have installed - you can go in the past with versions but not in the future – Rmano Feb 13 '22 at 09:16

1 Answers1

2

Your code is quite confused; let's see ---

  1. Asking for the version current on 2020/02/05 you are asking circuitikz to go back to version 1.0 (you can check that here), which effectively had not the short anchors on blocks (they were added in 1.2.3, it's commented in the manual)

  2. The syntax to node[]..., although existing in TikZ, has different effects than you think. No time now to explain what happens, you can make another question maybe?

  3. When in doubt, you can always add something to your drawing to print the current version of circuitikz you have installed; I added a node in the last line to show it.

So probably you wanted this:

\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\begin{tikzpicture}[]
    \draw
    (0,0) node[mixer] (mix) {}
    (mix.w) node[left] {w}
    (mix.s) node[below] {s}
    (mix.e) node[right] {e}
    (mix.n) node[above] {n};
    \draw (2,0) node[mixer] (mix) {}
    (mix.east) -- ++(4,0) node[adder,right] (add) {}
    (mix.south) -- ++(0,-2) node[oscillator,below] (osc) {};
    % this draw command is just to print the installed version of circuitikz
    \draw (0,-1) node[draw, right, red, font=\ttfamily]
        {Circuitikz \pgfcircversion{} released \pgfcircversiondate};

\end{tikzpicture} \end{document}

enter image description here

Rmano
  • 40,848
  • 3
  • 64
  • 125