logo TRIUMF Annual Report
Scientific Activities 2000
Figures Post-Mortem


The following table and links describe the PostScript editing that was required in order to be able to use the submitted Encapsulated PostScript (EPS) figure files in the TRIUMF Annual Report Scientific Activities 2000.

Please look at the entries relating to the figures which you submitted last year and try to correct any problems before submitting similar files for the 2001 Annual Report.


Return to the Figures Post-Mortem Page

Return to the TRIUMF Annual Report Scientific Activities Home Page


Summary of Problems Encountered
Figure Software Package Used Problem(s) PostScript Editing
Site CorelDRAW 9   None
1 TRIUMF Graphics   None
2 TRIUMF Graphics   None
3 TRIUMF Graphics   None
4 TRIUMF Graphics Linewidths Change linewidths 1»4
5 TRIUMF Graphics Linewidths Change linewidths 1»2
6 TRIUMF Graphics Linewidths Change linewidths 1»2
7 TRIUMF Graphics   None
8 CorelDRAW 9   None
9 TRIUMF Graphics Linewidths Change linewidths 1»3
10 TRIUMF Graphics   None
11 TRIUMF Graphics   None
12 TRIUMF Graphics Linewidths , Colours Change linewidths 6»4 , Change colours
13 TRIUMF Graphics   None
14 TRIUMF Graphics   None
15 Windows PSCRIPT Bounding box ps2epsi , Trial & error
16 TRIUMF Graphics   None
17 TRIUMF Graphics   None
18 TRIUMF Graphics   None
19 HIGZ V1.23/07 Preview , Colours Strip preview code , Change colours
20 CorelDRAW, Windows PSCRIPT Bounding box ps2epsi
21 Adobe Illustrator 6.0   None
22 HIGZ V1.26/04 Bounding box ps2epsi
23 HIGZ V1.25/05 Bounding box ps2epsi
24 Feynman Bounding box ps2epsi , Trial & error
25 TRIUMF Graphics Preview Strip preview code
26 HIGZ V1.23/09 Bounding box ps2epsi , Trial & error
27 HIGZ V1.23/07 Bounding box ps2epsi
28 Ghostscript ps2epsi   None
29 HIGZ V1.23/09 Bounding box ps2epsi
30 HIGZ V1.23/07 Bounding box ps2epsi
31 GIF, XV V3.10   None
32 XV V3.10 Cropping Scanned image
33 JPEG, XV V3.10 Cropping Scanned image
34 XV V3.10 Cropping Scanned image
35 xmgr Bounding box ps2epsi
36 TRIUMF Graphics Linewidths Change linewidths 2»4
37 TRIUMF Graphics Linewidths Change linewidths 2»3
38 fig2dev V3.2.3 PL1 Heading , Bounding box Change heading , ps2epsi
39 TRIUMF Graphics   None
40 TRIUMF Graphics   None
41 TRIUMF Graphics   None
42 TRIUMF Graphics   None
43 TRIUMF Graphics   None
44 TRIUMF Graphics Colours Change colours
45 TRIUMF Graphics   None
46 Corel Photo-Paint 7   None
47 HIGZ V1.26/04 Bounding box ps2epsi
48 HIGZ V1.23/09 Bounding box ps2epsi
49 HIGZ V1.26/04 Bounding box ps2epsi
50 TRIUMF Graphics   None
51 Grace-5.1.0   None
52 CorelDRAW 9   None
53 fig2dev V3.2 PL1   None
54 HIGZ V1.26/04 Linewidths , Bounding box Change linewidths 1»2,3 , ps2epsi
55 HIGZ V1.26/04 Bounding box ps2epsi
56 HIGZ V1.26/04 Bounding box ps2epsi
57 Axum for Windows   None
58 Axum for Windows Bounding box ps2epsi
59 TRIUMF Graphics Linewidths Change linewidths 2»3
60 TRIUMF Graphics   None
61 TRIUMF Graphics   None
62 TRIUMF Graphics   None
63 TRIUMF Graphics   None
64 TRIUMF Graphics   None
65 TRIUMF Graphics   None
66 xmgr Bounding box ps2epsi
67 xmgr Bounding box ps2epsi
68 TRIUMF Graphics   None
69 Igor Bounding box ps2epsi
70 Igor Bounding box ps2epsi
71 TRIUMF Graphics   None
72 TRIUMF Graphics   None
73 TRIUMF Graphics   None
74 PSCRIPT.DRV V4.0 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi , Trial & error
75 PSCRIPT.DRV V4.0 Printer setup , Whiteout , Captions , Bounding box Suppress printer setup , Suppress whiteout , Change captions , ps2epsi , Trial & error
76 TRIUMF Graphics Linewidths Change linewidths 1»3
77 TRIUMF Graphics Linewidths Change linewidths 2»3
78 Ghostscript ps2epsi Preview Strip preview code
79 Ghostscript ps2epsi Preview Strip preview code
80 Igor Pro, LaserWriter 8 J1-8.7 Bounding box ps2epsi
81 Igor Pro, LaserWriter 8 J1-8.7 Bounding box ps2epsi
82 Axum for Windows Bounding box ps2epsi
83 Axum for Windows Bounding box ps2epsi
84 Axum for Windows Bounding box ps2epsi
85 TRIUMF Graphics Linewidths Change linewidths 2»3
86 TRIUMF Graphics Linewidths Change linewidths 2»4
87 TRIUMF Graphics Linewidths Change linewidths 2»4
88 TRIUMF Graphics Linewidths Change linewidths 2»4
89 TRIUMF Graphics Linewidths Change linewidths 2»4
90 TRIUMF Graphics Linewidths Change linewidths 2»4
91 TRIUMF Graphics Linewidths Change linewidths 1»3
92 GIMP PostScript plugin V1.06, XV V3.10  Cropping , Bounding box Scanned image , ps2epsi
93 PDF, acroread Whiteout , Bounding box ps2epsi
94 TRIUMF Graphics   None
95 TRIUMF Graphics Linewidths Change linewidths 2»4
96 TRIUMF Graphics   None
97 TRIUMF Graphics Linewidths Change linewidths 2»4
98 TRIUMF Graphics Linewidths Change linewidths 2»3
99 TRIUMF Graphics   None
100 TRIUMF Graphics   None
101 TRIUMF Graphics   None
102 TRIUMF Graphics   None
103 TRIUMF Graphics   None
104 TRIUMF Graphics Linewidths , Spurious , Bounding box Change linewidths 2»3 , Remove spurious item , ps2epsi
105 TIF, XV V3.10 Cropping Scanned image
106 TIF, XV V3.10 Cropping Scanned image
107 TIF, XV V3.10 Cropping Scanned image
108 TRIUMF Graphics Linewidths Change linewidths 2»3
109 TRIUMF Graphics Linewidths Change linewidths 2»3
110 TRIUMF Graphics   None
111 AutoCAD, PSOUT Bounding box ps2epsi
112 TRIUMF Graphics   None
113 InterMapper 3.0-68K, LaserWriter 8 8.7 Colours , Heading , Printer setup , Bounding box Change colours , Change heading , Suppress printer setup , ps2epsi
114 TRIUMF Graphics Linewidths Change linewidths 3»4
115 XV V3.10a Preview Strip preview code
116 TRIUMF Graphics Linewidths , Preview Change linewidths 2»3  , Strip preview code
117 TRIUMF Graphics Linewidths , Preview , Spurious , Bounding box Change linewidths 2»3  , Strip preview code , Remove spurious item , ps2epsi
118 TRIUMF Graphics Linewidths , Preview Change linewidths 2»3  , Strip preview code
119 TRIUMF Graphics Linewidths , Preview Change linewidths 2»3  , Strip preview code
120 CorelDRAW 8   None
121 CorelDRAW 8 Bounding box ps2epsi
122 TRIUMF Graphics   None
123 CorelDRAW 8 Bounding box ps2epsi
124 CorelDRAW 8 Bounding box ps2epsi
125 JPEG, XV V3.10   None
126 JPEG, XV V3.10   None
127 Freelance Graphics, Adobe Printer Driver 3.0 for Windows 3.1   None
128 Freelance Graphics, Adobe Printer Driver 3.0 for Windows 3.1   None
129 Freelance Graphics, Adobe Printer Driver 3.0 for Windows 3.1   None
130 MS Excel, ADOBEPS4.DRV V4.24 Printer setup , Whiteout , Bounding box Suppress printer setup , Remove white fill , ps2epsi
131 MS Excel, ADOBEPS4.DRV V4.24 Printer setup , Whiteout , Bounding box Suppress printer setup , Remove white fill , ps2epsi
132 MS Excel, ADOBEPS4.DRV V4.24 Printer setup , Whiteout , Bounding box Suppress printer setup , Remove white fill , ps2epsi
133 JPEG, XV V3.10 Cropping Scanned image
134 JPEG, XV V3.10   None
135 JPEG, XV V3.10   None
136 MS Word, LaserWriter 8 8.6.5 Bounding box ps2epsi , Trial & error
137 JPEG, XV V3.10   None
138 JPEG, XV V3.10   None
139 JPEG, XV V3.10   None
140 JPEG, XV V3.10   None
141 JPEG, XV V3.10   None
142 TRIUMF Graphics Linewidths , Colours Change linewidths 2»3 , Change colours
143 TRIUMF Graphics Linewidths , Colours Change linewidths 2»3 , Change colours
144 TRIUMF Graphics   None
145 TRIUMF Graphics Colours Change colours
146 TRIUMF Graphics Linewidths , Colours Change linewidths 2»3 , Change colours
147 TRIUMF Graphics Linewidths , Colours Change linewidths 2»3 , Change colours
148 TRIUMF Graphics Linewidths , Colours Change linewidths 2»3 , Change colours
149 TRIUMF Graphics Linewidths Change linewidths 2»3
150 TRIUMF Graphics Linewidths , Colours Change linewidths 2»3 , Change colours
151 TRIUMF Graphics Colours Change colours
152 TRIUMF Graphics Colours Change colours
153 LEXPSNT V2.01.01 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
154 TRIUMF Graphics Linewidths , Colours Change linewidths 2»3 , Change colours
155 LEXPSNT V2.01.01 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
156 LEXPSNT V2.01.01 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
157 LEXPSNT V2.01.01 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
158 LEXPSNT V2.01.01 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
159 LEXPSNT V2.01.01 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
160 MS Word, PSCRIPT.DRV V4.0 CTRL D , Printer setup , Whiteout , Bounding box EOF , Suppress printer setup , Suppress whiteout , ps2epsi
161 Quattro Pro, PSCRIPT.DRV V4.0 Frame , Whiteout , Bounding box Remove frame , Suppress whiteout , ps2epsi , Trial & error
162 Quattro Pro, PSCRIPT.DRV V4.0 Frame , Whiteout , Bounding box Remove frame , Suppress whiteout , ps2epsi , Trial & error
163 Quattro Pro, PSCRIPT.DRV V4.0 Frame , Whiteout , Bounding box Remove frame , Suppress whiteout , ps2epsi , Trial & error
164 Quattro Pro, PSCRIPT.DRV V4.0 Frame , Whiteout , Bounding box Remove frame , Suppress whiteout , ps2epsi , Trial & error
165 TRIUMF Graphics   None
166 JPEG, XV V3.10   None
167 Pscript.dll V5.0   None
168 Adobe Photoshop Vv5.0.2 Cannot view/print Head & tail
169 JPEG, XV V3.10   None
170 Pro/ENGINEER Linewidths , Printer setup , Bounding box Change linewidths 0.005»0.010 , Suppress printer setup , ps2epsi , Trial & error
171 Mathematica 4.0 for X Bounding box ps2epsi
172 JPEG, XV V3.10 Cropping , Frame Scanned image , Remove frame
173 JPEG, XV V3.10   None
174 Windows NT 3.5 CTRL D , Printer setup , Bounding box EOF , Suppress printer setup , ps2epsi
175 Windows NT 3.5 CTRL D , Printer setup , Bounding box EOF , Suppress printer setup , ps2epsi
176 JPEG, XV V3.10   None
177 JPEG, XV V3.10   None
178 JPEG, XV V3.10   None
179 Windows NT 4.0 Bounding box ps2epsi
180 Windows NT 4.0 Bounding box ps2epsi , Trial & error
181 Windows NT 4.0 Captions , Position , Bounding box Change captions , Change position , ps2epsi , Trial & error
182 Windows NT 4.0 Bounding box ps2epsi

| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |


Description of Problems and Solutions
Problem PostScript Editing Solution
Cannot view/print
The figure cannot be viewed using Ghostview or Ghostscript and cannot be printed.
Head & tail
Problem:
Inability to view or print is caused by the existence of unwanted lines at the head of the file, or unwanted characters at the beginning of the first line, and unwanted lines appended at the end of the file.

Often the lines at the head and tail of the file correspond to escape sequences which are sent to the printer to explicitly force it into and out of PostScript printing mode.

Solution:
The first line of the file must begin with %!PS-Adobe-...

Strip off any lines above this, or any characters before it on the first line.

The file should end with %%EOF (or %%Trailer with perhaps valid lines in the trailer block).

Strip off any lines after this.

CorelDRAW EPS head & tail
Problem:
Will not view using Ghostview or Ghostscript. Will not print.

The problem is caused during the creation of the EPS file by CorelDRAW. Unwanted characters are inserted at the beginning of the first line and unwanted lines are appended at the end of the file.
(See below for instructions on how to avoid this problem.)

Solution:
Strip all unwanted characters off the first line of the file from the start of the file until %!PS-Adobe-... is reached.

Strip all unwanted lines off the tail of the file, starting after the line %%EOF until the end.

CAUTION: many of these lines are extremely long binary strings (may be 1 MB long) and editors tend to freeze if an attempt is made to go to the end of the file and start deleting backwards. Find the %%EOF line, move to the next line and then start deleting by word or line. Normally there are only about 5-50 lines of data to delete.

