TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to circuitikz so this question may be too easy for some of you. I want to draw a single pole double throw switch in circuitikz. It can be done with "spdt". However I don't find any example of using it in the manual. I just don't know how to connect this 3-terminal component with the surrounding ones. Can anyone provide an example? Thanks.

share|improve this question
It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. Then those trying to help can have something to start with. Solving problems can be fun, but setting them up isn't. – Peter Grill Oct 8 '12 at 3:52
up vote 6 down vote accepted

The three anchors you are looking are <name>.in, <name>.out 1, and <name>.out 2. A little example showing a spdt component alone with its main three anchors, and another one showing how to connect some of these components with others; sorry if the examples lack any "real" meaning (I know nothing about circuits):



\begin{circuitikz} \draw
(1,0) node[spdt] (myspdt) {}
(0,0) -- (myspdt.in) 
(myspdt.out 1) -- +(1,0)
(myspdt.out 2) -- +(1,0);


\begin{circuitikz} \draw
(2,2) node[spdt] (myspdt1) {}
(2,0) node[spdt] (myspdt2) {}
(0,1) node[spdt] (myspdt3) {}
(5,1) node[and port] (myand) {}
(myspdt3.out 1) -| (myspdt1.in)
(myspdt3.out 2) -| (myspdt2.in)
(myspdt1.out 1) -- (myand.in 1)
(myspdt2.out 2) -- (myand.in 2)


enter image description here

share|improve this answer
Thanks for your example code. It is great to get started with. One small question: I saw you used "--", "-- +" or "-|" to connect two nodes. What is the difference among them? – shva Oct 8 '12 at 4:33
@shva You're welcome! Regarding your questions, (a) -- (b) means a straight line from (a) to (b); (a) |- (b) means a line from (a) to (b), but first vertical and then horizontal (-| means first horizontal, then vertical). Now the plus signs: +(0cm,1cm) means "1cm upwards from the previous specified position" and ++(2cm,0cm) means "2cm to the right of the previous specified position, making this the new specified position". – Gonzalo Medina Oct 8 '12 at 4:45
Great. Thanks Gonzalo! – shva Oct 9 '12 at 6:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.