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

You must log in to answer this question.

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