Is it possible to change the appearance of the var make contact symbol from the TikZ circuit library as follows (i.e. add the second circle) and add a "closed" option as shown in the following (handmade) picture:

1 Answer
1

The easiest way is to copy the definition of the shape from the library and modify it to suit your needs. The library in question is pgflibraryshapes.gates.ee.IEC.code.tex (for the IEC version). There are shape definitions there for the different shapes, you can simply copy the one that you want to modify to your own file and make the modifications there. You simply change the name of the declared shape to what you want and then you just need to modify the \backgroundpath. The default \backgroundpath looks like:

To get the final circle, add {\pgfpathcircle{\pgfqpoint{\pgf@xb}{0pt}}{\pgfutil@tempdima}} at the very end.

To get a closed version, change the \pgf@yb in the \pgfpathlineto to \pgfutil@tempdima. Make sure you wrap the definitions in \makeatletter ... \makeatother.

Edit: I hadn't tested it sufficiently, the anchors need some updating in order for it to work well in a path. The circle we add influences the right border. We can make some minor adjustments to make it work again. Note that the original border is already a rectangle, so not completely a correct border. This kind of object is used in straight paths though, so as long as the rectangle is the right size, using it as a border isn;t a big problem. There are a few modifications, so I'll just add the complete shape definition.

Thanks. I tried it. However the second line starts in the second circle not on the right of it (as in my picture). Perhaps one has to fill the second circle? I don't see how to do that.
–
studentApr 13 '12 at 10:31

@student: I hadn't tested it completely (hardly at all actually) and the changed anchor slipped my mind. The updated code should work as expected.
–
Roelof SpijkerApr 13 '12 at 11:40