using circuitikz (siunitx), I would like to draw a diode within a rectangle, but the option to place text within a node doesn't allow that:

\draw (0,0) to node[draw,rectangle, fill=white] {a diode instead of text} (4,0);

How would I do that?

How would I add a text next to the node, how do I control on which side the text is?

1 Answer 1


Try this:

\draw (0,0) to[D] node[draw,left,text width=4cm, text height=1cm,inner sep=0]{}  (4,0);

enter image description here

You can add text with another node.

  • Mush easier than using a savebox. Dec 17, 2019 at 3:07

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.