1

I want to draw this diagram:

capacitor diagram

I wrote the following lines to draw something similar:

\begin{circuitikz}[american voltages]
    \draw (0,0)
    to [polar capacitor, invert, l=$C$, *-*, f=$i$, v_=$v$] (4,0);
\end{circuitikz}

and the result is:

enter image description here

I don't know how to do the following steps:

  • To put the plus and minus signs below the dots and aligned with v.
  • To put the current arrow below the capacitor symbol.
  • 2
    I will try to answer tomorrow, but if you want such a fine control on the labels, probably the best option is to draw them separately. – Rmano Apr 26 '19 at 20:33
2

With the last unpublished version of circuitikz you can use voltage shift (notice that thanks to this post I just fixed a bug) to obtain something like that:

\draw (0,0)
to [polar capacitor,  invert, l=$C$, *-*, f=$i$, v_=$v$, voltage shift=.7] (3,0);

to move a bit the voltage signs:

capacitance, 1

but there is no provision for the kind of current arrow you are looking for. In your case, I would build it by hand:

\draw (0,-2) coordinate(a)
to[polar capacitor, invert, l=$C$, *-*] ++(3,0);
\path (a) ++(0,-0.8) node{$+$} -- node[midway]{$v$} ++(3,0) node{$-$};
\draw[-Triangle] (a) ++(1,-1.2) -- node[midway, below]{$i$} ++(1,0);

capacitance, 2

Notes:

(1) I used relative movement so that it will be easy to add that to a macro;

(2) Yes, arguably the need to use invert here is a bug. But I fear a lot of compatibility problems if I flip it...

| improve this answer | |

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.