Real solution:
When saving to EPS format in CorelDRAW, using File Export, ensure that in the EPS Export window:

Export text as:
  is set to Text and the Include fonts box IS checked
NOT
  set to Curves.

Image header:
  The Include header box IS NOT checked.
(If checked, this produces the unwanted code at the head and tail of the file.)

Scan
Problem:
All attempts to edit submitted EPS file fail, or no electronic version of the figure exists.

Solution:
Scan, using Adobe Photoshop or similar package, and save as an EPS file.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

CTRL D
CTRL D character present at end of file. Causes viewing and printing problems.
EOF
Problem:
%%EOF line followed by CTRL D character. Caused by the software package used to create the EPS file or using the -F1 option in dvips.

Solution:
Delete the CTRL D character at the end of the file.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Printer setup
The file is not a true EPS file, but a PostScript file which contains explicit printer setup commands.
Suppress printer setup
Problem:
Explicit printer setup commands are contained in the
%%BeginSetup ... %%EndSetup
and/or
%%BeginPageSetup ... %%EndPageSetup
sections of the PostScript file which cause viewing and printing problems.

Solution:
Find the
%%BeginSetup ... %%EndSetup
and
%%BeginPageSetup ... %%EndPageSetup
sections of the file.

Look for sets of lines like:

%%BeginFeature: *OPTION
... (SETUP)
%%EndFeature

