I have the following code, which should give me a NAND gate:
\tikzset{
block rect/.style =
{
draw = \linecolor,
fill = \blockcolor,
rectangle,
minimum height = 1.6\blocksize,
minimum width = \blocksize,
anchor = center,
inner sep = 0.05\blocksize,
font = \blockfontsize
},
nand gate/.style =
{
draw,
block rect,
yshift = -0.33\blocksize,
append after command =
{
\pgfextra
{%
\node [draw, circle, minimum size = 1mm, inner sep=0pt] at ([xshift=0.5mm]\tikzlastnode.east) {};
}
},
path picture =
{
\node at ([yshift=0.33\blocksize]path picture bounding box.center) {\small \&};
}
}}
it actually works and gives me a nice (european style :-) ) NAND gate:
however, when I would like to use the NAND gate's output with (node name.east), the actal east anchor is the east anchor of the rectangle, but I want to shift the east anchor to the right by the diameter of the small circle. Otherwise, any connections from the right side of the NAND go through that small circle, which is wrong and looks ugly.
Second, I would like to add two additional anchors 'in1' and 'in2' or 'a' and 'b' on the left side of the NAND for the two input ports, so that I could connect lines to the NAND's inputs. The two anchors should be at +/-0.33 the height of the rectangle. How can I define these two new anchors for my gate?
circuitikz
package? Orcircuit
library of TikZ? There IEC NAND gate symbols are already defined (with two inputs only (unfortunately)circuit
you can use thelogical gate inputs
or theinput
key (the latter is a short-cut for the former) to define more than two inputs, even so far to define different inputs (normal ones and inverted ones).circuitikz
, where I didn't saw this option. I will look in TikZ manual again :-)