# Defining drop shadow as macro not allowed?

Is it really not possible to define drop shadow (with or w/o options) as a macro?

\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[rectangle,fill=green,\test] at (5,0) {test};
\end{tikzpicture}
\end{document}


When I test this file I get the message 'pgfkeys Error: I do not know the key ...'. I regularly use other options of \node with such macros without problems so far.

No, you can't do it, due to expansion issues. The command \node receives \test rather than its contents, and it obviously doesn't know it.

There are two basic solutions: (1) Use \tikzset (or \tikzstyle):

\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[rectangle,fill=green,test] at (5,0) {test};
\end{tikzpicture}
\end{document}


(2) Use dirty trick with \edef to expand \test into its contents before \node is expanded. However, this goes with a large PLEASE DO NOT DO THAT flag:

\documentclass{scrartcl}
\usepackage{tikz}