where *OPTION can be:

*PageSize US Letter
*Resolution 300dpi
*InputSlot AutoSelect Tray
*ManualFeed
*Duplex
etc.

Either delete or comment out each line corresponding to
... (SETUP)
(Comment out a line by placing a single % at the start of the line.)
Blank lines may be left as no printer setup is specified.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Whiteout
The software package used did not create a true EPS file, but a PostScript file where the image was placed on a full size page which was explicitly initialized with a white colour fill.
Suppress whiteout
Problem:
Almost all problems are due to the use of the Microsoft Windows PostScript Driver PSCRIPT.DRV.

The PostScript macro rf (often multiply defined in the various PostScript dictionaries in the file) is defined to execute a rectfill (rectangular fill) of the defined area (full US Letter or A4 page) in the defined colour (white).

Even if the bounding box values for the image are correct, when the scaled image is laid down on the page it still retains a white border corresponding to a whiteout area of a full US Letter or A4 page scaled down by the figure scaling factor. This whiteout area obliterates any underlying text or images which have already been defined in the PostScript file (text or images defined later in the file can overprint this whiteout area).

Solution:
Find the
%%BeginPageSetup ... %%EndPageSetup
section of the file and then the line

userdict begin /pagesave save def end mysetup concat colspRefresh : 1.000 1.000 1.000 sco 0 0 XXXX YYYY rf ;

