4

How can I draw an european relay like in the following image with circuitikz. I am not able to find it in the circuitikz documentation.

enter image description here

2
  • 3
    To the people trying to close this question: I do not see anything wrong here. OP has no MWE, but it should not be a huge deal, as OP is just asking for a reference to where something can be found in the documentation. If it does not exist, surely there is a workaround. Feb 28 at 9:18
  • 1
    Hi Jana, welcome! No, there's no such a symbol. It would not be difficult to add (although you can fake it quite easily). You can file a new component request here: github.com/circuitikz/circuitikz/issues/new/choose
    – Rmano
    Feb 28 at 9:19

1 Answer 1

6

There is no symbol like that (and thinking twice, it would be quite complex to do --- the dashed line changes a lot, you can use different switch styles and types, etc... maybe the "dashed" generic can be added, but I am not sure about the usefulness).

A workaround (very flexible, because you can place the parts wherever you want) is the following (commented in the code):

\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\begin{tikzpicture}[european]
    % draw the switch first
    \draw (0,0) to[cosw=b, name=swb, -*, mirror, invert] ++(0,-2)
        to[R] ++(0,-2) node[tground]{};
    % draw the dashed line
    \draw [dashed] (swb.mid) -- ++(-1,0) coordinate(dash b);
    % place a resistor shape here
    \node[genericshape, left](coil b) at (dash b){}; 
    % cross it
    \draw[thick] (coil b.ne) -- (coil b.sw);
    % contact it
    \draw (coil b.s) -- ++(0,-1) node[tground]{}
          (coil b.n) |- ++(-1,1) node[ocirc]{} node[above]{B};
\end{tikzpicture}
\end{document}

enter image description here

Notice there is no mid anchor for traditional switches before v1.6.8. See here. Also now there is a sgeneric shape.

You must log in to answer this question.

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