Take the 2-minute tour ×
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.

I am trying to define a few components for my circuits library to use with the circuit.ee library, and I have a couple of questions:

  1. Does the to-path create a node on its path or just a complex path i.e. in

    \begin{tikzpicture}[circuit ee IEC]
    \draw (0,0) to[resistor] (3,0);
    \end{tikzpicture}
    

    is the resistor a node?

  2. If it is indeed a node (which I think it is since I can create anchors for it) is it possible to name the node and subsequently access its anchors? I have tried the following that does not work

    \begin{tikzpicture}[circuit ee IEC]
    \draw (0,0) to[resistor, name=res] (3,0);
    \draw (0,2) -- (res.north);
    \end{tikzpicture}
    

    and a bunch of other things that didn't work.

any help appreciated!

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You can make the option sent to the resistor node itself by using the following:

\begin{document}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,0) to[resistor={name=s}] (3,0);
\node[below,align=center]  at (s.south) {Resistance \\is futile};
\end{tikzpicture}
\end{document}

enter image description here

Thus, you can refer to that node later with the name you give.

share|improve this answer
    
That didn't only solve my problem, but gave me an instantaneous headache when I stuttered "Of course"! –  DrJay Feb 20 '12 at 20:47
    
And a big Thank You! –  DrJay Feb 21 '12 at 23:47
    
@DrJay No problem at all. We all have our similar moments on this site. –  percusse Feb 22 '12 at 8:46

Your Answer

 
discard

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.