1

It looks almost like it can't get any simpler. I try to compile this test circuit:

\documentclass[10pt,a4paper]{article}
\usepackage[siunitx]{circuitikzgit}
\begin{document}

\begin{circuitikz} 
 \draw (0,0) to[dcisource=1A, i_=$i_1$] (2,0);
 \draw (0,2) to[C] (2,2);
 \draw (0,4) to[R] (2,4);
\end{circuitikz}

\end{document}

And then it chokes on the R:

 Undefined control sequence.
\pgf@sh@bg@resistorshape ...sformationadjustments 
                                                  \pgfmathsetlength {\pgf@ci...
l.8  \draw (0,4) to[R] (2,4)
                            ;

The dcisource and C are only included to make sure circuitikz in general works. If I swap the R and C, the result is the same, that is an error on R. So I am sure it is not an error in a drawing statement.

I downloaded circuitikzgit.sty from GitHub and placed it in the current working directory. The circuitikz in my Debian version is way too old (0.3) and causes a bunch of other problems. I have verified circuitikzgit is loaded and not an old version.

I have Tikz 3.0

xstring 2013/10/13

siunitx 2014/10/01 v2.6c

I can't see any error that I make. Is it a bug?

4
  • Did you download all of CircuiTikZ or just circuitikz.sty? CircuiTikZ loads many things from external files (pgfcircbipoles.tex, pgfcirccurrent.tex, etc...) Jul 3, 2018 at 22:00
  • circuitikzgit is a flat file containing those external files. Jul 3, 2018 at 23:58
  • Ooh, okay. Just asked to make sure :) Jul 4, 2018 at 0:01
  • It was a good question anyway. When I placed the .sty file and the external files all in the correct directory they could not be found. I don't know the exact mechanism for including external files in .sty files and if something has to be done to discover those files. Anyway, placing the flat file in my working directory was the fastest solution. Until I upgrade this installation. Jul 4, 2018 at 0:06

2 Answers 2

3

I have solved substituting \usepackage[siunitx]{circuitikz} instead of \usepackage[siunitx]{circuitikzgit} and the code work well (see image). On the site https://github.com/circuitikz/circuitikz You can see that if you want to use or try the git version, just add a git to the name of the package:

\usepackage{circuitikzgit}

o, per ConTeXt,

\usepackage[circuitikzgit]

NOTES

Using Latest Git Version The latest git-version can be used with the following steps:

Download circuitikzgit.sty here https://circuitikz.github.io/circuitikz/circuitikzgit.sty Place it into your local latex project or (for global use) within your local texmf tree (often ~/texmf) Load the package with \usepackage{circuitikzgit} instead of \usepackage{circuitikz} The used circuitikz version can checked using the latex commands \pgfcircversion and \pgfcircversiondate, respectively.

This can also be used to check the latest version for compatibility issues before upgrading. Therefore just switch between the two \usepackage commands.

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage[siunitx]{circuitikz} 
\begin{document}

\begin{circuitikz} 
 \draw (0,0) to[dcisource=1A, i_=$i_1$] (2,0);
 \draw (0,2) to[C] (2,2);
 \draw (0,4) to[R] (2,4);
\end{circuitikz}

\end{document}
5
  • OK, so the code is fine, it is my installation. What version of circuitikz are you using? Jul 3, 2018 at 22:00
  • circuitikz 0.8.3 lun mag 29 22:01:40 2017 from packages of MikTeX Console. Mainteiner: Massimo Redaelli.
    – Sebastiano
    Jul 3, 2018 at 22:04
  • 1
    thank you for posting. This is not a solution, but is confirms my code is correct and the problem is somewhere else. Jul 5, 2018 at 12:33
  • I would also like to thank you very much for everything and for your trust. +1 for your comment.
    – Sebastiano
    Jul 5, 2018 at 20:22
  • 1
    Could you edit to make it clear that this is a demo showing that the code does work?
    – Joseph Wright
    Jul 8, 2018 at 6:02
2

Solved! Added [european] to the circuitikz options.

\usepackage[siunitx,european]{circuitikz}

I don't know the real cause, but I want to use EU stype anyway. So this is solved for the moment.

Still don't understand why USA style is not allowed but at least my project is not stalled anymore.

jlinkels

6
  • I have delete my answer and upvote your.
    – Sebastiano
    Jul 3, 2018 at 22:13
  • @Sebastiano - did your answer describe why it choked? Is it a bug? This is a workaround, not an answer Jul 3, 2018 at 22:26
  • @Scott Since Sebastiano was able to compile my MWE without modification on 8.3.0 my conclusion is it is and installation or configuration issue not a bug. Jul 3, 2018 at 23:59
  • 1
    @Sebastiano Maybe it had been better not to delete your answer. It showed that the MWE compiled correctly, which is useful information as such. Jul 4, 2018 at 0:01
  • @jlinkels I thank you for your encouragement, but I have taken away my answer because I very often receive negative votes. I have now put it in again. Thank you again. Greetings.
    – Sebastiano
    Jul 4, 2018 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .