Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Forgive me for my perhaps naive questions, I am beginning to discover Tikz potentials. To ease certain operations as moving objects or transforming them, I want to know if there is a mechanism in Tikz that I can group certain operations and give a name to this grouping and use that name in doing operations on the whole collection of objects that are grouped. My first guess was perhaps scope will do this. But could not see how I can refer collectively to the scoped operations and/or objects. The best analogy, for give me to mention it, is the grouping operation in Power Point. Thanks for your help. Artimess

share|improve this question
add comment

2 Answers

You can apply transformations to a scope, like for example:

\begin{tikzpicture}
    \begin{scope}[rotate=45]
        \draw (-1,-1) rectangle (1,1);
        \draw (0,0) circle (1);
    \end{scope}
\end{tikzpicture}

Whatever parameters and operations you specify in the [...] at the beginning of the scope environment is applied to every command inside the scope.

share|improve this answer
add comment

tikzpicture envionments can be nested. They behave like scope environments and support optional arguments for parameters. For instance, \begin{tikzpicture}[scale=0.5, transform shape] ... \end{tikzpicture} could be used inside a parent tikzpicture environment.

share|improve this answer
    
I know that this works, but is it meant to work? I ask because in another question (which escapes me now), an answer was to nest tikz pictures but when I experimented then I found that the inner and outer pictures didn't properly know about each other (in particular, node names and co-ordinates couldn't be guaranteed to work). –  Andrew Stacey Aug 16 '10 at 19:30
    
I used it but don't remember problems. But I wished also tikz matrices could be nested. –  Stefan Kottwitz Aug 16 '10 at 20:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.