My paper contains the following PSTricks picture. It displays a square on the left, and two squares on the right - top and bottom. It describes a process where the square on the left can be in either one of two states - either the top-right or the bottom-right state:


It is important that the three squares are identical (they represent the same square), so, I want them to also look identical in the PSTricks code. However, in order to arrange them vertically, I had to change their coordinates, so the left square is "(0,20)(30,50)", the top-right is "(0,40)(30,70)", and the bottom right is "(0,0)(30,30)".

Is there a way to insert a vertical shift, such that, I can just copy an existing psframe, add a shift, and it will be shifted correctly?

(I hope I made myself clear)


2 Answers 2


Yes. Insert the \psframe inside an \rput{0}(<xshift>,<yshift>){<stuff>} and define the frame in a command, for consistency:

enter image description here



  \rput{0}(0,20){\myframe}% Translate \myframe vertically up 20 y-units
  \rput{0}(0,-20){\myframe}% Translate \myframe vertically down 20 y-units

The optional argument of \myframe[<opt arg>] allows you to pass optional stuff, like fillcolor=green!50!red to change things as needed for other frames. With this in mind, consider drawing the entire picture in a single pspicture environment.

  • 1
    why do you always use {0} for \rput??
    – user2478
    Oct 6, 2013 at 5:21
  • @Herbert: It is convention for {.} to denote mandatory arguments. As such, it's a habit that I have adopted, but could change. There is also no clear mention of which is mandatory/optional under section 24 Placing and rotating whatever of the main PStricks documentation (p 41). For \put*arg{<rot>}(<coor>){<stuff>}, yes, there is mention that {<rot>} is optional, but mandatory when you leave out the optional (<coor>)? So \rput(.){.}, \rput{.}(.){.} and \rput{.}{.} are valid, but not \rput{.}...
    – Werner
    Oct 8, 2013 at 19:37
  • on TeX-Level everything can be an optional argument! PSTricks itself uses <.>, (.), {.}, [.]. Only on LaTeX level we have {.} as a mandatory argument. Compare beamer, it also has {.} as an optional argument.
    – user2478
    Oct 8, 2013 at 19:45

define the squares as nodes then you can use symbolic coodinates for the connections:



  $1\leq V\leq2$\\  \psline[linestyle=dashed](-15,0)(15,0)\\[5pt]
  $1\leq V\leq2$}}{down}
  $V>2$\\   \psline[linestyle=dotted](-15,0)(15,0)\\[5pt]


enter image description here

The syntax of \myframe is:

\myframe[optarg](x,y){text}{node name}

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.