where XXXX YYYY =

2550 3300 (300 dpi, US Letter, 8.5" x 11", portrait)
3300 2550 (300 dpi, US Letter, 8.5" x 11", landscape)
5100 6600 (600 dpi, US Letter, 8.5" x 11", portrait)
6600 5100 (600 dpi, US Letter, 8.5" x 11", landscape)
2480 3508 (300 dpi, A4, 210 mm x 297 mm, portrait)
etc.

Edit the line by replacing both XXXX and YYYY with 0.
(For safety, copy and comment out the original line first.)

Now the rf rectangular fill command is filling a zero area rectangle with white.

Re-run LaTeX2e and dvips to check that the whiteout problem has been solved. If it remains, check to see if code performing a white clip fill also exists in the file, as outlined below.

Or, calculate the correct bounding box values and use the clip= option with the \epsfig command or the clip option with the \includegraphics command when using LaTeX2e.

Remove white fill
Problem:
Clip area defined and filled with white before laying down a particular part of the image, obliterating any underlying text or images which have already been defined in the PostScript file. The clip area is often too large, especially if a frame has been removed, a heading changed, captions moved, or the position of image elements changed.

Solution:
Normally the offending code will be found at the start of the PostScript code which draws the particular part of the image.

Look for code such as:

xxxx yyyy N M XXXX YYYY rr : 1.000 1.000 1.000 sco O ;

which starts a newpath and moves to xxxx yyyy before defining a relative clip area of dimensions XXXX YYYY and performing a white fill. Edit the line by changing both XXXX and YYYY to 0.

Or look for code such as:

: 0 0 XXXX YYYY rc

which defines a rectangular relative clip area of dimensions XXXX YYYY and performs a white fill. Edit the line by changing both XXXX and YYYY to 0.

Or look for code which defines a newpath, moves to a point, defines a box by a series of four lines, and then performs a white fill using the F macro. In this case, comment out or delete these particular lines of code.

In each case, XXXX and YYYY are large numbers corresponding to the overall size of the image. There may be many instances of such strings of code in the file because many software packages clip and white fill areas before laying down each element. However, the offending set of code is normally at the head of the PostScript code defining the image.

If these attempts fail, calculate the correct bounding box values and use the clip= option with the \epsfig command or the clip option with the \includegraphics command when using LaTeX2e.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Cropping
Whitespace around a scanned image needs to be cropped. Cannot use ps2epsi (see Warning).

Imperfections
Imperfections on a scanned image need removing.

Scanned image
Problem:
The file has been created by scanning an image or by conversion from another file format using a package such as XV. The image has unwanted features such as a frame, imperfections, or whitespace.

Solution:
If the original bitmap file (JPEG, GIF, TIFF, etc.) is available, whitespace may be cropped using XV or a similar package.

If removing whitespace, edit the preamble defining the number of pixels in the horizontal and vertical directions, and then either remove the unwanted lines of hex code at the top and/or bottom of the image, or edit every line of hex code to remove pixels on the left or right.

If removing unwanted lines or imperfections, edit the corresponding hex code for each scan line.

(NOTE: This procedure requires a detailed knowledge of the hex code syntax, which differs depending upon which software package was used to produce the image.)

Warning:
If the scanned image has unwanted whitespace around it, beware of merely using ps2epsi to find the correct bounding box values, editing the .eps file to insert the correct bounding box values, and then rescaling the image in the document. The white pixels forming the unwanted whitespace border will also be scaled and may overwrite any neighbouring text or images that have already been defined in the PostScript file. Therefore the steps outlined above should be followed in order to remove any unwanted whitespace from the image.

If editing of the hex code is impractical, calculate the correct bounding box values and use the clip= option with the \epsfig command or the clip option with the \includegraphics command when using LaTeX2e.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Spurious
Figure contains spurious dots or lines.
Remove spurious item
Problem:
A vector graphics figure contains spurious dots or lines.

