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.
1l.18 }
The code is tested and works fine otherwise. Can someone help please?
rectangle split parts=3, and usestackinstead ofstack=3, I'd guess. – Torbjørn T. May 03 '17 at 09:05##1not#1as 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 – daleif May 03 '17 at 09:08