It’s a good package#

First of all I have to say - it’s a really useful thing. When I have to do projects for the electronics course at uni it really does make the job easier. It’s awesome how I can just use the schoo’s LaTeX template for documents and use CircuiTikz to draw out the circuits. You don’t have to take care of formatting that much and math equations are just so easy to write.

But…#

it’s not all good. First thing that struck me when I started learning was the “European standards” they use. I may not speak for all European countries, but here, in Czech Republic, inductors really do not look like a black rectangle. But ok, you’ll just use to[american inductor] instead of the normal to[i] you’d have to write.

But then come the more weird things. Like if you want to invert the voltage source’s polarity, or polarity of anything for that matter…

Let’s say, you have this voltage source:

DCVsource

The code for this one looks like this:

\draw (0,0) to[dcvsource, v_=$U_{th}$] (0,2);

Most of the sources online suggest something like this to invert the voltage arrow:

\draw (0,0) to[dcvsource, v_<=$U_{th}$] (0,2);

But I had some problems that I don’t remember anymore. The solution for me then was to draw the voltage source in the opposite direction:

\draw (0,2) to[dcvsource, v_=$U_{th}$] (0,0);

But no one suggested that online.

Also, as of writing this, something proving my point happened! I found this comment on tex.stackexchange.com.

Since version 0.8.3, using v<=$V$ has been removed as a way to change the polarity of a source. The manual recommends using the invert tag on the element:

\begin{center}
    \begin{circuitikz}
        \draw (0,0)
        to[V, v=$V$, invert] (0,3) %Invert the element to achieve required polarity.
        to[C=$C_1$] (5,3) 
        to[L=$L_1$] (5,0)
        to[short] (0,0);
    \end{circuitikz}
\end{center}

And guess what? This inverts the element itself, not the voltage arrow, so that works only if i’d use the american standard!

What if I use European standard and want + and - symbols next to the voltage source?#

In our circuits we’re supposed to use these voltage sources:

Assignment

But there’s no way to get those symbols to appear. At least I didn’t find any.

Solution?#

So after searching on the internet, I found this site which had something interesting as part of the example circuit:

Open polarity

After some reading I found the line of code which drew that open part of the circuit with the symbols I’ve been looking for all the time:

(0,0) to [open, v^>=$\underline{u}^s_s$] (0,4) % stator voltage

Ok, but when I do this I get an arrow? Oh, it’s the

\begin{circuitikz}[american voltages]

American standard! So, it was just an open path that had the american style voltages applied!

Last touches#

So to create what I wanted I tried this:

  \draw (0,2) to [dcvsource, v_=$U_{th}$] (0,0)
  (0,2) to [open, american voltages, v=$ $] (0,0);

+ and - rendered over the voltage source

But it’s over the voltage source, not next to it! Urgh….

Let’s move it to the left…

  \draw (0,2) to [dcvsource, v_=$U_{th}$] (0,0)
  (-1,2) to [open, american voltages, v=$ $] (-1,0);

+ and - rendered above/below label of the voltage source

Too much… A bit less?

  \draw (0,2) to [dcvsource, v_=$U_{th}$] (0,0)
  (-0.5,2) to [open, american voltages, v=$ $] (-0.5,0);

+ and - rendered above/below to voltage arrow

Still too much? Ok…

  \draw (0,2) to [dcvsource, v_=$U_{th}$] (0,0)
  (-0.25,2) to [open, american voltages, v=$ $] (-0.25,0);

+ and - rendered at the right spot

Yaaaaay! Finally!

This is not rare#

It really is not. If you’re american, you’re probably ok. But if you need to use the European standards (Czech Republic standards) you’ll have trouble finding solutions for many of the problems you’ll encounter.

And you don’t know how many times I’ve found a solution, but involved rendering the thing manually with the Tikz itself. And no, I don’t want to learn how to render stuff manually, at least not yet. The point of using CirtcuiTikz was to not render things manually.

Conclusion#

It’s a really nice package to have in LaTeX. Makes your job easier if you really need electronic circuits in your documents. But you’ll have problems finding the information you need to use it or you’ll find something but outdated.

How to make it better?#

If you encounter something that has to be done in a weird way post it online with proper tags. It will help the next person to who’s got the same problem. So far I’m sharing all my “hacks” with my fellow students and, as you see, even online.

Hope you’ll have less problems than me drawing your circuits in LaTeX with CircuiTikz!