12.04.2015 Views

Using Imported Graphics in LaTeX and pdfLaTeX - Mirror

Using Imported Graphics in LaTeX and pdfLaTeX - Mirror

Using Imported Graphics in LaTeX and pdfLaTeX - Mirror

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.4 Fix<strong>in</strong>g Non-st<strong>and</strong>ard EPS files<br />

Some applications (such as Mathematica <strong>and</strong> FrameMaker) produce non-st<strong>and</strong>ard<br />

eps files which cannot be used <strong>in</strong> other programs such as L A TEX. Some of these applications<br />

have developed their own “improved” flavor of PostScript with additional<br />

features, while other applications use poor PostScript programm<strong>in</strong>g. Often these<br />

non-st<strong>and</strong>ard eps can be easily fixed by scripts provided by either the software companies<br />

themselves or by PostScript-savvy users. Check the software manufacturer’s<br />

web page or search USENET groups associated with the software.<br />

4 How EPS Files are Used by L A TEX<br />

When process<strong>in</strong>g a dvips-style document, the eps files are used by both L A TEX <strong>and</strong><br />

the dvi-to-ps converter.<br />

1. L A TEX scans the eps file for the Bound<strong>in</strong>gBox l<strong>in</strong>e, which tells L A TEX how much<br />

space to reserve for the graphic.<br />

2. The dvi-to-ps converter then reads the eps file <strong>and</strong> <strong>in</strong>serts the graphics <strong>in</strong> the<br />

ps file.<br />

This has the follow<strong>in</strong>g ramifications<br />

• If the Bound<strong>in</strong>gBox parameters are specified <strong>in</strong> the graphics-<strong>in</strong>sertion comm<strong>and</strong><br />

(e.g., the bb option of \<strong>in</strong>cludegraphics is used) then L A TEX never even reads<br />

the eps file. In fact, the eps file does not even need to exist when L A TEX is<br />

run.<br />

• S<strong>in</strong>ce TEX cannot read non-ascii files <strong>and</strong> cannot spawn other programs, L A TEX<br />

cannot read the Bound<strong>in</strong>gBox <strong>in</strong>formation from compressed or non-eps graphics<br />

files. In these cases, the Bound<strong>in</strong>gBox parameters must be specified <strong>in</strong> the<br />

graphics-<strong>in</strong>sertion comm<strong>and</strong> (e.g., <strong>in</strong> the bb option of the \<strong>in</strong>cludegraphics<br />

comm<strong>and</strong>) or stored <strong>in</strong> a non-compressed text file (see Section 14 on Page 42).<br />

• The eps graphics are not <strong>in</strong>cluded <strong>in</strong> the dvi file. S<strong>in</strong>ce the eps files must<br />

be present when the dvi file is converted to ps, the eps files must accompany<br />

dvi files whenever they are moved.<br />

• The eps graphics may not appear <strong>in</strong> some dvi viewers. To help the user with<br />

placement of the graphics, these dvi viewers generally display the Bound<strong>in</strong>gBox<br />

<strong>in</strong> which the graphics will be <strong>in</strong>serted.<br />

4.1 L<strong>in</strong>e Buffer Overflow<br />

TEX reads ascii files one l<strong>in</strong>e at a time, putt<strong>in</strong>g each l<strong>in</strong>e <strong>in</strong> its l<strong>in</strong>e buffer, which<br />

is often about 3000 characters long. If any of the l<strong>in</strong>es of the eps file is longer than<br />

the l<strong>in</strong>e buffer, the follow<strong>in</strong>g error is displayed<br />

Unable to read an entire l<strong>in</strong>e--bufsize=3000.<br />

Please ask a wizard to enlarge me.<br />

S<strong>in</strong>ce eps rarely have l<strong>in</strong>es longer than 3000 characters, there are two possible causes<br />

of such an error<br />

1. The EPS file conta<strong>in</strong>s a long b<strong>in</strong>ary preview.<br />

Some applications place a b<strong>in</strong>ary preview of the graphics at the beg<strong>in</strong>n<strong>in</strong>g of<br />

the eps file. This allows applications (such as dvi viewers) to display the<br />

14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!