2

I wish to be able to put the label of the contacts above or below in order to avoid the superposition

enter image description here

\documentclass[border=7pt,10pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC,positioning,chains,calc,fit}

\begin{document}
\begin{tikzpicture}[circuit ee IEC]

\draw (0,-1)coordinate(a0) to [make contact={info=$a_i$,name=ai}]+ (2,0) to [break contact={info=$b_i$,yscale=-1}] +(4,0)coordinate(ab);
\draw (0,-2.5) --+(2,0) to [make contact={info=$b_i$}] +(4,0) to [break contact={info=$c_i$,yscale=-1}] +(6,0) coordinate(vv)to [bulb={info=V}] +(8,0);
\draw (0,-4)coordinate(a2) to [break contact={info=$a_i$,yscale=-1,name=Nai}]+(2,0) --+ (4,0) to [make contact={info=$c_i$}] +(6,0)--(vv);

\draw[dashed] (ai) -- (Nai);

\draw (0,-0.5)node[above]{$0V$} -- (0,-4.5) ;
\draw (8,-0.5)node[above]{$12 V$} -- (8,-4.5) ;
\draw (ab)-|(vv);
\end{tikzpicture}

\end{document}
1

see "TikZ \& PGF Manual for Version 3.0.1a", page 553. according to explanation there:

/tikz/info=[<options>]<angle>:<text>

you can write for example:

[break contact={info=below:$c_2$,yscale=-1}]

an example of solution for your circuit is (code is slightly simplified and improved with use of the package siunitx):

\documentclass[border=7pt,10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usepackage{siunitx}

\begin{document}
    \begin{tikzpicture}[circuit ee IEC]
\draw (0, 0)    to [make contact={info=$a_1$,name=ai}]  ++ (2,0) 
                to [break contact={info=below:$b_1$,yscale=-1}] ++(2,0) % <---
                -- ++ (2,0) coordinate(ab);
\draw (0,-2)    -- ++ (2,0) 
                to [make contact={info=$b_2$}] ++(2,0) 
                to [break contact={info=below:$c_2$,yscale=-1}] ++(2,0) % <---
                to [bulb={info=V}] ++ (2,0);
\draw (0,-4)    to [break contact={info=$a_3$,yscale=-1,name=Nai}] ++ (2,0) 
                -- ++ (2,0) 
                to [make contact={info=$c_3$}] ++ (2,0) 
                -- (ab);
\draw[dashed] (ai) -- (Nai);
\draw (0,0.5) node[above] {\SI{ 0}{V}} -- (0,-4.5) ;
\draw (8,0.5) node[above] {\SI{12}{V}} -- (8,-4.5) ;
    \end{tikzpicture} 
\end{document}

which gives

enter image description here

edit: the same result is available with the following shorter notation:

info'=<text>

i.e. with the following image code:

    \begin{tikzpicture}[circuit ee IEC]
\draw (0, 0)    to [make contact={info=$a_1$,name=ai}]  ++ (2,0)
                to [break contact={info'=$b_1$,yscale=-1}] ++(2,0)  % <---
                -- ++ (2,0) coordinate(ab);
\draw (0,-2)    -- ++ (2,0)
                to [make contact={info=$b_2$}] ++(2,0)
                to [break contact={info'=$c_2$,yscale=-1}] ++(2,0)  % <---
                to [bulb={info=V}] ++ (2,0);
\draw (0,-4)    to [break contact={info=$a_3$,yscale=-1,name=Nai}] ++ (2,0)
                -- ++ (2,0)
                to [make contact={info=$c_3$}] ++ (2,0)
                -- (ab);
\draw[dashed] (ai) -- (Nai);
\draw (0,0.5) node[above] {\SI{ 0}{V}} -- (0,-4.5) ;
\draw (8,0.5) node[above] {\SI{12}{V}} -- (8,-4.5) ;
    \end{tikzpicture}

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.