28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.1. The graphics packages 157<br />

puzzling even <strong>to</strong> experienced users. (The frames would not normally<br />

appear with the above comm<strong>and</strong>s.)<br />

Exercise 6.1: Copy the lines<br />

at the right <strong>to</strong> a file named<br />

demo.eps <strong>and</strong> then include it<br />

in a L AT E X document, with some<br />

normal text above <strong>and</strong> below it.<br />

The result should appear as:<br />

%!PS-Adobe-3.0 EPSF-3.0<br />

%%BoundingBox: 169 158 233 242<br />

220 200 move<strong>to</strong><br />

200 200 20 0 360 arc<br />

170 170 move<strong>to</strong><br />

230 220 line<strong>to</strong><br />

170 210 line<strong>to</strong><br />

225 160 line<strong>to</strong><br />

205 240 line<strong>to</strong><br />

170 170 line<strong>to</strong><br />

stroke<br />

showpage<br />

Note: This file can be copied from the enclosed CD in the direc<strong>to</strong>ry<br />

\books\Kopka_<strong>and</strong>_Daly\, where it is also available in PDF format.<br />

6.1.3 Importing, scaling, rotating with the graphicx package<br />

Package: If one selects the graphicx rather than the graphics package, a different<br />

graphicx interface is available for both importing <strong>and</strong> rotation, one making use of<br />

keys <strong>and</strong> values:<br />

\includegraphics[key=value,. . . ]{file name}<br />

The keys are of two types: those that take a numerical value, <strong>and</strong> those<br />

that are flags with the values true or false. Simply giving the name of a<br />

flag without a value is equivalent <strong>to</strong> setting it <strong>to</strong> true. Possible keys <strong>and</strong><br />

their values are:<br />

scale= number; enters the number by which the figure size should be<br />

magnified over its natural size;<br />

width= length; specifies the width <strong>to</strong> which the figure should be scaled;<br />

if height not given, it is scaled with the same fac<strong>to</strong>r as the width;<br />

height= length; specifies the height <strong>to</strong> which the figure should be scaled;<br />

if width is not given, it is scaled with the same fac<strong>to</strong>r as the height;<br />

<strong>to</strong>talheight= length; like height but specifies the height plus depth of<br />

the figure; should always be used in place of height if the figure<br />

has been rotated;<br />

keepaspectratio (=true|false); if both height <strong>and</strong> width are specified,<br />

this flag ensures that the original height/width ratio remains<br />

unchanged; the figure will not exceed either of the given dimensions;

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

Saved successfully!

Ooh no, something went wrong!