A very powerful feature of pstricks is its possibly nested rput command that can be used to rotate and move a portion of a drawing. Is there something similar in tikz?

  • I don't know pstricks, but isn't \begin{scope}[rotate=90,xshift=1cm]...\end{scope} what you are looking for? – Peter Grill Sep 21 '11 at 3:04
  • that sounds like it could be it! I'll try. – pluton Sep 21 '11 at 3:16

This can be done placing the contents within a scope:


Inside a tikzpicture environment the scope environment applies all options local to the environment contents. Furthermore, if you include \usetikzlibrary{scopes} in the preamble, you can start a scope at "certain places" with a { provided that the single brace is followed by the options within [].

From the documentation (Section 12.3 in the v2.10 TiKZ & PGF manual):

The “certain places” where an opening brace has this special meaning are the following: First, right after the semicolon that ends a path. Second, right after the end of a scope. Third, right at the beginning of a scope, which includes the beginning of a picture. Also note that some square bracket must follow, otherwise the brace is treated as a normal TeX scope.


Now you can use \rput with the package tikzrput (version beta but it seems stable). You need only to download tikzrput.sty from here. I need time to finish the doc but the options are the same of \rput of pstricks Logically you can replace tikzrput by pstricks and the code compiles.

Some examples :

  1. in the first only, objects are tikz pictures

    enter image description here

    \usepackage{tikzrput} % from http://altermundus.com/pages/tkz/tikzrput/   
          \filldraw (-0.4,1.5)--(0.7,1.8)--(0.2,2.2)--(-0.5,1.6)--cycle;   
          \draw [clip] (0,0) circle [x radius=.8cm, y radius=1.5cm]; 
          \fill[MidnightBlue] (0,-1) circle [radius=1cm];
    Tu as de beaux yeux !
  2. it's a part of the doc of pstricks

    enter image description here

    \section{Placing whatever, wherever } 
    \begin{tabular}{@{}p{\dimexpr \textwidth-6cm}@{} p{1.5cm}@{} p{4 cm}@{}}
    As we have already seen, the \Verb+{\rput}+ macro can be used to place objects.
    The second mandatory argument (in curly braces) is the stuff to place the first
    mandatory argument (in parenthesis) is the coordinate pair of the point where
    the stuff is placed.
    Now we turn to the optional arguments of the \Verb+{\rput}+ macro.
    The first one is given in brackets. It determines the justification of the
    bounding box of the object to place with respect to the point given in paren-
    thesis. The admissible values are the same as the values for the option origin
    of the \verb+{\includegraphics}+ macro. For an instance \Verb+{[br]}+ for bottom-right.
    The default is mc meaning middle - center.
    The second optional argument is given in curly braces just before the left
    parenthesis. It is a number that stands for the rotation angle as illustrated in
    the last instance of the \Verb+{\rput}+ macro on the slide.
    The two optional arguments make \Verb+{\rput}+ more 
    exible than the \Verb+{\put}+ macro
    of the picture environment. 
    & &
     \begin{tikzpicture}[baseline=(current bounding box.north)] 
          \draw[help lines] (-1,0) grid (1,5) ; 
     \foreach \x/\y in {0/5,-1/3,1/2,0.5/1} {%
          \rput(\x,\y ){\tikz\draw[fill=red] circle(2pt);};} 
    {\parbox{5cm}{\flushright Rotated\\
    by $45^{\circ}$}}
  3. Only TikZ to build \rput

    enter image description here

    \foreach \a in {0,16,...,356}{\rput(\a;2){$\bullet$}}\rput[B](0;0){Circle}%     
    a line :\ \rput[B](5,0){end}\rput[Bl](0,0){start}
  • This sounds like a interesting and useful tool. One problem though, the link doesn't seem to work at the moment. – Frédéric Mar 6 '12 at 2:33
  • @Frédéric: Link seems to work fine for me. – qubyte Mar 6 '12 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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