TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

I want to put

    true setglobal
    globaldict begin
    /side 4 def
    /potocar {2 copy cos mul 3 1 roll sin mul} bind def
    false setglobal

in the preamble instead of in pspicture to make it global.




    true setglobal
    globaldict begin
    /side 4 def
    /potocar {2 copy cos mul 3 1 roll sin mul} bind def
    false setglobal


    (!0 side){A}
    (!0 0){B}
    (!80 sin 2 exp side mul 40 sin div 70 sin div 0){C}
    (!80 sin side mul 30 sin div 20 potocar){D}\pause



% A
% B
% D


I asked AlexG about it in a comment, he responded it but it seemed not to work. I got a compilation error saying that "/undefined in side" in either dvips phase or ps2pdf phase. I am not checked which phase produced the error exactly but latex successfully compiled it.

share|improve this question
Even if you put the definitions into the pspicture environment, they will be globally accessible afterwards. – AlexG Aug 1 '12 at 8:21
No. Then it is local to the physical page (or overlay in beamer). – AlexG Aug 1 '12 at 8:35
We are still on the same physical page (frame). Try putting \pstVerb{(value of /side:) print side ==} on a fresh frame. – AlexG Aug 1 '12 at 8:44
@AlexG: Oh I see. I misunderstood your term "physical pages" that I meant as a PDF page. :-) – kiss my armpit Aug 1 '12 at 8:51
Ok. I should edit my second comment to frame instead of overlay. Since beamer repeats the pspicture environment and hence the definitions inside \pstVerb{...} on every overlay, side and potocar are always redefined (locally on each overlay!) and therefore available. – AlexG Aug 1 '12 at 9:00
up vote 2 down vote accepted

The preview package is the culprit. It seems to discard anything outside \PreviewEnvironment (pspicture in the present case) from being put into the Postscript output. I checked the PS output. The definitions of side and potocar didn't make it into it. If you remove the preview related lines everything is ok.

share|improve this answer

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.