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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command or macro that can draw and automatically size the bounding rectangle of a pstricks object, for example a circle -- framing it tightly in effect, even when the object undergoes transformations such as rotations.

For example,

     \documentclass[english, landscape, a4paper]{slides}

        \pscircle(5,5){2} % I'd like to draw the bounding box of this object

Edit: the difficulty that I'm having is calculating the dimensions of the frame or bounding box.

share|improve this question
In your title you mention "graphic", while your post refers to "object". These can be interpreted differently. Therefore, does "object" refer to the entire contents of your pspicture, or merely an object like some text? – Werner Sep 28 '11 at 6:06
I've changed graphic to non-text graphic, for example a circle of radius 2 i.e. \pscircle(5,5){2} – Olumide Sep 28 '11 at 6:15
You should create complete examples, then everybods knows what exactly you are asking for – Herbert Sep 28 '11 at 6:37
up vote 4 down vote accepted
  pstricks object with a pspicture environment

or if you do not have it outside of the pspicture environment

\documentclass[english, landscape, a4paper]{slides}
\usepackage{pstricks} \SpecialCoor
  \rput(#1){\psframe(!#2 neg dup)(!#2 dup)}%




enter image description here

share|improve this answer
The framebox is tiny and at the origin. Here's what I tried \psframebox[shadow]{\pscircle(5,5){2}} – Olumide Sep 28 '11 at 6:38
sure, as I wrote: If you'd provide a complete example then it is possible to give a correct answer. See my edit. – Herbert Sep 28 '11 at 6:59
I apologize. I realize that I haven't made myself clear enough. I was hoping for a command that could automatically frame an object, without having to specify its dimensions. The problem I'm having is in computing the dimensions of the frame, for my objects some of who undergo transformations such as rotation. – Olumide Sep 28 '11 at 11:36
@Olumide: It is pretty simple, but only when I know what exactly you want. And now I know it, see edited answer – Herbert Sep 28 '11 at 12:15
Thanks @Herbert ("You da man"). I'll try generalizing the macro for arbitrary objects. – Olumide Sep 28 '11 at 14:03

Your Answer


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.