This small piece of code isn't working.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
%
\newcommand{\Stack}{
\begin{tikzpicture}[stack/.style={rectangle split, rectangle split parts=#1,draw, anchor=center}]
\node[stack=3] {
\nodepart{one}\texttt{int} 1
\nodepart{two}\texttt{int} 2
\nodepart{three}\texttt{int} 3
};
\end{tikzpicture}
}
\begin{document}
\Stack
\end{document}
It gives the following error:
Illegal parameter number in definition of \Stack. 1 l.18 }
The code is tested and works fine otherwise. Can someone help please?
rectangle split parts=3
, and usestack
instead ofstack=3
, I'd guess.##1
not#1
as the argument does not refer to\Stack
. But as Torbjørn mentions, you probably does not need to use an argument if the value is always 3