Академический Документы
Профессиональный Документы
Культура Документы
UR AERONOMIE
D37191 Katlenburg-Lindau, Federal Republic of Germany
Graphics and Colour with L
A
T
E
X
Patrick W. Daly
1998 June 4
[This document is also available in PostScript and HTML form.]
Contents
1 Introduction 2
2 Importing external graphics 2
2.1 Importing with the graphics package . . . . . . . . . . . . . . . . . . . . 3
2.2 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Reection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.5 Importing, scaling, rotating with the graphicx package . . . . . . . . . . 4
3 Additional graphics packages 6
3.1 The epsfig package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 The lscape package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 The rotating package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Troubleshooting 7
4.1 How importation works . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 Problems with importation . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 Conguring graphics importation 9
5.1 Default driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Search path for graphics les . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3 Default extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.4 Graphics types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5 Compressing graphics les . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
1 INTRODUCTION 2
6 Colours 10
7 The named colour model 12
1 Introduction
The advent of PostScript drivers for T
E
X has oered the opportunity to expand the
capabilities of L
A
T
E
X to include a number of very useful features, such as the importa-
tion, scaling, and rotation of external graphics les, and colour. However, since each
driver tended to have its own packages and user interface commands, the resulting L
A
T
E
X
document les threatened to become tied to one particular driver.
With L
A
T
E
X2
.
One wants to do by computer what used to be done with scissors and glue.
There are two packages available for importing and manipulating external graphics
les: the more basic graphics and the more extended graphicx. They both have iden-
tical functionality, diering only in syntax.
In addition to the driver names, there are some other options that may be invoked
when the packages graphics or graphicx are loaded:
draft does not import but places a framed box where the graphic would appear, with
the le name printed inside; this speeds up the processing considerably when one
is only working on the text;
final counteracts draft; needed when the draft option has been issued globally in
\documentclass;
hidescale
leaves blank space where scaled text should be;
hiderotate
leaves blank space where rotated text should be; this and the option hidescale
are useful if the previewer cannot handle scaling or rotation;
2 IMPORTING EXTERNAL GRAPHICS 3
hiresbb
look for bounding box values in %%HiResBoundingBox instead of the the normal
%%BoundingBox line.
2.1 Importing with the graphics package
The basic importing command with the graphics package is
\includegraphics[llx,lly][urx,ury]{le name}
where llx, lly are the coordinates of the lower left corner, and urx, ury those of the upper
right corner of the bounding box containing the part of the picture that is to be included.
In other words, they say where the scissors are to be applied. Units may be specied (like
[3cm, 2in]) but if they are omitted, big points (bp, 72 per inch, 28.3464. . . per cm) are
assumed. If only one optional argument is given, it is the upper right corner, and the
lower left is assumed to be [0,0].
If no bounding box coordinates are given, the driver will obtain them
some other way, depending on the type of graphics le. For example, for
the very common encapsulated PostScript les with extension .eps, the
bounding box information is extracted from the graphics le itself. The
gure at the right is stored in such a le and is included simply with the
command
\includegraphics{clock.eps}
With \includegraphics*, the gure is clipped, so that any drawing outside the
specied bounding box is suppressed. This is useful if only part of a gure is to be
reproduced. It is also vital with some perverse gures that paint the whole page white!
2.2 Scaling
The graphics le in the above commands is transferred to the document in its original
size. In order to rescale it, there are two commands available:
\scalebox{h scale}[v scale]{text}
which applies horizontal and vertical scale factors to the contents text; if v scale is omit-
ted, it is the same as h scale;
\resizebox{h length}{v length}{text}
adjusts the gure to t into the specied horizontal and vertical sizes; if either length is
given as !, the one scale factor is used for both dimensions. A *-form allows v length to
refer to the height + depth of the box, rather than just to the height. In both cases, the
contents text may be an \includegraphics command, but it may also be any arbitrary
text.
2 IMPORTING EXTERNAL GRAPHICS 4
2.3 Reection
The contents of a box may be reected horizontally with
\reflectbox{text}
2.4 Rotation
Rotation of a box about the left-hand end of its baseline is done with
\rotatebox{angle}{text}
where angle is in degrees, and the rotation is counterclockwise.
To illustrate this, we have scaled the previous clock gure to a
height of 2 cm and then rotated it by 30