If I want to reuse a TikZ picture I usually define a new command like
\newcommand{\mypic}{%
\begin{tikzpicture}
%...
\end{tikzpicture}%
}%
Then I reuse it later via \mypic.
However I think this is not very elegant. So my question is if it is possible to assign a name to the picture via a key, which can be called to reuse the picture at another place? For example:
\begin{tikzpicture}[rname=mypic]
%...
\end{tikzpicture}
And reuse it like \mypic or something like \rtikz{mypic}.
Would be even better if I could to things like this \rtikz[scale=0.5,every label/.style={red}]{mypic}.




\newcommandto accept an optional parameter:\newcommand{\mypic}[1][]{\begin{tikzpicture}[#1]...\end{tikzpicture}}. Not sure why you think the other syntax would be any easier to use. – Peter Grill May 20 '12 at 19:10\newcommand. It would be nice to have the ability to name the whole pictures, if you can name the nodes etc. anyways. – yo' May 20 '12 at 19:14\input), and also standalone compilation with, well, thestandalonedocument class+package. – krlmlr May 20 '12 at 19:45