Consider the following code:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\newcommand{\MA}{4}
\pgfmathsetmacro{\MB}{4};
\coordinate (V11) at (0,0);
\coordinate (V44) at (4,4);
\draw[black] (V11) rectangle (V\MA\MA);
\end{tikzpicture}
\end{document}
This works. However changing the \draw
command to:
\draw[black] (V11) rectangle (V\MB\MB);
produces the following error:
! Package pgf Error: No shape named V4 is known .
Why is \newcommand
working here, when \pgfmathsetmacro
fails?