Solution:
Comment out the relevant code.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Frame
The figure has an unwanted frame box drawn around it.
Remove frame
Problem:
The image has been produced with an unwanted frame box drawn around it.

Solution:
In the case of a scanned image file, the hex code of each affected scan line has to be edited, as described above.

For a vector graphics EPS file, the PostScript code defining the frame box lines has to be found and deleted, commented out, or modified. The code is normally near the head or tail of the PostScript code which defines the image.

Occasionally the frame box is drawn twice, so two sets of code have to be modified.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Heading
The figure includes an unwanted or incorrect heading, or other text.
Change heading
Problem:
The figure includes an unwanted heading which is duplicated in the figure caption, or an incorrect heading, or other unwanted or incorrect text.

Solution:
Find the relevant PostScript code (normally easy to find by searching for the actual words or fragments of the words) and either comment out (sometimes fails) or replace by null fields.

If the text needs changing, modify the relevant code. However, positioning problems may result if major modifications are made.

Some software packages do not use PostScript fonts for text, but draw a series of lines instead. These are far more difficult to edit, but sometimes the correct sections of code can be found and removed.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Captions
Incorrect or incorrectly positioned captions on graphs.
Change captions
Problem:
The captions on graphs are incorrectly labelled or are in the wrong position.

Solution:
As for headings, find the relevant code and alter the wording or positioning.

To alter the position of a part of the image, use the x y translate command before the relevant section of code, followed by a compensating translation in the opposite sense before the remainder of the code in the figure.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Position
Part(s) of an image are incorrectly positioned.
Change position
Problem:
Part(s) of an image are incorrectly positioned, either in the original figure or as a result of removing or adding text or other features.

Solution:
Reposition parts of an image using the x y translate command before the relevant section of code, followed by a compensating translation in the opposite sense before the remainder of the code in the figure.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Linewidths
The linewidths are too thick or too thin in the figure.
Change linewidths
Problem:
Some or all linewidths are too thick or too thin in the figure.

Solution:
Find the n setlinewidth command (or the corresponding macro command) for the relevant part of the image and alter the value of n. Some software packages assign global linewidths, others explicitly assign values for each set of line elements.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Colours
Colours need to be changed in the figure.
Change colours
Problem:
Colours need to be changed in the figure for some reason. In particular, pale colours such as yellow or cyan reproduce poorly when printed on monochrome laser printers. Lines, arrows and labelling should not use pale colours.

Solution:
Either change the colour completely or darken it by changing its RGB values to lower indices. For the standard primary colours change indices of 1 to 0.8.

Find and edit the r g b setrgbcolor values for the relevant parts of the image. Some software packages define global macros for a palette of colours, in which case only one set of rgb values has to be changed to alter all such instances of the colour in the image. Other software packages explicitly assign values for each set of line elements.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Clarity
The clarity of a scanned image is poor.
Sharpen JPG
Problem:
The clarity of a scanned image is poor and needs to be sharpened or blurred.

Solution:
Use a package such as XV or Adobe Photoshop to modify the appearance of the image.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Not EPS
Not a true EPS file but a PostScript file defining an image placed somewhere on a one page document.
LaTeX & dvips
Problem:
In many instances, PostScript files masquerading as EPS files can be used successfully in LaTeX2e documents, either unaltered or by using one of the fixes described in this table.

However, PostScript files that have been created by writing LaTeX code to place an image on a page, then running LaTeX2e and dvips to create a PostScript file, have the problem that they have incorrect bounding box values in the heading and embedded code specifying a full US Letter or A4 page size. Therefore the images will not scale properly. The irony is that a (perhaps) perfectly good EPS file had to be used to create an unusable PostScript file.

Solution:
If the original EPS figure file cannot be obtained, edit the PostScript file by stripping out all of the code after the %%BoundingBox: line in the heading until %%Page: 1 1 is reached.

Use the llx lly urx ury values in the @beginspecial command as the possibly correct bounding box values and edit the %%BoundingBox: line in the heading.

Then delete the code starting at %%Page: 1 1 until after the %%BeginDocument: line.

The PostScript code defining the image follows.

