下面的pstricks
代码是我之前发现的,可以用 TeX Live 2013 很好地编译:
\documentclass[pstricks,border=12pt,12pt]{standalone}
\usepackage{pst-plot}
\psset{unit=2cm,dimen=m}
\newdimen\Width\Width=3.64159265\psxunit
\begin{document}
\multido{\i=0+10}{19}{%
\begin{pspicture}(-.5,-.2)(\Width,1)
\psaxes[yAxis=false](0,0)(-.5,0)(\Width,0)
\multips(.5,.5)(1,0){3}{\pscircle[linecolor=cyan!20]{.5}}
\pstVerb{/length {\i\space DegtoRad} def /angle {\i\space .5 div 90 add neg} def}
\rput(!length .5){\psline{->}(!.5 angle PtoC)}
\ifnum\i=180\color{red}\psxTick[labelsep=1pt](3.14159265){\pi}\fi
\psset{linewidth=2pt}
\pscircle(!length .5){.5}
\psline[linecolor=red](!length 0)
\psarcn[linecolor=red](!length .5){.5}{-90}{!angle}
\end{pspicture}}
\end{document}
但是我刚刚更新到 TeX Live 2017,现在我得到:
$ xelatex pi.tex
This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./pi.tex
LaTeX2e <2017-04-15>
Babel <3.15> and hyphenation patterns for 84 language(s) loaded.
...
Overfull \hbox (170.7165pt too wide) detected at line 18
[] [] [] []
[1]
重复 15 次,然后
[15]
Overfull \hbox (170.7165pt too wide) detected at line 18
[] [] [] []
[16Error: /typecheck in --moveto--
Operand stack:
--nostringval-- 0.0 -28.4527 0.0 -28.4527 0 0 ()
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 2015 1 3 %oparray_pop 2014 1 3 %oparray_pop 1998 1 3 %oparray_pop 1884 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:989/1684(ro)(G)-- --dict:1/20(G)-- --dict:166/200(L)-- --dict:126/200(L)--
Current allocation mode is local
Current file position is 2465
GPL Ghostscript 9.22: Unrecoverable error, exit code 1
Error: /typecheck in --moveto--
...
--dict:130/200(L)--
Current allocation mode is local
Current file position is 2321
GPL Ghostscript 9.22: Unrecoverable error, exit code 1
(see the transcript file for additional information)
Output written on pi.pdf (19 pages).
Transcript written on pi.log.
$
有人知道代码是否错误或者pstricks
包中(或其他地方)存在回归吗?
答案1
以前也是这样。/length
无法定义,这是保留的 PostScript 函数名!使用类似名称,例如/Length
:
\documentclass[pstricks,border=12pt,12pt]{standalone}
\usepackage{pst-plot}
\psset{unit=2cm,dimen=m}
\newdimen\Width\Width=3.64159265\psxunit
\begin{document}
\multido{\i=0+10}{19}{%
\begin{pspicture}(-.5,-.2)(\Width,1)
\psaxes[yAxis=false](0,0)(-.5,0)(\Width,0)
\multips(.5,.5)(1,0){3}{\pscircle[linecolor=cyan!20]{.5}}
\pstVerb{/Length {\i\space DegtoRad} def /angle {\i\space .5 div 90 add neg} def}
\rput(!Length .5){\psline{->}(!.5 angle PtoC)}
\ifnum\i=180\color{red}\psxTick[labelsep=1pt](3.14159265){\pi}\fi
\psset{linewidth=2pt}
\pscircle(!Length .5){.5}
\psline[linecolor=red](!Length 0)
\psarcn[linecolor=red](!Length .5){.5}{-90}{!angle}
\end{pspicture}}
\end{document}