3

I made a schematic using following code:

\begin{circuitikz}
    \draw
        (0,0) node[op amp, scale=2] (opamp) {}
        (opamp.+) -- (-2.38,-3) node[ground] {}
        (opamp.+) node[left, above] {$u_+$}
        (opamp.-) node[left, below] {$u_-$}
        (opamp.out) to[short, -*](4,0) node[right] {$u_{izl}$}
        (opamp.-) to[R, label=$R_1$, i<=$i_1$, *-*] (-8, 1) node[left] {$u_{ul}$}
        (opamp.-) to[short] (-2.4,4) {}
        (-2.4, 4) to[R, label=$R_2$, i>=$i_2$] (3,4) {}
        (3,4) to[short, -*] (3,0)
        (opamp.up) to[short, -*] (-0.17,2.5) {}
        (opamp.down) to[short, -*] (-0.17,-2.5) {}
        (4,0) to[] (4,0) {}
        ;
\end{circuitikz}

However some of the lines on it aren't straight like these ones:

enter image description here

I tried changing coordinates but I can't get it right. Is there an easier way of doing this?

3

You can assign node names to the nodes that will form the intersection, and then use the syntax to[short] (u1|-u2). This could have a very precise outcome, but due to how the structured in circuitikz, I had to do some manual tweaking for the other edge.

In any case, the line is straight now.

Output

figure 1

Code

\documentclass[tikz, margin=10pt]{standalone}
\usepackage[europeanresistors]{circuitikz}

\begin{document}
\begin{circuitikz}
    \draw
        (0,0) node[op amp, scale=2] (opamp) {}
        (opamp.+) -- (-2.38,-3) node[ground] {}
        (opamp.+) node[left, above] {$u_+$}
        (opamp.-) node[left, below] (u1) {$u_-$}
        (opamp.out) to[short, -*](4,0) node[right] {$u_{izl}$}
        (opamp.-) to[R, label=$R_1$, i<=$i_1$, *-*] (-8, 1) node[left] {$u_{ul}$}
        (-2.38,4) to[R, label=$R_2$, i>=$i_2$] (3,4) node (u2) {}
        (opamp.-) to[short] (u1|-u2) {}
        (3,4) to[short, -*] (3,0)
        (opamp.up) to[short, -*] (-0.17,2.5) {}
        (opamp.down) to[short, -*] (-0.17,-2.5) {}
        (4,0) to[] (4,0) {}
        ;
\end{circuitikz}
\end{document}
2
  • This works flawlessly. Thanks for the advice! May 27 '15 at 16:01
  • @RidableCthulu You're welcome. I would have preferred to do a better job but the syntax in circuitikz is a bit hard to handle. :D
    – Alenanno
    May 27 '15 at 16:04

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.