At the tail of the file, comment out the lines created by LaTeX2e and dvips and leave the %%Trailer and %%EOF lines and relevant code in the Trailer block.

View the file using Ghostview or Ghostscript to see if it works, and run ps2epsi to confirm the bounding box values.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Bounding box
The bounding box values specified for the figure are wrong and the image does not scale correctly.
ps2epsi
Problem:
Bounding box values wrong, image does not scale to column width correctly. Often too much white space around figure.

Solution:
Run the ps2epsi package to determine the correct bounding box values from the resulting .epsi file which is created (see the %%BoundingBox: line at the head of the file). Comment out the incorrect %%BoundingBox: line in the .eps file and insert the correct one (edit the .eps file rather than using the .epsi file because the .epsi file is larger due to the fact that it also includes a preview of the image).

Sometimes the ps2epsi package runs but produces an error message; the resulting .epsi file is not viewable. However, in many cases the bounding box values have been computed correctly and can be copied from the head of the file.

If ps2epsi fails completely, the bounding box must be determined via Trial and error.

ps2epsi also fails to calculate the urx coordinate correctly if an image created in landscape orientation was saved in portrait orientation. In this case urx=612 (8.5" in points) for US letter paper mode or urx=595 (210 mm in points) for A4 paper mode. Use Trial and error to find the correct coordinate value.

Warning:
After using ps2epsi and editing the .eps file, re-run LaTeX2e and dvips and then use Ghostview or Ghostscript to check that the image has scaled properly. In addition, ensure that neighbouring text or images have not been clipped by an extended whitespace around the image. See the instructions for how to suppress whiteout.

Trial & error
Problem:
ps2epsi or other solutions fail to determine the correct bounding box values.

Solution:
Using Ghostview the llx, lly, urx, ury values can be determined by moving the cursor to the outermost left, bottom, right and top pixels of the image respectively and reading the relevant coordinate from the coordinate display box.

Edit the .eps file by inserting the new values in the %%BoundingBox: line, then view the resulting file using Ghostview or Ghostscript. If the bounding box is correct, the Ghostview or Ghostscript window will scale to exactly enclose the image. Edit the estimated values to correct for any whitespace or clipping.

A good estimate can be gained by printing the .eps file, drawing a box around the image which just touches the outermost top, bottom, left and right pixels of the image, and then computing the coordinates of the lower left and upper righthand corners of the box to determine the llx, lly, urx, ury values in points (72 pt = 1 inch). The origin of the coordinate system is the lower lefthand corner of the paper.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Preview
The file contains image preview code.
Strip preview code
Problem:
The file contains image preview code inserted by the software package used to create the image when saving as an EPS file. The ps2epsi package also creates an image preview. While image previews are required by some wordprocessing packages such as MS Word, LaTeX2e and Ghostview ignore them and they take up unnecessary disk space and increase the download time to page viewers such as Ghostview.

Solution:
Strip out the unwanted code.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |


EPS file structure

Required comments:

%!PS-Adobe-x.0 EPSF-y.z       (x=1,2,3 ; y=1,2,3 ; z=0,1,2,...)
%%BoundingBox: llx lly urx ury

Recommended comments:

%%Title:
%%Creator:
%%CreationDate:
%%EndComments

Conditionally required comments:

%%Begin(End)Preview:
%%Extensions:
%%LanguageLevel:

Allowed comments:

%%DocumentNeededFonts
%%DocumentNeededResources

Illegal and restricted operators:

statusdict
userdict
clear
cleardictstack
initmatrix
setpagedevice
...

... PostScript code for image ...

showpage

%%Trailer

%%EOF


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |


Return to the Figures Post Mortem Page

Return to the TRIUMF Annual Report Scientific Activities Home Page


For further assistance please contact:

TRIUMF Publications Office

Lorraine King - Thursdays and Fridays (09:30-14:00), and Sundays
(January to March only)
Jana Thomson - Wednesdays and Thursdays

E-mail: annrep@triumf.ca

Phone: 604-222-7427
FAX: 604-222-1074

Last modified: Fri Jan 18 17:09:08 PST 2002 by Martin Comyn

Visitors since 18-JAN-2002