Could you help me with drawing of the transformer (see below)? I haven't enough experience with circuitikz library, and at this point it seems that this block isn't part of circuitikz double dipoles (it might be un usual way of drawing transformer)

enter image description here

  • 2
    Welcome to TeX.SE! Please show us what you already have, i.e. bake an MWE, such that people can find an answer that really helps you.
    – user121799
    May 13, 2018 at 0:49
  • Circuitikz already has 3 different transfomers (6 if you add cores). I did find a version similar to yours at daenotes.com/electronics/basic-electronics/transformer May 13, 2018 at 1:15
  • Jusr out of interrest: in what language do you write your document? Because in Dutch books we use the American transformer, not the European one. May 13, 2018 at 8:38
  • My document is written in French, so we have this symbol (and alsothe other one of LaTeX) of the transformer. As far as I know the two symbols are correct.
    – Bast
    May 13, 2018 at 9:28

2 Answers 2


What you can always do is to look up a definition of a resembling element, copy its definition to the preamble of your TeX file and modify it. Here is an example, based on the gyrator shape. I stress that I have no knowledge on circuitiz other than that its based on TikZ, and I also have no practical knowledge about circuits, which I successfully avoided to learn ;-).

\pgfcircdeclarequadpole{my transformer}{







\ctikzset{quadpoles/my transformer/width/.initial=1.5}
\ctikzset{quadpoles/my transformer/height/.initial=1}

\draw  node[my transformer,anchor=north west] (my trafo){}
node[anchor=east]  at (my trafo.west){$V_1$}
node[anchor=west]  at (my trafo.east){$V_2$}
node[anchor=south]  at (my trafo.north west){$I_1$}
node[anchor=south]  at (my trafo.north east){$I_2$};


enter image description here

  • Yes! Thank you, it works really well (for someone who have the chance to avoid circuits and circuitikz)
    – Bast
    May 13, 2018 at 9:33

You can combine elements of the package to create new ones, according to my example for the TL431 component, you can define a new component, mixing the circuitikz macros and drawings with Tikz code, definig a macro under the scope structure, you can name the coordinates of the terminals of the components and add them an identifier, that way you can use as many as you want and connect them using the names of their terminals, here an example, the circuit is just to test the connections, it has no electrical design criteria.


enter image description here


% By J. Leon V.  coded based on the BSD, MIT, Beerware licences.
\ctikzset{bipoles/length=.8cm} % to navoid modify text sizes and separations.

% Creating new electronic part
 \def\TL431(#1)#2{%#1: Position #2: Identifier.
  \begin{scope}[shift={(#1)}] % using to make coordinate objet.
    \draw(0,0) coordinate (A) coordinate (A #2)  %set this coordinate as anode
    to [sD*,-](0,2) coordinate (B) coordinate (K #2); % set this coordinate to kathode (sD* is circuittikz objet)
    \coordinate (C) at ($(A)!0.5!(B)$); % Find the center point between A and B
    \coordinate (D) at ($(A)!1!90:(C)$); % find a point orthogonal. 
    \node at (C) [rectangle, minimum size=7mm,draw=black,thick] {};%put the rectangle.
    \draw (C) -- +(D) coordinate (R #2);% draw the Vref pin and set tho coordinate Ref
    % Set the labels
    \draw (0,0.5) node[right] {\scriptsize A};
    \draw (0,1.5) node[right] {\scriptsize K};
    \draw (-.7,0.8) node[right] {\scriptsize R};
    \draw (.4,1) node[right] {\small D - #2}; % Diode label identifier

% Creating new electric component
 \def\Trafo(#1)#2{%#1: Position#2: Identifier.
  \begin{scope}[shift={(#1)}] % using to make coordinate objet.
    % Terminal P1-identifier
    \draw (0,0) coordinate (P1-#2) to [short,o-,i=$i_{1-#2}$] (0.5,0);
    \draw (.5,0) -- ++(.25,-.6); % Wire
    \draw (1.2,-1) circle (6mm); % Primary
    \draw (0.5,-2) -- ++(.25,.6);% Wire
    % Terminal P2-identifier
    \draw (0,-2) coordinate (P2-#2) to [short,o-] (0.5,-2);
    % Terminal s1-identifier
    \draw (3,0)  coordinate (S1-#2) to [short,o-,i_<=$i_{2-#2}$] (2.5,0);
    \draw (2.5,0) -- ++(-.25,-.6); %Wire
    \draw (1.8,-1) circle (6mm); % Secondary
    \draw (2.5,-2) -- ++(-.25,.6); %Wire
    % Terminal S2-identifier
    \draw (3,-2) coordinate (S2-#2) to [short,o-] (2.5,-2);
    \draw (1.5,0) node[] {\small T - #2}; % Trafo label identifier
    \draw (P1-#2) to [open, v_<=$V_{P-#2}$] (P2-#2); % Primary voltage
    \draw (S1-#2) to [open, v^<=$V_{S-#2}$] (S2-#2); % Secondary voltaje

 %Drawing first line input - R 
 \draw (0,0) 
    node [anchor=east]{Input}
% Insert TL431 in position 2,-3 and identified as 1

% Conect first line and TL431 
    (2,0) to [short,-*] (K 1); % K 1 is the identified coordinate kathode

% Conect TL431 to ground % A 1 is the identified coordinate of anode
\draw (A 1) to (2,-5.5) coordinate (GND) node [ground]{};

%Draw the close loop between Ref and kathode
\draw[-] (R 1) |- (K 1);

%Draw the Vref 
\draw (R 1) 
    to [short, -o] (1,-3.5)
    to [open,v=Vref] (1,-4.5)
    to [short, o-] (1,-5.5) node[ground]{};

% Drawing the trafos

% Conecting the trafos
\draw (2,0) to [R,-] (P1-1);
\draw (P2-1) -- ++(-0.3,0) |- (P1-2);
\draw (P2-2)
    to [short,-*] (P2-2 -| GND);


You must log in to answer this question.

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