I want to distinguish vertices in a network by decorating them with additional paths. The solution from here works perfectly for single lines, but I need more shapes so I also want to draw a small rectangle inside the node in the same manner. An attempt which in my eyes should work is shown below in pat2
(pat1
is just for comparison). The problem is that it doesn't, and I don't see why.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\tikzstyle{cvertex}=[solid, circle,draw=black,line width=1 pt, inner sep=2pt]
\tikzset{
local edge style/.style = {line width=1pt, line cap=round, shorten <=2pt, shorten >=2pt},
pat1/.style = {append after command={
(\tikzlastnode.west)
edge[local edge style]
(\tikzlastnode.east)
}},
pat2/.style = {append after command={
[draw, line width=1pt]
($(\tikzlastnode.south west) + (1.4pt,1.4pt)$)
rectangle
($(\tikzlastnode.north east) - (1.4pt,1.4pt)$)
}},
}
\begin{document}
\begin{tikzpicture}
\node [cvertex, pat1] at (0,0) {};
\node [cvertex, pat2] at (0.3,0) {};
\end{tikzpicture}
\end{document}