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.
q1<br />
Actuator<br />
Hydraulic<br />
Actuator<br />
q 1<br />
Base<br />
base<br />
Without PSfrag Replace-<br />
Figure 11:<br />
ment<br />
Figure 12: With PSfrag Replacement<br />
15.3 L A TEX Text <strong>in</strong> EPS File<br />
The recommended <strong>and</strong> most popular method for us<strong>in</strong>g psfrag is the \psfrag comm<strong>and</strong><br />
described <strong>in</strong> the previous section. An alternative, less efficient, method for<br />
us<strong>in</strong>g psfrag is the \tex comm<strong>and</strong>, which embeds the L A TEX text directly <strong>in</strong> the eps<br />
file. See [29] for more <strong>in</strong>formation.<br />
15.4 Figure <strong>and</strong> Text Scal<strong>in</strong>g with PSfrag<br />
If a graphic us<strong>in</strong>g psfrag is scaled, the psfrag text is scaled along with the graphic.<br />
As a result, a subtlety of the graphicx package affects the size of the text.<br />
• When the width, height, or totalheight options are used to size the graphic<br />
\<strong>in</strong>cludegraphics[width=3<strong>in</strong>]{file.eps}<br />
the psfrag text is <strong>in</strong>serted after the scal<strong>in</strong>g. Conversely,<br />
\resizebox{3<strong>in</strong>}{!}{\<strong>in</strong>cludegraphics{file.eps}}<br />
Includes the graphic at its natural size, <strong>in</strong>serts the psfrag text, <strong>and</strong> then scales<br />
both the graphics <strong>and</strong> the text.<br />
• Similarly, when scal<strong>in</strong>g options are specified before rotation<br />
\<strong>in</strong>cludegraphics[width=3<strong>in</strong>,angle=30]{file.eps}<br />
the scal<strong>in</strong>g is implicitly h<strong>and</strong>led by the graphics <strong>in</strong>clusion function. However,<br />
when scal<strong>in</strong>g options are specified after rotation<br />
\<strong>in</strong>cludegraphics[angle=30,width=3<strong>in</strong>]{file.eps}<br />
the graphic is first <strong>in</strong>cluded at its natural size, then rotated, <strong>and</strong> then scaled.<br />
S<strong>in</strong>ce psfrag replaces the new text dur<strong>in</strong>g the graphics <strong>in</strong>clusion, the second<br />
comm<strong>and</strong> scales the new psfrag text while the first comm<strong>and</strong> does not. When<br />
the <strong>in</strong>cluded size of the eps graphic greatly differs from its natural size, the<br />
two comm<strong>and</strong>s produce very different results.<br />
See [29] for more <strong>in</strong>formation on the scal<strong>in</strong>g of psfrag text.<br />
15.5 PSfrag <strong>and</strong> PDFTEX<br />
psfrag cannot be used with pdfTEX. If psfrag substitution is needed, one option is<br />
to use the L A TEX-to-dvi-to-PostScript-to-pdf route that was used before pdfTEX.<br />
While this allows psfrag substitution, users lose the advantages that pdfTEX provides.<br />
A better (although more laborious) method is to use psfrag <strong>in</strong>directly with<br />
pdfTEX. This allows psfrag substitution while also keep<strong>in</strong>g the advantages of pdfTEX.<br />
48