Making Pictures

For including in Word documents and Powerpoints, the easiest way is to use TexPoint, but if the fairly hard-to-evade 3 machines per license regime is a problem, there is another way.

First, LaTeX with something like this starting the preamble:


  \documentclass[12pt]{article}\pagestyle{empty}
  \usepackage{pslatex}
This produces a document in Times Roman, with no page numbers etc. (a one page document for each diagram).

Then create a postscript version of the document, using the dvips -E option (if you don't use -E, then the rest won't work). E.g.


  divps -E pikkie
Now use ghostscript (version 6 or better, with the -dEPSCrop option:

  GS -sDEVICE=pngmono -r300x300 -dEPSCrop -o pikkie.png pikkie.ps
GS is whatever command your system uses to run ghostscript; this will be gswin32c in Windows, probably gs in Linux.

300 seems like a good resolution, pngmono what you'd probably want for a simple black-and-white diagram; ghostscript has many more output options (you might think that EMF would be good, but it seems to suck, unless, perhaps, you have the expensive high-quality drivers).

You also need a relatively recent version of ghostscript (this is being done with 8.64), and, in Windows, you need to include both GS\lib and GS\bin in the PATH environment, GS being the path to wherever ghostscript has been installed to (c:\Program Files\gs\gs8.64 by default).

Here's a sample:

Oops, the very top of the picture got shaved off! Ghostscript appears to not be 100% accurate at finding binding boxes. We can fix this by diving into to the postscript file (wordpad seems able to handle it, notepad doesn't divide the lines) and editing the bounding box, in this case from:


%%BoundingBox: 141 469 461 662
to

%%BoundingBox: 141 469 461 672
(just added 10 to the last number, which is the upper right corner, distance from bottom left of page).

This kind of last-minute hand-editing is the sort of thing one tends to want to avoid; if it were to frequently prove to be necessary, one might want to automate it with some sort of margin-adding tool (Dick Furnstahl's bbox_add.pl is a PERL script that does a bit of bounding box hacking).

BTW the source for the above picture uses both beamerarticle and pstricks, so is a reasonably complex piece of input. The technique would therefore appear to be robust.

Created by: Avery Andrews
Maintained by: Avery Andrews
Last modified: 4 Jan 2010