I have an issue with the answer given in this question.
As suggested in the comments to its answer, I modified the solution as follows:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{calc,positioning}
\newcounter{image}
\setcounter{image}{0}
\tikzstyle{square} = [draw, rectangle, draw=black, minimum width=1cm, minimum height=1cm, text centered]
\tikzset{drawinside/.code args={#1}{
\draw($(#1.west)!0.3!(#1.center)$)--($(#1.east)!0.3!(#1.center)$);
\draw($(#1.south)!0.3!(#1.center)$)--($(#1.north)!0.3!(#1.center)$);
\draw($(#1.south west)!0.4!(#1.west)!0.3!(#1.center)$)--($(#1.south west)!0.165!(#1.west)!0.5!(#1.center)$)--(#1.center);
\draw(#1.center)--($(#1.north east)!0.165!(#1.east)!0.65!(#1.center)$)--($(#1.north east)!0.45!(#1.east)!0.45!(#1.center)$);
}
}
\tikzset{record/.style args={#1 and #2}{
rectangle,draw,minimum width=#1, minimum height=#2
}
}
\newcommand{\drawrecord}[1]
{
\stepcounter{image}
{
\node [record=1 cm and 1 cm, name=a\theimage] at {#1};
}
\node[drawinside={a\theimage}]{};
}
\begin{document}
\begin{tikzpicture}
\drawrecord{0,0};
\node (sq) [square] {};
\drawrecord{sq};
\end{tikzpicture}
\end{document}
but I keep receiving a ! Package tikz Error: Cannot parse this coordinate. error when I call \drawrecord
. how may I solve this issue?
. Is there a way to define \drawrecord as a \tikzstyle instead of a new command?
EDIT:
for the second question, I have been suggested to look into "append after command", but I cannot find documentation about it, anyone has a link?
EDIT2: actually, the second question is kind of redundant, I can simply call
\node [record=1 cm and 1 cm, name=newnode, right of=oldnode];
\node[drawinside={newnode}]{};
in my document. And
\tikzset{drawinside/.code args={#1}{
\draw($(#1.west)!0.3!(#1.center)$)--($(#1.east)!0.3!(#1.center)$);
\draw($(#1.south)!0.3!(#1.center)$)--($(#1.north)!0.3!(#1.center)$);
\draw($(#1.south west)!0.4!(#1.west)!0.3!(#1.center)$)--($(#1.south west)!0.165!(#1.west)!0.5!(#1.center)$)--(#1.center);
\draw(#1.center)--($(#1.north east)!0.165!(#1.east)!0.5!(#1.center)$)--($(#1.north east)!0.4!(#1.east)!0.3!(#1.center)$);
}
}
is symmetrical (the previous one is slightly off)



minimum width = x mm, minimum height = x mm,insidesaturation block/.style={ ... }– Taekwondavide Mar 26 '19 at 15:01