(How) Is it possible to save some complex TikZ
objects for reusing them (in the same and in different pictures)?
I know it's possible to define own styles, but I'm not sure if it's the right thing I'm looking for (styles seems to be only for properties not for complex and done objects). And that it's possible to save whole images with savebox
, but can it be used to save portions of pictures?
Let's make an example: Someone's building several optical experiments. All experiments use the same kind of elements, like mirrors, lasers, polarizers, beam splitters and so on, but each experiment is in another configuration and setup. Each element has it's own picture (just like in electrical circuits where each type of element has it's own "icon").
How and where do I define my "kinds of elements" to be able to reuse them in my lots of TikZ pictures?
In the end I want ideally be able to draw my pictures similar (not neccerssarily exact) like
\begin{tikzpicture}
\mirror at (0,0);
\laser at (1,0);
\draw (1,0) --(0,0) --(0,1);
\end{tikzpicture}
savebox
hint my question), but I believe that's not what I need.libraries
. You can create a library and then it can be used across the files.