Take the 2-minute tour ×
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.

After seeing Herbert's answer, apparently this problem should not occur if I realized the first row of the following code should be \documentclass{beamer}. Problems often come from not knowing what I am doing.

Please close this too localized question.


Sorry for the bad title!

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{pst-sex.sty}
% ========================================================
% Copyright (c) 2013 Bugbusters. All rights reservered.
% LPPL LaTeX Public Project License
% ========================================================
\NeedsTeXFormat{LaTeX2e}[1994/06/01] 
\ProvidesPackage{pst-sex}[2013/04/23 v3.141592654 Constant declator for StackEXchange]
\RequirePackage[nomessages]{fp}
\RequirePackage{pstricks}

% removing a trailing space in the original fp.sty
\def\FP@pow#1#2#3{%
    % #1 macro, which gets the result
    % #2 base
    % #3 exponent
    %
    \FP@beginmessage{POW}%
    %
    {\def\FP@beginmessage##1{}%
     \def\FP@endmessage##1{}%
     %
     \FPifzero{#2}%
        \FP@pow@zero{#3}%
     \else%
        \FPln\FP@tmpd{#2}%
        \FPmul\FP@tmpd\FP@tmpd{#3}%
        \FPexp\FP@tmp\FP@tmpd%
     \fi%
     %
     \global\let\FP@tmp\FP@tmp%
    }%
    %
    \FP@endmessage{}%
    %
    \let#1\FP@tmp%
}

% constants declarator
\def\LoadConstants{}
\newcommand\const[3][]{%
    \if\relax\detokenize{#1}\relax
        \edef\pst@@sex@@temporary{#3}%
    \else
        \edef\pst@@sex@@temporary{round(#3:#1)}%
    \fi
    \expandafter\FPeval\csname#2\expandafter\endcsname
        \expandafter{\expandafter{\pst@@sex@@temporary}}%
    \toks0=\expandafter{\LoadConstants\pstVerb}
    \edef\LoadConstants{\the\toks0 {/#2 \csname#2\endcsname\space def}}}

% inject \LoadConstants into pspicture
\def\pst@@picture@i[#1]#2(#3,#4){%
    \renewcommand\const[3][]{%
    \if\relax\detokenize{##1}\relax
        \edef\pst@@sex@@temporary{##3}%
    \else
        \edef\pst@@sex@@temporary{round(##3:##1)}%
    \fi
    \expandafter\FPeval\csname##2\expandafter\endcsname
        \expandafter{\expandafter{\pst@@sex@@temporary}}%
        \pstVerb{/##2 \csname##2\endcsname\space def}\ignorespaces}%
    \@ifnextchar(% ignore anything between [] and ()
    {\pst@@@picture[#1](#3,#4)\LoadConstants}%
    {\pst@@@picture[#1](0,0)(#3,#4)\LoadConstants}}

\endinput
% pst-sex.sty
\end{filecontents*}


\usepackage{multido}
\usepackage{pst-sex}
\usepackage[tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=25pt\relax


\SpecialCoor
\const{Side}{root(2,17)}% the square root of 17

\begin{document}
\begin{frame}   
\begin{pspicture}(\Side,\Side)
    \psframe(!Side dup)\pause
    \multido{\i=0+30}{12}{%
        \const[7]{temp}{cos(\i*pi/180)}
        \rput{\i}(!Side 2 div dup 2 copy temp mul add 3 1 roll \i\space sin mul add){$\temp$}\pause
    }
\end{pspicture}
\end{frame}
\end{document}

What causes this error?

share|improve this question

closed as too localized by Werner, Marco Daniel, Kurt, mafp, Thorsten Apr 27 '13 at 13:31

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Sorry for the bad title because I have no idea to make it more specific and descriptive to convey the exact issue. So feel free to edit the title to suit your preference. :-) –  Who is crazy first Apr 27 '13 at 7:02
2  
I think you should try to minimise your code -- remove any lines that can be removed while preserving the error. For instance, I just tried removing everything between \begin{pspicture}(\Side,\Side) and \end{pspicture} and the error was still the same. This way you might be able to zoom in on the source of the error. –  John Wickerson Apr 27 '13 at 7:28
    
@JohnWickerson: The problem has been fixed. It is about my fault. I used article that should be beamer. –  Who is crazy first Apr 27 '13 at 7:50
    
Most "bugs" with LaTeX system are user problems. –  kan Apr 27 '13 at 7:51
    
@kan: And bugs come from not knowing what we are doing. –  Who is crazy first Apr 27 '13 at 7:53

1 Answer 1

up vote 2 down vote accepted

it maybe a good idea to choose the correct documentclass ;-)

\documentclass{article}
[ ... ]

but you are using the frame environment ...

However, with the current pstricks.tex from http://texnik.dante.de/tex/generic/pstricks/ I can do something like:

\documentclass{beamer}
\usepackage{pst-tools,multido}
\SpecialCoor

\begin{document}
\begin{frame}{title}   
\begin{pspicture}(-4.5,-4.5)(4.5,4.5)
 \psframe(+{-sqrt(17)/2}, x)(+{sqrt(17)/2}, x)\pause
 \multido{\iA=0+30}{12}{\rput{\iA}(1;\iA){\psPrintValue[algebraic]{\iA, cos(x*Pi/180)}}\pause}
\end{pspicture}
\end{frame}
\end{document}

enter image description here

share|improve this answer
    
Adding a new feature to allow points in all PSTricks graphic objects to accept node expressions is a good idea. For example: \pnode(2,3){A}\pnode(3,1){B}\psline(.5(B)-.25(A))\rput((A)-(B)){...}\pscircle(2‌​(B)-3(A)){3}. :-) –  Who is crazy first Apr 27 '13 at 8:08
    
There is a typo in pstricks.tex (click me). –  Who is crazy first Apr 27 '13 at 18:28

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