<<

Quick and dirty guide to creating and using (EPS) files in Windows and Linux.

EPS files are one of the best graphical formats available for scientific . Benefits of EPS files include: • images are stored as vectors instead of pixels; this means that the image can be expanded or shrunk indefinitely with absolutely no loss of quality • EPS files can be sent to any Postscript printer without the need for any additional software • EPS files can be uploaded directly to the American Meteorological Society journals, so that what you see on your screen is exactly what will appear in print in your journal article • EPS format is portable among different operating systems and software packages; an EPS file is really a long list of ASCII directions that are intended for a Postscript printer, so you can actually look at the ASCII files and verify their contents • EPS format is relatively easy to produce using software that is readily available • EPS files are the primary image format used with LaTeX document preparation software, and they can be linked directly into LaTeX documents to produce in- line images with manageable file sizes; the combination of EPS and LaTeX produces the highest quality documents possible (LaTeX has a host of other benefits, including automatically updated references to figure and table numbers and an automatically updated ) • EPS files also can be inserted into Word and other word processing software documents

Okay, I’m sold. So, what do I need to do to use EPS files?

1. In Windows, you can create EPS files directly using or Corel Draw. So, in addition to creating original EPS images in these packages, you can also import an image in any other format into these software packages and save it as an EPS file. This cannot improve a raster (pixeled) image’s quality, but it will convert it to the EPS file structure. Special note: in order to use Micorsoft- created EPS files in Linux applications, you need to perform one additional step: see below! 2. The GrADS software package has a direct conversion utility to produce EPS files from GrADS format output files. This utility is called ‘gxeps’. So, in GrADS, once you have created a plot that you want to print/use and it is on- screen, enter the following sequence of commands: GrADS> enable print filename GrADS> print GrADS> disable GrADS> quit linux_shell> gxeps filename filename.eps 3. The Linux utility ‘convert’ (a part of the Imagemagick software package) can convert almost any other image into EPS format. This cannot improve a raster (pixeled) image’s quality, but it will convert it to the EPS file structure. To invoke it, for example to convert a GIF file to an EPS file, enter the following: linux_shell> convert filename. filename.eps 4. IDL and many other Linux plotting software packages also can create EPS files directly. See the help pages and manuals for those software packages for more details. 5. You can trick other Windows programs into making Postscript (not EPS, but PS) files, which have all the benefits of vector files, but are missing just a little bit of additional information (see item). The trick is to set up Windows to print to an ‘Apple LaserWriter 12/640 PS’ printer, and then in the software package to select the Apple PS printer and check ‘Print to file’. This will create a standard PS file. 6. You can convert any standard Postscript (PS) file to an EPS file by using the Linux utility ‘ps2epsi’. This has the advantage of preserving the vector information encoded in the original PS file, so it is not lossy. It merely modifies the headers to conform to the EPS format. To use this utility, enter the following: linux_shell> ps2epsi filename.ps filename.eps

The Microsoft to Linux EPS fix

When Microsoft software packages create an EPS file, they add some additional data to the file, which does no harm to other Microsoft applications but befuddles Linux machines. Here is what you need to do in order to use Windows-created EPS files in Linux:

1. Open the EPS file with a text editor. Here, the editor of choice is ‘vi’: linux_shell> vi filename.eps 2. Go to the first line of the file (in vi, enter the key sequence ‘1 G’) and remove all of the nonsense characters so that the first line of the file begins with the characters ‘%!PS’ (or something very similar) 3. Search for the string ‘EOF’ (in vi, enter the key sequence ‘/EOF ’. This will take you to a line that should look like ‘%%EOF’ or something very similar. Below this line you will observe a long sequence of nonsensical lines that likely begins with something like ‘%AI9_PrintingData’. You need to remove all of the lines that appear after the ‘%%EOF’ line (in vi, this is most easily accomplished by dropping down one line and then entering the key sequence ‘d G’). 4. This should do the trick. In some cases for some applications, however, you will finally need to add the word ‘showpage’ as the new last line of your EPS file (below the ‘%%EOF’ line). If your EPS document is not printing in Linux, adding a showpage should do the trick.