The question is an extension to this question, and is also related to this one.
I want to draw a Simulink-style sum block which is basically a circle node with a port in each direction (north, west, south, east). If a port is used as an added (or subtracted) input, a plus (or minus) sign is shown at the port. I hope I can specify the port configurations using custom node styles with arguments:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
positive/.pic = {\draw (-1mm,0)--(1mm,0) (0,-1mm)--(0,1mm);},
negative/.pic = {\draw (-1mm,0)--(1mm,0);},
sum block/.style = {draw, circle, inner sep=0pt, minimum size=9mm,
north/.style = {append after command={pic at +(0,3mm) {#1}}},
south/.style = {append after command={pic at +(0,-3mm) {#1}}},
west/.style = {append after command={pic at +(-3mm,0) {#1}}},
east/.style = {append after command={pic at +(3mm,0) {#1}}},
},
]
% I wish to create a node like this:
\path (1cm, 0) node [sum block] {} pic at +(0,3mm) {positive} pic at +(-3mm, 0) {negative};
% using a more elegant syntax like this:
\node at (2cm, 0) [sum block, north=positive, west=negative] {};
\end{tikzpicture}
\end{document}
The result is as follows; the desired fancy syntax is not producing any port sign.
Is there an easy way to meet the objective? A TikZ-only solution like this one is preferred.
path picture