0

I try to do some schematics with circuitikz. The result is as expected, but I always get errors from pdflatex and can not figure out what causes these annoying errors.

I installed the most recent circuitikz package (0.7, issued on 2016-09-08).

Here ist my (unfortunately not working) minimal example:

\documentclass{article} 
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{shapes,arrows}

\begin{document}
    \begin{tikzpicture}
    \draw (0,0) -- (2,0) node[circ] {} to[zD-, v^<=$U_\mathrm{Z}$] (2,2) node[circ] {} to [R, l=$R_1$](2,4) -- (0,4);
    \draw (4,4) node[npn,rotate=90](npn1) {};
    \draw (2,4) node[circ] {} -- (npn1.C);
    \draw (2,2) -- (4,2) node[circ] {} -- (npn1.B);
    \draw (2,0) -- (4,0) -- (4,0.5) to [C, l_=$C_1$] (4,2);
    \draw (4,0) node[circ] {} -- (6,0);
    \draw (npn1.E) -- (6,4);
    \draw [-latex'] (0,3.5) -- (0,0.5) node[anchor=east] at (0,2){$U_\mathrm{E}$};
    \draw [-latex'] (6,3.5) -- (6,0.5) node[anchor=west] at (6,2){$U_\mathrm{A}$};
\end{tikzpicture}
\end{document}

The logfile always shows:

l.10 ...] (2,2) node[circ] {} to R, l=$R_1$ -- (0,4);

The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

Hope someone has a hint what I'm doing wrong.

  • Can you check the version of circuitikz being loaded in compilation? In the log file there should be a line like Package: circuitikz <date> <version> – Dai Bowen Dec 7 '16 at 18:00
1

I can't reproduce your error. So the first advise is to upgrade your circuit to recent one. The second, in spirit of `circuit your drawing can be drawn as follows:

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{arrows}

\begin{document}
    \begin{tikzpicture}
\draw (0,0) to[short,-*] (2,0)
            to[zD-, v^<=$U_\mathrm{Z}$,-*] (2,2)
            to [R, l=$R_1$,-*] (2,4) -- (0,4)
      (4,4) node[npn,rotate=90](npn1) {}
      (2,4) -- (npn1.C)
      (npn1.E) -- (6,4)
      (npn1.B) to[short,-*] (4,2)
               to [C, l_=$C_1$,-*] (4,0)
      (2,2) -- (4,2)
      (2,0) -- (6,0);
\draw [-latex'] (0,3.5) -- node[anchor=east] {$U_\mathrm{E}$} (0,0.5);
\draw [-latex'] (6,3.5) -- node[anchor=west] {$U_\mathrm{A}$} (6,0.5);
    \end{tikzpicture}
\end{document}

enter image description here

Probably the input and output terminals should have circles.

enter image description here

In this case you need to use [short,o-] and [short,-o] instead -- on input/output lines:

    \begin{tikzpicture}
\draw (0,0) to[short,o-*] (2,0)
            to[zD-, v^<=$U_\mathrm{Z}$,-*] (2,2)
            to [R, l=$R_1$,-*] (2,4) 
            to[short,-o] (0,4)
      (4,4) node[npn,rotate=90](npn1) {}
      (2,4) -- (npn1.C)
      (npn1.E) to[short,-o] (6,4)
      (npn1.B) to[short,-*] (4,2)
               to [C, l_=$C_1$,-*] (4,0)
      (2,2) -- (4,2)
      (2,0) to[short,-o] (6,0);
\draw [-latex'] (0,3.5) -- node[anchor=east] {$U_\mathrm{E}$} (0,0.5);
\draw [-latex'] (6,3.5) -- node[anchor=west] {$U_\mathrm{A}$} (6,0.5);
    \end{tikzpicture}
  • Thanks for the comment and the hint for circles at the i/o-terminals. Too bad that you can not reproduce the error. As mentioned, everything works, but the error message is annoying. – Hermann Gebhard Dec 7 '16 at 17:29
  • no, no, it is not bad at all :). this means, that your drawing -- as you show in question -- is not a cause of error (the first image is generated by your code using my MikTeX ). Check, if you have installed recent versions of packages. I hope that other changes in my MWE can help you in future circuits drawing. – Zarko Dec 7 '16 at 17:38
  • Sorry for the delay. The solution given is working. I was stuck due to old TeXlive packages in the Ubuntu repositories. After updating all the circuitikz-related files, everything is working. Thanks for your hints anyway! – Hermann Gebhard Dec 1 '17 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.