I am writing lab reports for my electronics class, and we got to transformers. Looking in the documentation for CircuiTikZ, it shows how to get the anchors for each of the lines for connecting labels. However, I want to draw something like what is produced by the following code

\begin{circuitikz} \draw
  (0,0) node[transformer] (T) {}

Circuit generated by the above code

My issue is that I have to specify the coordinates of the lines from the voltage source (in this example (-2,-2.1) and (-2,0)) to the terminals of the transformer with a magic number. Is there a way to be more implicit with these, such as extracting the x and y components of each of the terminals of the components?

Note, I have seen the solution here for doing this, but would like to have the output be independent of the units used, so that the lines could be connected to easier by just referencing their coordinates

  • please always provide mwe (minimal working example), a small complete document which begin with \documentclass ans end with \end{document}
    – Zarko
    Oct 2, 2018 at 20:09

1 Answer 1



  (0,0) node[transformer] (T) {}
  (T.A2) to [short,o-] ++ (-1,0) coordinate (aux)
         to [sI] (aux |- T.A1)
         to [short,-o] (T.A1)

as you see, in drawing is used a relative coordinate for determining of the starting point of current source (aux) and perpendicular coordinate system|-through generatorauxandT.A1` for the end point of drawing of the current source.

enter image description here

You must log in to answer this question.

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