Using Imported Graphics in LaTeX and pdfLaTeX - Mirror
Using Imported Graphics in LaTeX and pdfLaTeX - Mirror
Using Imported Graphics in LaTeX and pdfLaTeX - Mirror
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
• eps files must conta<strong>in</strong> a Bound<strong>in</strong>gBox l<strong>in</strong>e which specifies the size of the eps<br />
graphic.<br />
3.1 Forbidden PostScript Operators<br />
S<strong>in</strong>ce eps graphics must share the page with other objects, the comm<strong>and</strong>s <strong>in</strong> an eps<br />
file cannot perform page operations such as select<strong>in</strong>g a page size (such as letter or<br />
a4) or eras<strong>in</strong>g the entire page with erasepage. The follow<strong>in</strong>g PostScript operators<br />
are not allowed <strong>in</strong> eps files:<br />
a3 a4 a5 b<strong>and</strong>device clear<br />
cleardictstack copypage erasepage exitserver framedevice<br />
grestoreall <strong>in</strong>itclip <strong>in</strong>itgraphics <strong>in</strong>itmatrix letter<br />
legal note prenderb<strong>and</strong>s quit renderb<strong>and</strong>s<br />
setdevice setglobal setpagedevice setpageparams setsccbatch<br />
setshared startjob stop<br />
Although the follow<strong>in</strong>g PostScript operators can be used <strong>in</strong> eps files, they may cause<br />
problems if not used properly.<br />
nulldevice setcolortransfer setgstate sethalftone<br />
setmatrix setscreen settransfer undef<strong>in</strong>edfont<br />
Some of the above operators may cause the dvi-to-ps process to fail, while others<br />
may cause strange problems such as graphics which are misplaced, <strong>in</strong>visible, or flash<br />
on the screen. S<strong>in</strong>ce many of these operators do not affect the PostScript stack,<br />
such problems can often be elim<strong>in</strong>ated by simply delet<strong>in</strong>g the offend<strong>in</strong>g PostScript<br />
operator. Other cases may require complicated hack<strong>in</strong>g of the PostScript code.<br />
3.2 The EPS Bound<strong>in</strong>gBox<br />
By convention, the first l<strong>in</strong>e of a PostScript file specifies the type of PostScript<br />
<strong>and</strong> is then followed by a series of comments called the header or preamble. (Like<br />
L A TEX, PostScript’s comment character is %). One of these comments specifies the<br />
Bound<strong>in</strong>gBox. The Bound<strong>in</strong>gBox l<strong>in</strong>e conta<strong>in</strong>s four <strong>in</strong>tegers<br />
1. The x-coord<strong>in</strong>ate of the lower-left corner of the Bound<strong>in</strong>gBox.<br />
2. The y-coord<strong>in</strong>ate of the lower-left corner of the Bound<strong>in</strong>gBox.<br />
3. The x-coord<strong>in</strong>ate of the upper-right corner of the Bound<strong>in</strong>gBox.<br />
4. The y-coord<strong>in</strong>ate of the upper-right corner of the Bound<strong>in</strong>gBox.<br />
For example, the first 5 l<strong>in</strong>es of an eps file created by gnuplot are<br />
%!PS-Adobe-2.0 EPSF-2.0<br />
%%Creator: gnuplot<br />
%%DocumentFonts: Times-Roman<br />
%%Bound<strong>in</strong>gBox: 50 50 410 302<br />
%%EndComments<br />
Thus the gnuplot eps graphic has a lower-left corner with coord<strong>in</strong>ates (50, 50) <strong>and</strong><br />
an upper-right corner with coord<strong>in</strong>ates (410, 302). The Bound<strong>in</strong>gBox parameters<br />
have units of PostScript po<strong>in</strong>ts which are 1 / 72 of an <strong>in</strong>ch, mak<strong>in</strong>g the above graphic’s<br />
natural width 5 <strong>in</strong>ches <strong>and</strong> its natural height 3.5 <strong>in</strong>ches. Note that a PostScript po<strong>in</strong>t<br />
is is slightly larger than a TEX po<strong>in</strong>t, which is 1 / 72.27 of an <strong>in</strong>ch. In TEX <strong>and</strong> L A TEX,<br />
PostScript po<strong>in</strong>ts are called “big po<strong>in</strong>ts” <strong>and</strong> abbreviated bp while TEX po<strong>in</strong>ts are<br />
called “po<strong>in</strong>ts” <strong>and</strong> abbreviated pt.<br />
12