看到 Herbert 的回答后,显然如果我意识到以下代码的第一行应该是,则不应该出现此问题\documentclass{beamer}
。问题通常来自于不知道自己在做什么。
请关闭这个过于本地化的问题。
抱歉,标题不好!
\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}
什么原因导致此错误?
答案1
选择正确的文档类别也许是一个好主意;-)
\documentclass{article}
[ ... ]
但您正在使用frame
环境......
pstricks.tex
然而,随着http://texnik.dante.de/tex/generic/pstricks/我可以做类似的事情:
\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}