Hello. I'm writing some simple text using sweave, and faced a strange problem with eps files produced for my plots (one example attached). Individual eps files are interpreted by ghostscript just fine, and show up without errors. But once I try to include them into main LaTeX/Sweave document (using regular \includegraphics, produced by Sweave), ghostscript gives me this error on those files: Error: /undefinedresult in --stringwidth-- Operand stack: (600) 0.5 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1878 1 3 %oparray_pop 1877 1 3 %oparray_pop 1861 1 3 %oparray_pop 1755 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- Dictionary stack: --dict:1157/1684(ro)(G)-- --dict:0/20(G)-- --dict:82/200(L)-- --dict:178/300(L)-- --dict:91/200(L)-- Current allocation mode is local Current file position is 207944 GPL Ghostscript 8.71: Unrecoverable error, exit code 1 What might be the problem? P.S. I get exactly the same behavior on Debian/sid and OS X. -- Regards, Wartan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Report-fig1.eps Type: application/postscript Size: 19321 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100222/83400aac/attachment.eps>
Hi Wartan, Not really an answer to your specific problem, but you could try to use pdf instead of eps, in combination ofcourse with pdflatex. I've never had problems with pdf nad Sweave. If you need to use eps, than my reply is of no help to you :). cheers, Paul Wartan Hachaturow wrote:> Hello. > > I'm writing some simple text using sweave, and faced a strange problem > with eps files produced for my plots (one example attached). > Individual eps files are interpreted by ghostscript just fine, and > show up without errors. But once I try to include them into main > LaTeX/Sweave document (using regular \includegraphics, produced by > Sweave), > ghostscript gives me this error on those files: > > Error: /undefinedresult in --stringwidth-- > Operand stack: > (600) 0.5 > Execution stack: > %interp_exit .runexec2 --nostringval-- --nostringval-- > --nostringval-- 2 %stopped_push --nostringval-- > --nostringval-- --nostringval-- false 1 %stopped_push 1878 > 1 3 %oparray_pop 1877 1 3 %oparray_pop 1861 1 3 > %oparray_pop 1755 1 3 %oparray_pop --nostringval-- > %errorexec_pop .runexec2 --nostringval-- --nostringval-- > --nostringval-- 2 %stopped_push --nostringval-- > --nostringval-- > Dictionary stack: > --dict:1157/1684(ro)(G)-- --dict:0/20(G)-- --dict:82/200(L)-- > --dict:178/300(L)-- --dict:91/200(L)-- > Current allocation mode is local > Current file position is 207944 > GPL Ghostscript 8.71: Unrecoverable error, exit code 1 > > What might be the problem? > > P.S. I get exactly the same behavior on Debian/sid and OS X. > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul
On Feb 21, 2010, at 10:48 PM, Wartan Hachaturow wrote:> Hello. > > I'm writing some simple text using sweave, and faced a strange problem > with eps files produced for my plots (one example attached). > Individual eps files are interpreted by ghostscript just fine, and > show up without errors. But once I try to include them into main > LaTeX/Sweave document (using regular \includegraphics, produced by > Sweave), > ghostscript gives me this error on those files: > > Error: /undefinedresult in --stringwidth-- > Operand stack: > (600) 0.5 > Execution stack: > %interp_exit .runexec2 --nostringval-- --nostringval-- > --nostringval-- 2 %stopped_push --nostringval-- > --nostringval-- --nostringval-- false 1 %stopped_push 1878 > 1 3 %oparray_pop 1877 1 3 %oparray_pop 1861 1 3 > %oparray_pop 1755 1 3 %oparray_pop --nostringval-- > %errorexec_pop .runexec2 --nostringval-- --nostringval-- > --nostringval-- 2 %stopped_push --nostringval-- > --nostringval-- > Dictionary stack: > --dict:1157/1684(ro)(G)-- --dict:0/20(G)-- --dict:82/200(L)-- > --dict:178/300(L)-- --dict:91/200(L)-- > Current allocation mode is local > Current file position is 207944 > GPL Ghostscript 8.71: Unrecoverable error, exit code 1 > > What might be the problem? > > P.S. I get exactly the same behavior on Debian/sid and OS X.It would be helpful to attach the .Rnw SWeave file (if small) or post it someplace that we can look at it, along with any data to replicate your process. I took the EPS file that you provided here, included it in a simple tex file (test.tex) which contains the following: \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure} \centering \includegraphics[width=0.8\textwidth]{Report-fig1} \caption{Test Figure} \end{figure} \end{document} I then processed the file using MacTeX (TeXLive on Snow Leopard) with: latex test.tex dvips test -o test.ps ps2pdf test.ps test.pdf The result is attached here and there were no problems. I would say that perhaps your GS installation might be corrupted, but that seems less likely on two separate platforms, unless your installation process is common and faulty. Alternatively, there is a problem with your .Rnw file content, since that would be common on both. That does not give you a specific resolution, but at least suggests that the EPS generation process via SWeave is not at fault. Regards, Marc Schwartz -------------- next part -------------- A non-text attachment was scrubbed... Name: test.pdf Type: application/pdf Size: 11088 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100222/4f83577e/attachment.pdf>