[pstricks] pstrick-word

Alan Ristow ristow at ece.gatech.edu
Fri Aug 24 15:03:14 CEST 2007


hamed alsulami wrote:
> Hi every body
>  
> I have a graph of a function done by pstricks(Latex) and I want to put 
> it into a word document, what is the best way to do that in order to 
> preserve the quality of the graph. Thanks

That depends a bit on the version of Word you have. Older versions did 
not work well with .eps files, but newer ones (much to my surprise) seem 
to deal very well with it. If you have an older version, you'll probably 
need to convert the .eps to .emf or .wmf, Microsoft's vector graphics 
format. That, in my experience, is always a bit dicey -- good converters 
are hard to find, and even after conversion I often had mysterious 
problems that made no sense (e.g., graphical elements moving to 
different places depending on which document I drop the graphic into). I 
frequently resorted to using .png, even though it suffered a loss in 
quality, to avoid the problems with .emf and .wmf.

Either way, your first step is convert your PSTricks code to .eps. You 
can put in an empty document, compile, convert to .ps, then use 
Ghostscript or GSView to convert the .ps to .eps. This is a particularly 
good route if you need to make changes to the graphic before using it in 
Word (e.g., re-coloring, re-sizing, change of font, etc.).

Another method that I haven't tried yet, but expect to work very well, 
is to use the pst-pdf package. Follow the package documentation, then 
run pdfLaTeX on your document. This will produce <file>-pics.tex (where 
<file> is the name of your .tex file) containing all of the PSTricks 
graphics in your document. Run LaTeX on <file>-pics.tex, then convert to 
.ps. This will produce a multi-page .ps document containing all of the 
PSTricks graphics in your document, one per page. After that, you can 
use Ghostscript to extract one or more pages and convert them to 
individual .eps files. The advantage to this method is that you don't 
need to create a new .tex file for your graphics; if you need to make 
changes to the graphics for Word, I suppose you can edit the PSTricks 
code in <file>-pics.tex. I'll be trying this next week, so if you try it 
yourself I'd be interested to know how it goes.

Alan



More information about the PSTricks mailing list