# Electric Circuit PsTricks

Good morning,

I'm currently learning to make figures with PsTricks, but the documentation, as well as books and examples are very poor as usual.

I would like to make this circuit (in LaTeX, with psTricks package [or the sub package pst-circ]:

I would like to maintain the zigzag lines for the resistors, adding the label if possible.

I have tried some command but I let you imagine the mess it came out...

Thank you so much (from this example I will henceforth learn by myself how to run the following future ones).

Note: I would like to see also the "circuitikz" version, if possible. Just to compare and understand what is the best to use!

EDIT

I have came up with this code, trying to make things as I wanted to:

\begin{pspicture}(-2, 4)(4,2)
\pnodes(0,0){A}(0,2){B}(3,2){C}(4,2){D}(5,2){E}(5,0){F}
\battery(A)(B){}
\lamp(B)(C){}
\lamp[parallel, parallelsep=0.5](B)(C){}
\lamp(C)(D){}
\wire(D)(E){}
\lamp(E)(F){}
\lamp[parallel, parallelsep=0.5](E)(F){}
\multidipole(F)(A)
\lamp{} \lamp{} .
\end{pspicture}


Which gives this output

But I am not satisfied.

I would like to have the two first parallel resistance (lamps) centered, that is the wire that splits into the two ones I would like to be at the middle when it splits. The same thing in the other parallel group.

How to do that?

• I agreed that PSTricks is one of a nice package, but now-a-days tikz having many features and more user-friendly... – MadyYuvi Oct 16 '19 at 9:14
• See circuitikz examples: texample.net/tikz/examples/tag/circuitikz – nidhin Oct 16 '19 at 9:15
• Also, refer tex.stackexchange.com/questions/333036/… – MadyYuvi Oct 16 '19 at 9:16
• @nidhin None of the example is minimally useful, for what I need. – Henry Oct 16 '19 at 9:23
• @Henry why are they not useful? Also, the first tutorial on the circuitikz manual is quite on spot... have you seen it? – Rmano Oct 16 '19 at 10:15

In circuitikz I would build something like this (hey, I have a repeated $R_4$, easy to fix!):

\documentclass[border=10pt]{standalone}
% need 0.9.0+
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}[
]
\draw (0,0) coordinate(start) to [short, i=$i$] ++(1,0) coordinate(a)
-- ++(0,1) to [R=$R_1$] ++(3,0) --++(0,-1) coordinate (b)
(a)  -- ++(0,-1) to [R, l_=$R_2$] ++(3,0) -- (b)
to [R=$R_3$] ++(3,0) --++(0,-1) coordinate(c)
-- ++(-1,0) to[R, l_=$R_4$] ++(0,-2) -- ++(1,0) coordinate(d)
(c) --  ++(1,0) to[R=$R_4$] ++(0,-2) -- (d)
-- ++(0,-1) to [R=$R_6$] ++(-3,0) coordinate(e)
% trick: put R_7 at the center of the parallel above
-- (b|-e) to[R=$R_7$] (a|-e) -- (start|-e)
to [battery2, l=$\Delta E$, invert] (start)
;
\end{circuitikz}
\end{document}


If you need lamps or bulbs, you have:

• Blimey that is wondrous. Gosh. I have so much to learn... Thank you immensely! – Henry Oct 16 '19 at 10:54
• One more thing... It gives me error because it does not get RPVoltage and Siunitx o.O – Henry Oct 16 '19 at 11:01
• Yep --- RPvoltages is in 0.9.0 onwards (since I started maintaining the project). You can remove them if you have an older version, and then check the direction of the battery (that can change). Too long to explain here, look at the manual at circuitikz.github.io/circuitikz/circuitikzmanualgit.pdf , section 4.2 around page 97. You can check your version with \pgfcircversion – Rmano Oct 16 '19 at 11:13

With pst-circ, you simply have to define a series of empty nodes corresponding to the input and output of each dipole component, then insert the dipoles and close the connections with 4 \ncangles commands:

    \documentclass{standalone}

\usepackage{pst-circ,pst-arrow, auto-pst-pdf}

\begin{document}

\begin{pspicture}(-1.5,-1)(11,6)
% DC Source
\psset{linewidth =1.2pt, dipolestyle=zigzag, parallelarm=0.8cm, linejoin=1, arrowinset=0.12, labeloffset=3.5ex}
\pnodes{A}(0,0.5)(0,3.5)(1.5,4)(4.5,4)(8.5,4)(9,3.5)(9,0.5)(8.5,0)(4.5,0)(1.5,0)
\pnode(0,4){B}
\battery[labeloffset=2.5em](A0)(A1){$\Delta V$}%
\ncangle[angleA=90, angleB=180] {A1}{A2}%
\resistor[parallel](A2)(A3){$R_1$}
\resistor[parallel](A3)(A2){$R_2$}
\resistor(A3)(A4){$R_3$}
\ncangle[angleB=90]{A4}{A5}
\resistor[parallel](A6)(A5){$R_4$}
\resistor[parallel](A5)(A6){$R_5$}
\ncangle[angleA=-90]{A6}{A7}
\resistor(A7)(A8){$R_6$}
\resistor(A8)(A9){$R_7$}
\ncangle[angleA=180,angleB=-90]{A9}{A0}
\psline[,linestyle=none, ArrowInside=->, ArrowInsidePos=0.3](B)(A2)
\end{pspicture}

\end{document}