Next: D. Availability of GMT Up: The Generic Mapping Tools Previous: B.3 Sun raster files Contents Index

# C. Making GMT Encapsulated PostScript Files

GMT can produce both freeform PostScript files and the more restricted Encapsulated PostScript files (EPS). The former is intended to be sent to a printer or PostScript previewer, while the latter is indended to be included in another document (but should also be able to print and preview). You control what kind of PostScript that GMT produces by manipulating the PAPER_MEDIA parameter (see the gmtdefaults man page for how this is accomplished). Note that a freeform PostScript file may contain special operators (such as `Setpagedevice`) that is specific to printers (e.g., selection of paper tray). Some previewers (among them, Sun's pageview) do not understand these valid instructions and may fail to image the file. If this is your situation you should choose another viewer (we recommend ghostview) or select EPS output instead.

However, there is much confusion over what an EPS file is and if other programs can read it. Much of this has to do with the claim by some software manufacturers that their programs can read and edit EPS files. We used to get much mail from people asking us to let GMT produce EPS files that can be read, e.g., by Adobe Illustrator. This was a limitation of early versions of Adobe Illustrator and similar programs, not GMT! Since then, Adobe Illustrator and other programs have improved their abilities to parse freeform PostScript such as that produced by GMT.

An EPS file that is to be placed into another application (such as a text document) need to have correct bounding-box parameters. These are found in the PostScript Document Comment %%BoundingBox. Applications that generate EPS files should set these parameters correctly. Because GMT makes the PostScript files on the fly, often with several overlays, it is not possible to do so accurately. However, GMT does make an effort to ensure that the boundingbox is large enough to contain the entire composite plotC.1. Therefore, if you need a ``tight'' boundingbox you need to post-process your PostScript file. There are several ways in which this can be accomplished.

- Programs such as Adobe Illustrator, Aldus Freehand, and Corel Draw will allow you to edit the boundingbox graphically.

- A command-line alternative is to use freely-available program epstool from the makers of Aladdin ghostscript. Running

  `epstool -c -b yourplot.ps`

  should give a tight BoundingBox; epstool assumes the plot is page size and not a huge poster.

- Another option is to use ps2epsi which also comes with the ghostscript package. Running

  `ps2epsi myplot.ps myplot.eps`

  should also do the trick.

If you do not want to modify the illustration but just include it in a text document: Many word processors (such as Microsoft Word and Corel WordPerfect) will let you include a PostScript file that you may place but not edit. You won't be able to view the figure on-screen, but it will print correctly. All illustrations in this GMT documentation were GMT-produced PostScript files that were converted to EPS files using ps2epsi and then included into a LATEX document.

These examples do not constitute endorsements of the products mentioned above; they only represent our limited experience with the problem. For other solutions and further help, please post messages to gmt-help@hawaii.edu.

Next: D. Availability of GMT Up: The Generic Mapping Tools Previous: B.3 Sun raster files Contents Index