I want to put
\pstVerb
{
true setglobal
globaldict begin
/side 4 def
/potocar {2 copy cos mul 3 1 roll sin mul} bind def
end
false setglobal
}
in the preamble instead of in pspicture to make it global.
\documentclass[12pt]{beamer}
\usepackage{pst-eucl}
\usepackage[active,tightpage]{preview}
\PreviewBorder=12pt
\PreviewEnvironment{pspicture}
\pstVerb
{
true setglobal
globaldict begin
/side 4 def
/potocar {2 copy cos mul 3 1 roll sin mul} bind def
end
false setglobal
}
\begin{document}
\begin{frame}
\begin{pspicture}(-0.2,-0.2)(8,5)
\pstGeonode[PosAngle={180,225,-45,0},CurveType=polygon]
(!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
\psset{linecolor=red}
\pstLineAB{A}{D}\pause
\pstLineAB{B}{D}\pause
\psset
{
linecolor=magenta,
linewidth=0.5\pslinewidth,
arcsep=\pslinewidth,
arrows=<->,
MarkAngleRadius=1.0,
LabelSep=0.75,
}
\tiny
% A
\pstMarkAngle{B}{A}{D}{$\theta$}\pause
% B
\pstMarkAngle{C}{B}{D}{$20^\circ$}\pause
% D
\pstMarkAngle{B}{D}{C}{$50^\circ$}\pause
\pstMarkAngle{A}{D}{B}{$30^\circ$}
\end{pspicture}
\end{frame}
\end{document}
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.

pspictureenvironment, they will be globally accessible afterwards. – AlexG Aug 1 '12 at 8:21frame). Try putting\pstVerb{(value of /side:) print side ==}on a freshframe. – AlexG Aug 1 '12 at 8:44frameinstead ofoverlay. Since beamer repeats thepspictureenvironment and hence the definitions inside\pstVerb{...}on every overlay,sideandpotocarare always redefined (locally on each overlay!) and therefore available. – AlexG Aug 1 '12 at 9:00