[pstricks] how to convert pstricks to eps?

bear xgl99 at mails.tsinghua.edu.cn
Tue Dec 14 11:05:07 CET 2004


hi all,
    Pstricks is nice but I have a problem
    I dont want to run latex every time to generate a figure written with pstricks
in my document, but to save it to a eps file. How to let the the geometry fit well
in document?
Below is my pstricks. The problem is that it is a4paper in size and cannot too
large to embed in my document. can I save it just in the size of the figure
alone?

\documentclass[10pt,a4paper]{article}
\usepackage{multido,pstricks}
\def\particle#1#2{%
  \pscircle[fillstyle=solid,fillcolor=black](#1,#2){2pt} %particle
 
\pscircle[linestyle=dotted,dotsep=1.5pt,linewidth=0.5pt,linecolor=gray](#1,#2){6pt
}}
\psset{linewidth=2pt}
\begin{document}
  \begin{pspicture}(7,7)
    \psgrid[subgriddiv=0,griddots=10,gridlabels=0,gridcolor=lightgray](0,0)(6,6)
%grid
    \psline[linewidth=1.5pt]{-}(-1,6)(7,6) %boundary
    \psdots[dotscale=1,dotstyle=o,fillstyle=solid,fillcolor=red](3,6.5)  %photon
    \psline[linewidth=0.5pt]{->}(3,6.5)(3,5.5) %direction
    \multido{\ia=0+1}{7}{%
      \multido{\ib=0+1}{7}{\particle{\ia}{\ib}}}
  \end{pspicture}
  \hspace{30pt}%
  \begin{pspicture}(7,7)
    \psgrid[subgriddiv=0,griddots=10,gridlabels=0,gridcolor=lightgray](0,0)(6,6)
%grid
    \psline[linewidth=1.5pt]{-}(-1,6)(7,6) %boundary
    \psdots[dotscale=1,dotstyle=o,fillstyle=solid,fillcolor=red](3,6.5)  %photon
    \psline[linewidth=0.5pt]{->}(3,6.5)(3,5.5) %direction
    \input{rs.data}
  \end{pspicture}
\end{document}





More information about the PSTricks mailing list