The graphicx package^{∗}

D. P. Carlisle  S. P. Q. Rahtz

1997/06/09

1 Introduction

This package provides an alternative interface to the L^{A}TEX 2ε graphics functions. The command names provided are the same as in the standard package, and they use the same internal functions. However the meaning of the optional arguments is different. Note only the optional arguments have changed: any document which only uses the graphics commands with the mandatory arguments and/or the starforms will work identically (with essentially identical implementation) with the two packages.

2 Key=Value Interface

When the decision to produce L^{A}TEX 2ε was made, certain ‘guiding principles’ were made (and published in the original announcement). One of these was that all new features would ‘conform to the conventions of version 2.09’. Specifically this meant that new commands would obey the same basic syntax rules for arguments as the existing commands.

Standard L^{A}TEX optional arguments are positional. If a command were to take three optional arguments, then there would be no way of specifying only the third, one would have to give all three, even if the first two were repeats of the default values. Basically this means that ‘standard’ optional arguments are not suitable if there is more than one option. Various existing packages (for L^{A}TEX 2.09) have recognised this, and used ‘named arguments’ in various forms. Perhaps the two most noticeable are psfig and pstricks. With ‘named arguments’ (sometimes called ‘attributes’) each option is not tied to a particular position, but rather given a name (or key) and any options that must be set are set by explicitly associating this name with the desired value.

The members of the L^{A}TEX3 project do appreciate the importance of this kind of syntax, but felt that rather than extending the syntax of L^{A}TEX in an uncoordinated way, it would be better to keep with ‘standard arguments’ in L^{A}TEX 2ε, which is intended as a ‘consolidation of existing L^{A}TEX variants’. The long term planning for an eventual L^{A}TEX3 release will then be able to consider the whole L^{A}TEX user interface, and a suitable syntax for named arguments. It is important that such an interface design is not hampered by having to retain compatibility with earlier attempts at a named argument syntax. For this reason this graphicx package, which uses the named argument mechanism from the keyval package should be considered ‘non standard’ although it is supported by the same mechanism, and same authors as the ‘standard’ graphics package.

∗This file has version number v1.0d, last revised 1997/06/09.

3 The User Interface

\includegraphics *[⟨key-val list⟩]{⟨file⟩}
\includegraphics *[⟨llx,lly⟩][⟨urx,ury⟩]{⟨file⟩}

Include a graphics file.

The star form is just for compatibility with the standard interface, and essentially just adds clip to the keys specified. Similarly the second, two-optional argument form is for increased compatibility with the standard package. The two optional argument form is not needed in the keyval interface.

Various ‘keys’ or named arguments are supported.

bb Set the bounding box. The argument should be four dimensions, separated by spaces.

bbllx,bblly,bburx,bbury Set the bounding box. Mainly for compatibility with older packages. bbllx=a,bblly=b,bburx=c,bbury=d is equivalent to

     bb = a b c d.

natwidth,natheight Again an alternative to bb. natheight=h,natwidth=w is equivalent to bb = 0 0 h w.

viewport Modify the bounding box specified in the file. The four values specify a bounding box relative to the llx,lly coordinate of the original box.

trim Modify the bounding box specified in the file. The four values specify the amounts to remove from the left, bottom, right and top of the original box.

hiresbb Boolean valued key. Defaults to true. Causes TEX to look for

     %%HiResBoundingBox comments rather than the standard %%BoundingBox.

May be set to false to override a default setting of true specified by the hiresbb package option.

angle Rotation angle.

origin Rotation origin (see \rotatebox, below).

width Required width, a dimension (default units bp). The graphic will be scaled to make the width the specified dimension.

height Required height. a dimension (default units bp). totalheight Required totalheight (ie height + depth). a dimension (default units

bp). Most useful after a rotation (when the height might be zero).

keepaspectratio Boolean valued key (like clip). If it is set to true, modify the meaning of the width and height (and totalheight) keys such that if both are specified then rather than distort the figure the figure is scaled such that neither dimension exceeds the stated dimensions.

scale Scale factor.

clip Either ‘true’ or ‘false’ (or no value, which is equivalent to ‘true’). Clip the graphic to the bounding box (or viewport if one is specified).

draft a boolean valued key, like ‘clip’. locally switches to draft mode, ie. do not include the graphic, but leave the correct space, and print the filename.

type Specify the file type. (Normally determined from the file extension.)

ext Specify the file extension. Only for use with type.

read Specify the ‘read file’ which is used for determining the size of the graphic. Only for use with type.

command Specify the file command. Only for use with type.

The arguments are interpreted left to right. clip, draft, bb,, and bbllx etc. have the same effect wherever they appear. but the scaling and rotation keys interact.

Any scaling that is specified before rotation, is handled by the internal graphics inclusion function. Rotation, or any later scaling is handled by implicitly calling

\rotatebox or \scalebox. So [height=1in,angle=90] scales the graphic to 1in,

then rotates it, so it is one inch wide. [angle=90,height=1in] first rotates, then scales the result so that it is 1in high. A driver that can scale included graphics, but not arbitrary text will not be able to support the second form, as it will require a call to \scalebox, but the first form should work as there the scaling is handled

by \Ginclude@graphics.

\rotatebox [⟨key-val list⟩]{⟨angle⟩}{⟨text⟩}

Rotate text.

The keys supported by \rotatebox are:

origin Specify the centre of rotation. origin=⟨label⟩, where the labels are up to two of lrctbB (B denotes the baseline, as for PSTricks).

x,y An alternative to origin. x=⟨dimen⟩,y=⟨dimen⟩ The x, y coordinate of the centre of rotation. As usual \height etc may be used.

units Specify the units used in the main argument. eg units=-360 would mean that the argument refered to degrees clockwise instead of the default anticlockwise rotation.

As an example \rotatebox[origin=c]{180}{text} will rotate “text” around its centre, thus creating a final box of the same dimensions as the original box. This is to be contrasted to the default behaviour, which rotates around the reference point on the baseline, thus producing a box that is mainly below the baseline.

4 Implementation

1 ⟨∗package⟩

All the options are handled by the graphics package.

 2 \DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}}
 3 \ProcessOptions

This package requires these two building blocks.

 4 \RequirePackage{keyval,graphics}

4.1 Graphics Inclusion

First we declare the ‘bounding box’ keys. These all use \Gin@defaultbp so that the ⟨value⟩ can be given as a length in the usual TEX units such as cm or as an integer, taken as bp.

\KV@Gin@bb
 5 \define@key{Gin}{bb}
 6  {\Gin@bboxtrue\Gread@parse@bb#1 \\}
\KV@Gin@bbllx
\KV@Gin@bblly
\KV@Gin@bburx
\KV@Gin@bbury

 7 \define@key{Gin}{bbllx}
 8  {\Gin@bboxtrue\Gin@defaultbp\Gin@llx{#1}}
 9 \define@key{Gin}{bblly}
10  {\Gin@bboxtrue\Gin@defaultbp\Gin@lly{#1}}
11 \define@key{Gin}{bburx}
12  {\Gin@bboxtrue\Gin@defaultbp\Gin@urx{#1}}
13 \define@key{Gin}{bbury}
14  {\Gin@bboxtrue\Gin@defaultbp\Gin@ury{#1}}

\KV@Gin@hiresbb If set to true (the default) TEX will look for bounding box comments of the form %%HiResBoundingBox (which typically have real values) instead of the standard %%BoundingBox (which should have integer values). It may be set to false to override a package option of hiresbb.

15 \define@key{Gin}{hiresbb}[true]{%
16 \edef\Gread@BBox{%
17  \@percentchar\@percentchar
18  \csname if#1\endcsname HiRes\fi
19  BoundingBox}}
\KV@Gin@natheight
\KV@Gin@natheight
20 \let\KV@Gin@natwidth\KV@Gin@bburx
21 \let\KV@Gin@natheight\KV@Gin@bbury

\KV@Gin@viewport \KV@Gin@trim A ‘viewport’ is a user-specified area of the graphic to be included. It should not be confused with the ‘Bounding Box’ of a PS file. In fact, the origin for a viewport specification is the (llx,lly) lower left coordinate of the bounding box. If a viewport is specified, and clipping is turned on, clipping is based on the viewport, not on the boundingbox.

Both ‘viewport’ and ‘trim’ were suggested (and originally, but differently, implemented) by Arthur Ogawa.

22 \define@key{Gin}{viewport}
23  {\let\Gin@viewport@code\Gin@viewport\Gread@parse@vp#1 \\}
24 \define@key{Gin}{trim}
25  {\let\Gin@viewport@code\Gin@trim\Gread@parse@vp#1 \\}

\Gread@parse@vp Grabs four bounding box values like \Gread@parse@bp but saves them in alternative macros that are used in the viewport and trim cases to modify the bounding box read from the file.

26 \def\Gread@parse@vp#1 #2 #3 #4 #5\\{%
27 \Gin@defaultbp\Gin@vllx{#1}%
28 \Gin@defaultbp\Gin@vlly{#2}%
29 \Gin@defaultbp\Gin@vurx{#3}%
30 \Gin@defaultbp\Gin@vury{#4}}%

\Gin@viewport If a viewport is specified, reset the bounding box cordinates by adding the original origin, \Gin@llx, \Gin@lly to the new values specified as the viewport. The original Bounding box coordinates are saved in \Gin@ollx… some drivers might need this information (currently just tcidvi).

31 \def\Gin@viewport{%
32 \let\Gin@ollx\Gin@llx
33 \let\Gin@olly\Gin@lly
34 \let\Gin@ourx\Gin@urx
35 \let\Gin@oury\Gin@ury
36 \dimen@\Gin@llx\p@\advance\dimen@ \Gin@vurx\p@
37  \edef\Gin@urx{\strip@pt\dimen@}%
38 \dimen@\Gin@lly\p@\advance\dimen@ \Gin@vury\p@
39  \edef\Gin@ury{\strip@pt\dimen@}%
40 \dimen@\Gin@llx\p@\advance\dimen@ \Gin@vllx\p@
41  \edef\Gin@llx{\strip@pt\dimen@}%
42 \dimen@\Gin@lly\p@\advance\dimen@ \Gin@vlly\p@
43  \edef\Gin@lly{\strip@pt\dimen@}}

\Gin@trim If a trim is specified, reset the bounding box cordinates by trimming the four specified values off each side of the graphic.

44 \def\Gin@trim{%
45 \let\Gin@ollx\Gin@llx
46 \let\Gin@olly\Gin@lly
47 \let\Gin@ourx\Gin@urx
48 \let\Gin@oury\Gin@ury
49 \dimen@\Gin@llx\p@\advance\dimen@ \Gin@vllx\p@
50  \edef\Gin@llx{\strip@pt\dimen@}%

51 \dimen@\Gin@lly\p@\advance\dimen@ \Gin@vlly\p@
52  \edef\Gin@lly{\strip@pt\dimen@}%
53 \dimen@\Gin@urx\p@\advance\dimen@ -\Gin@vurx\p@
54  \edef\Gin@urx{\strip@pt\dimen@}%
55 \dimen@\Gin@ury\p@\advance\dimen@ -\Gin@vury\p@
56  \edef\Gin@ury{\strip@pt\dimen@}}

\Gin@vllx \Gin@vlly \Gin@vurx \Gin@vury Four macros to hold the modifiers for the bounding box for viewport and trim specifications.

57 \let\Gin@vllx\Gin@llx\let\Gin@vlly\Gin@llx
58 \let\Gin@vurx\Gin@llx\let\Gin@vury\Gin@llx

\KV@Gin@angle Specify a rotation. This is just handled by wrapping the \includegraphics command in a call to the internal version of \rotatebox. Normally this is the ‘standard’ version but if an origin key is used in \includegraphics then the keyval version of origin is used, and the origin key is passed on.

59 \define@key{Gin}{angle}
60  {\Gin@esetsize
61  \@tempswatrue
62  \edef\@tempa{\toks@{\noexpand\Gin@erotate{#1}{\the\toks@}}}%
63  \@tempa}

\KV@Gin@origin Pass the origin key value on to \rotatebox. \Gin@erotate is initialised to \Grot@box@std later in the file, after the latter has been defined.

64 \define@key{Gin}{origin}[c]{%
65 \def\Gin@erotate{\Grot@box@kv[origin=#1]}}

\KV@Gin@width \KV@Gin@height Save the required height and width. The actual scaling is done later.

66 \define@key{Gin}{width}{\def\Gin@ewidth{#1}}
67 \define@key{Gin}{height}{\def\Gin@eheight{#1}}
\KV@Gin@totalheight The same as height key, but locally changes \Gin@eresize to \totalheight

from its default value of \height.

68 \define@key{Gin}{totalheight}{%
69 \def\Gin@eresize{\totalheight}\def\Gin@eheight{#1}}

\KV@Gin@keepaspectratio Boolean valued key (like clip). If it is set to true, modify the meaning of the width and height (and totalheight) keys such that if both are specified then rather than distort the figure the figure is scaled such that neither dimension exceeds the stated dimensions.

70 \define@key{Gin}{keepaspectratio}[true]{%
71 \lowercase{\Gin@boolkey{#1}}{iso}}

\KV@Gin@scale If the scaling is being handled externally, wrap \includegraphics in the internal form of \scalebox, otherwise locally define \Gin@req@sizes to calculate the required sizes based on scale factor.

72 \define@key{Gin}{scale}{%
73 \if@tempswa

74  \edef\@tempa{\toks@{\noexpand\Gscale@box{#1}[#1]{\the\toks@}}}%
75  \@tempa
76 \else
77  \def\Gin@req@sizes{%
78  \def\Gin@scalex{#1}\let\Gin@scaley\Gin@exclamation
79  \Gin@req@height\Gin@scalex\Gin@nat@height
80  \Gin@req@width\Gin@scalex\Gin@nat@width}%
81 \fi
82 \@tempswatrue}

\KV@Gin@draft Locally set the draft switch to true. This is used by the code in graphics package to suppress the file inclusion.

83 \define@key{Gin}{draft}[true]{%
84 \lowercase{\Gin@boolkey{#1}}{draft}}

\KV@Gin@clip Locally set the clip switch to true. This is used by the code in graphics package to suppress the printing of anything outside the bounding box specified.

85 \define@key{Gin}{clip}[true]{%
86 \lowercase{\Gin@boolkey{#1}}{clip}}

\KV@Gin@type If you use ‘type’ you must use no extension in the main argument and you must use ‘ext’. You can also use ‘read’ and ‘command’.

87 \define@key{Gin}{type}{%
88 \def\Ginclude@graphics##1{%
89  \begingroup
90  \def\Gin@base{##1}%
91  \edef\@tempa{{#1}{\Gin@eread}{\Gin@ecom{##1\Gin@eext}}}%
92  \expandafter\Gin@setfile\@tempa
93  \endgroup}}

\KV@Gin@ext Specify an extension, for use with the ‘type’ key.

94 \define@key{Gin}{ext}{\def\Gin@eext{#1}}
95 \let\Gin@eext\@empty

\KV@Gin@read Specify a read file, for use with the ‘type’ key. You may want to globally set this to * using \setkeys. * means read the graphic file for size info, as in

\DeclareGraphicsRule.
96 \define@key{Gin}{read}{%
97 \def\Gin@eread{#1}%
98 \def\@tempa{*}\ifx\@tempa\Gin@eread\def\Gin@eread{\Gin@eext}\fi}
99 \let\Gin@eread\@empty

\KV@Gin@command Specify a command, for use with the ‘type’ key.

100 \define@key{Gin}{command}{\def\Gin@ecom##1{#1}}
101 \let\Gin@ecom\@firstofone

\Gin@boolkey Helper function for defining boolean valued functions. The order of arguments allows \lowercase to only act on the user-supplied argument.

102 \def\Gin@boolkey#1#2{%
103 \csname Gin@#2\ifx\relax#1\relax true\else#1\fi\endcsname}

\Gin@esetsize Arrange for the final size to be set, either by wrapping the include graphics call in \scalebox, or by redefining \Gin@req@sizes appropriately.

104 \def\Gin@eresize{\height}
105 \def\Gin@esetsize{%
106 \let\@tempa\Gin@exclamation
107 \if@tempswa

External. Wrap the \includegraphics command in a call to the internal form of \scalebox to handle the rotation.

108  \edef\@tempa{\toks@{\noexpand
109  \Gscale@@box\noexpand\Gin@eresize
110  {\Gin@ewidth}{\Gin@eheight}{\the\toks@}}}%
111  \@tempa
112 \else

Internal. Handle scaling with the \includegraphics command directly rather than calling \scalebox.

113  \ifx\Gin@ewidth\@tempa
114  \ifx\Gin@eheight\@tempa

No resizing.

115  \else

Just height specified.

116  \let\Gin@@eheight\Gin@eheight
117  \def\Gin@req@sizes{%
118  \Gscale@div\Gin@scaley\Gin@@eheight\Gin@nat@height
119  \let\Gin@scalex\Gin@exclamation
120  \setlength\Gin@req@height\Gin@@eheight
121  \Gin@req@width\Gin@scaley\Gin@nat@width}%
122  \fi
123  \else
124  \ifx\Gin@eheight\@tempa

Just width specified.

125  \let\Gin@@ewidth\Gin@ewidth
126  \def\Gin@req@sizes{%
127  \Gscale@div\Gin@scalex\Gin@@ewidth\Gin@nat@width
128  \let\Gin@scaley\Gin@exclamation
129  \setlength\Gin@req@width\Gin@@ewidth
130  \Gin@req@height\Gin@scalex\Gin@nat@height}%
131  \else

Both height and width specified.

132  \let\Gin@@ewidth\Gin@ewidth
133  \let\Gin@@eheight\Gin@eheight

At this point can locally redefine \Gin@nosize. Instead of generating an error, just set the ‘natural’ size to be the ‘requested size’. Previous versions of this package did not allow the use of height and width unless the natural size was known as otherwise L^{A}TEX can not calculate the scale factor. However many drivers (especially for bitmap formats) can work this out themselves, so as long as both height and width are given, so L^{A}TEX knows the size to leave, accept this. This assumes the code in the driver file will use the ‘required height’ information, not the scale factors, which will be set to 1!.

134  \def\Gin@nosize##1{%
135  \KV@Gin@natwidth\Gin@@ewidth
136  \KV@Gin@natheight\Gin@@eheight}%
137  \def\Gin@req@sizes{%
138  \Gscale@div\Gin@scalex\Gin@@ewidth\Gin@nat@width
139  \Gscale@div\Gin@scaley\Gin@@eheight\Gin@nat@height

Donald Arseneau requested this feature. If both height and width are chosen, choose the smaller scale factor rather than distort the graphic. This mode is turned on with the keepaspectratio key.

140  \ifGin@iso
141  \ifdim\Gin@scaley\p@>\Gin@scalex\p@
142  \let\Gin@scaley\Gin@scalex
143  \else
144  \let\Gin@scalex\Gin@scaley
145  \fi
146  \fi
147  \Gin@req@width\Gin@scalex\Gin@nat@width
148  \Gin@req@height\Gin@scaley\Gin@nat@height}%
149  \fi
150  \fi
151 \fi
152 \let\Gin@ewidth\Gin@exclamation
153 \let\Gin@eheight\Gin@ewidth}
\Gin@req@height \Gin@req@width The required final size.
154 \newdimen\Gin@req@height
155 \newdimen\Gin@req@width
\Gin@outer@scalex \Gin@outer@scaley Scale factors to pass to \scalebox.
156 \let\Gin@outer@scalex\relax
157 \let\Gin@outer@scaley\relax

\Gin@angle Rotation angle.

158 \let\Gin@angle\relax

\Gin@ewidth \Gin@eheight Final size, initialised for no scaling.

159 \let\Gin@ewidth\Gin@exclamation
160 \let\Gin@eheight\Gin@ewidth

\Gin@scalex \Gin@scaley Scale factors. Initialised for no scaling.

161 \def\Gin@scalex{1}
162 \let\Gin@scaley\Gin@exclamation

\Gin@i Use the same top level \includegraphics command as the standard interface. This will set the clipping switch, and then call \Gin@i.

163 \def\Gin@i{%
164 \def\Gin@req@sizes{%
165 \Gin@req@height\Gin@nat@height
166 \Gin@req@width\Gin@nat@width}%
167 \@ifnextchar[\Gin@ii{\Gin@ii[]}}

\Gin@ii Look for a second optional argument. If one optional argument is present, call \setkeys to process it,

168 \def\Gin@ii[#1]#2{%
169  \def\@tempa{[}\def\@tempb{#2}%
170  \ifx\@tempa\@tempb
171  \def\@tempa{\Gin@iii[#1][}%
172  \expandafter\@tempa
173  \else
174  \begingroup
175  \@tempswafalse
176  \toks@{\Ginclude@graphics{#2}}%
177  \setkeys{Gin}{#1}%
178  \Gin@esetsize
179  \the\toks@
180  \endgroup
181  \fi}

5 Rotation

\rotatebox Look for an optional argument.

182 \def\rotatebox{%
183 \@ifnextchar[\Grot@box@kv\Grot@box@std}

\Grot@box@std If no KV argument, just repeat the standard definition.

184 \def\Grot@box@std#1#2{%
185 \Grot@setangle{#1}%
186 \setbox\z@\hbox{{#2}}%
187 \Grot@x\z@
188 \Grot@y\z@
189 \Grot@box}
\Grot@box@kv
190 \def\Grot@box@kv[#1]#2#3{%
191 \@begin@tempboxa\hbox{#3}%
192  \Grot@x\width \divide\Grot@x\tw@
193  \Grot@y\height \advance\Grot@y-\depth \divide\Grot@y\tw@
194  \setkeys{Grot}{#1}%
195  \setbox\z@\box\@tempboxa
196  \Grot@setangle{#2}%

197  \Grot@box
198 \@end@tempboxa}

There are two ways of specifying the centre of rotation.

\KV@Grot@origin origin=⟨label⟩, where the labels are up to two of lrctbB (B denotes the baseline, as for PSTricks).

199 \define@key{Grot}{origin}[c]{%
200 \@tfor\@tempa:=#1\do{%
201  \if l\@tempa \Grot@x\z@\else
202  \if r\@tempa \Grot@x\width\else
203  \if t\@tempa \Grot@y\height\else
204  \if b\@tempa \Grot@y-\depth\else
205  \if B\@tempa \Grot@y\z@\fi\fi\fi\fi\fi}}

\KV@Grot@x \KV@Grot@y x=⟨dimen⟩,y=⟨dimen⟩ The x, y coordinate of the centre of rotation. As usual \height etc may be used.

206 \define@key{Grot}{x}{\setlength\Grot@x{#1}}
207 \define@key{Grot}{y}{\setlength\Grot@y{#1}}

\KV@Grot@units ‘units’ specifies the number or units in one anti-clockwise circle. So the default is 360. −360 gives clockwise rotation, 6.283185 gives radians etc.

208 \define@key{Grot}{units}{%
209 \def\Grot@setangle##1{%
210 \dimen@##1\p@
211 \dimen@ii#1\p@
212 \divide\dimen@ii360\relax
213 \divide\dimen@\dimen@ii
214 \edef\Grot@angle{\number\dimen@}}}

\Gin@erotate Initialise the rotation command to use in \includegraphics.

215 \let\Gin@erotate\Grot@box@std

216 ⟨/package⟩

Change History

v0.3

General: First DPC version (after

prototype by SPQR). . . . . . . . 1 v0.3b

\KV@Gin@bbury: add natheight and natwidth . . . . . . . . . . . . . . . . 4 use bbllx not llx . . . . . . . . . . . . 4 \rotatebox: Remove star form . . 10

v0.3c \Gin@i: Always call \Gin@ii … 10

Dont  locally  initialise

width/height . . . . . . . . . . . . 10 v0.4a

\Gin@boolkey: Make ‘empty’=true

so clip= works . . . . . . . . . . . . 7 v0.4b

General: Remove incorrect initialisation of \Gin@scalex . . . . . . 10 Rename from egraphics. 8+3 name for CDROM . . . . . . . . . 1 v0.4c

\Gin@i: Use ‘standard’ version if

two opt. args. . . . . . . . . . . . . 10 v0.5a

\KV@Gin@read: Add default * possi-

bility. . . . . . . . . . . . . . . . . . . . 7

   \KV@Gin@type: remove \Gin@sep . 7

v0.6a

   \KV@Gin@bbury: New \Gin@defaultbb

code . . . . . . . . . . . . . . . . . . . . 4

   \KV@Gin@totalheight: New total-

height key . . . . . . . . . . . . . . . 6 \KV@Gin@trim: viewport and trim

keys added . . . . . . . . . . . . . . . 5 v0.6b

   \KV@Gin@bbury: typos fixed for

graphics/1685 . . . . . . . . . . . . . 4 v0.6c

\KV@Gin@trim: arithmetic in view-

port key fixed . . . . . . . . . . . . . 5 v0.6d

   \KV@Gin@natheight: typos fixed in

natheight and natwidth keys . . 4 v0.6e

\Gin@erotate: macro added …. 11

   \Gin@esetsize: Use \setlength to

support calc package . . . . . . . . 8

   \KV@Gin@keepaspectratio: key

added . . . . . . . . . . . . . . . . . . . 6 \KV@Gin@origin: key added . . . . . 6 v0.6f

                                          \Gin@esetsize: Use \ifGin@iso to

support isoscale key . . . . . . . . 9 v0.6g

                                          \Gin@esetsize: Use \ifGin@iso to

support isoscale key . . . . . . . . 8 v0.6h

                                          \Gin@esetsize: Use \Gin@exclamation

. . . . . . . . . . . . . . . . . . . . . . . . 8

                                          \Gin@ewidth: Use \Gin@exclamation

. . . . . . . . . . . . . . . . . . . . . . . . 9

                                          \Gin@scaley: Use \Gin@exclamation

. . . . . . . . . . . . . . . . . . . . . . . . 9

                                          \KV@Gin@keepaspectratio: Name

changed to keepaspectratio … 6

                                          \KV@Gin@scale: Use \Gin@exclamation

. . . . . . . . . . . . . . . . . . . . . . . . 6 v1.0

General: Version 1 at last . . . . . . . 1 v1.0a

\Gin@esetsize: Missing percent

added for graphics/2244 . . . . . 9 v1.0b

                                          \KV@Gin@hiresbb: hiresbb key

added . . . . . . . . . . . . . . . . . . . 4 v1.0c

\Gin@trim: Original bb saved …. 5 \Gin@viewport: Original bb saved 5

v1.0d

\KV@Gin@ext: initialise ext to empty . . . . . . . . . . . . . . . . . . 7

Index

Numbers written in italic refer to the page where the corresponding entry is described, the ones underlined to the code line of the definition, the rest to the code lines where the entry is used.

Symbols

\@begin@tempboxa . . 191

\@empty . . . . . . . . 95, 99

\@end@tempboxa . . . . 198
\@firstofone . . . . . . 101
\@ifnextchar . . 167, 183
\@percentchar . . . . . 17

\@tempa . . 62, 63, 74, 75, 91, 92, 98, 106, 108, 111, 113, 114, 124, 169–172, 200–205

\@tempb . . . . . . 169, 170

                          \@tempboxa . . . . . . . 195
                          \@tempswafalse . . . . 175
                          \@tempswatrue . . . 61, 82

\@tfor . . . . . . . . . . . 200

\\ . . . . . . . 6, 23, 25, 26

A \advance 36, 38, 40, 42,

49, 51, 53, 55, 193

B

                                                   \begingroup . . . . 89, 174

\box . . . . . . . . . . . . . 195

C \csname . . . . . . . 18, 103

                                                   \CurrentOption . . . . . 2

\DeclareOption . . . . . 2

\def . . . . . 26, 31, 44, 65–67, 69, 77, 78, 88, 90, 94, 97, 98, 100, 102, 104, 105, 117, 126, 134, 137, 161, 163, 164, 168, 169, 171, 182, 184, 190, 209

\define@key . . . 5, 7,

9, 11, 13, 15, 22, 24, 59, 64, 66– 68, 70, 72, 83, 85, 87, 94, 96, 100, 199, 206–208

\depth . . . . . . . 193, 204 \dimen@ . . . . . 36–43,

49–56, 210, 213, 214 \dimen@ii …. 211–213 \divide 192, 193, 212, 213 \do . . . . . . . . . . . . . 200

E

\edef 16, 37, 39, 41, 43, 50, 52, 54, 56, 62, 74, 91, 108, 214

\else . . 76, 103, 112, 115, 123, 131, 143, 173, 201–204

\endcsname . . . . 18, 103

\endgroup . . . . . 93, 180

\expandafter . . . 92, 172

F

\fi . 18, 81, 98, 103, 122, 145, 146, 149–151, 181, 205

G

\Gin@@eheight . . . . .

…. 116, 118, 120, 133, 136, 139

\Gin@@ewidth 125, 127,

129, 132, 135, 138

\Gin@angle . . . . . . . \underline{158}

\Gin@base . . . . . . . . 90

\Gin@bboxtrue . . . . .

… 6, 8, 10, 12, 14

\Gin@boolkey . . . . . .

… 71, 84, 86, \underline{102}

\Gin@defaultbp . . 8,

10, 12, 14, 27–30 \Gin@ecom . 91, 100, 101 \Gin@eext 91, 94, 95, 98

\Gin@eheight . 67, 69,

110, 114, 116, 124, 133, 153, \underline{159}

\Gin@eread . . 91, 97–99
\Gin@eresize 69, 104, 109
\Gin@erotate 62, 65, \underline{215}
\Gin@esetsize . . . . .

. . . . . 60, \underline{104}, 178

\Gin@ewidth . . . . 66,

110, 113, 125, 132, 152, 153, \underline{159}

\Gin@exclamation . .

. . 78, 106, 119, 128, 152, 159, 162

\Gin@i . . . . . . . . . . . \underline{163} \Gin@ii . . . . . . 167, \underline{168} \Gin@iii . . . . . . . . . 171 \Gin@llx . . . . . . . . .

8, 32, 36, 40, 41, 45, 49, 50, 57, 58

\Gin@lly . 10, 33, 38,

42, 43, 46, 51, 52

\Gin@nat@height . . .

. . . . . 79, 118, 130, 139, 148, 165

\Gin@nat@width . . . .

. . . . . 80, 121, 127, 138, 147, 166

\Gin@nosize . . . . . . . 134

\Gin@ollx . . . . . . 32, 45 \Gin@olly . . . . . . 33, 46 \Gin@ourx . . . . . . 34, 47 \Gin@oury . . . . . . 35, 48

\Gin@outer@scalex . \underline{156}
\Gin@outer@scaley . \underline{156}
\Gin@req@height . . .

. . . . . 79, 120, 130, 148, \underline{154}, 165

\Gin@req@sizes . 77,

117, 126, 137, 164

\Gin@req@width . . . .

. . . . . 80, 121, 129, 147, \underline{154}, 166

\Gin@scalex . . . . . . .

78–80, 119, 127, 130, 138, 141, 142, 144, 147, \underline{161}

\Gin@scaley . . . . . . .

. . 78, 118, 121, 128, 139, 141, 142, 144, 148, \underline{161}

\Gin@setfile . . . . . . 92

\Gin@trim . . . . . . 25, \underline{44} \Gin@urx . . . . . . 12,

34, 37, 47, 53, 54 \Gin@ury . . . . . . 14,

35, 39, 48, 55, 56

\Gin@viewport . . . 23, \underline{31}
\Gin@viewport@code .

. . . . . . . . . 23, 25 \Gin@vllx 27, 40, 49, \underline{57} \Gin@vlly 28, 42, 51, \underline{57} \Gin@vurx 29, 36, 53, \underline{57} \Gin@vury 30, 38, 55, \underline{57}

\Ginclude@graphics .

. . . . . . . . 88, 176

\Gread@BBox . . . . . . . 16
\Gread@parse@bb . . . . 6
\Gread@parse@vp . . .

. . . . . . . 23, 25, \underline{26}

\Grot@angle . . . . . . . 214

\Grot@box …. 189, 197

\Grot@box@kv 65, 183, \underline{190}
\Grot@box@std . . . . .

…. 183, \underline{184}, 215

\Grot@setangle . . . .

…. 185, 196, 209 \Grot@x . . . . . . 187,

192, 201, 202, 206 \Grot@y . . . . . . 188,

193, 203–205, 207

\Gscale@@box . . . . . . 109
\Gscale@box . . . . . . . 74
\Gscale@div . . . . . . .

. 118, 127, 138, 139

H

\hbox . . . . . . . . 186, 191 \height … 104, 193, 203

I

\if . . . . . . . . . 201–205

\if@tempswa . . . . 73, 107

\ifdim . . . . . . . . . . . 141

\ifGin@iso . . . . . . . 140

\ifx . . . . . . . 98, 103, 113, 114, 124, 170

K

\KV@Gin@angle . . . . . \underline{59}
\KV@Gin@bb . . . . . . . . \underline{5}
\KV@Gin@bbllx . . . . . . \underline{7}
\KV@Gin@bblly . . . . . . \underline{7}
\KV@Gin@bburx . . . . \underline{7}, 20
\KV@Gin@bbury . . . . \underline{7}, 21
\KV@Gin@clip . . . . . . \underline{85}
\KV@Gin@command . . . \underline{100}
\KV@Gin@draft . . . . . \underline{83}
\KV@Gin@ext . . . . . . . \underline{94}
\KV@Gin@height . . . . \underline{66}
\KV@Gin@hiresbb . . . \underline{15}
\KV@Gin@keepaspectratio

. . . . . . . . . . . . \underline{70}

\KV@Gin@natheight .

. . . . . . \underline{20}, 21, 136

\KV@Gin@natwidth 20, 135
\KV@Gin@origin . . . . \underline{64}
\KV@Gin@read . . . . . . \underline{96}
\KV@Gin@scale . . . . . \underline{72}
\KV@Gin@totalheight   \underline{68}
\KV@Gin@trim . . . . . . \underline{22}

                          \KV@Gin@type . . . . . . \underline{87}
                          \KV@Gin@viewport . . \underline{22}
                          \KV@Gin@width . . . . . \underline{66}
                          \KV@Grot@origin . . . \underline{199}
                          \KV@Grot@units . . . . \underline{208}
                          \KV@Grot@x . . . . . . . \underline{206}
                          \KV@Grot@y . . . . . . . \underline{206}

L \let 20, 21, 23, 25, 32–

35, 45–48, 57, 58, 78, 95, 99, 101, 106, 116, 119, 125, 128, 132, 133, 142, 144, 152, 153, 156–160, 162, 215

                          \lowercase . . 71, 84, 86

N \newdimen …. 154, 155 \noexpand 62, 74, 108, 109 \number . . . . . . . . . . 214

P \p@ . . . . . . . . 36, 38,

40, 42, 49, 51, 53, 55, 141, 210, 211

                                                   \PassOptionsToPackage

. . . . . . . . . . . . . 2

                                                   \ProcessOptions . . . . 3

R \relax 103, 156–158, 212

                                                   \RequirePackage . . . . 4
                                                   \rotatebox . . . . . . . \underline{182}

S \setbox . . . . . . 186, 195 \setkeys . . . . . 177, 194

                                                   \setlength . . . . . . .

. 120, 129, 206, 207

                                                   \strip@pt 37, 39, 41,

43, 50, 52, 54, 56

T \the …. 62, 74, 110, 179 \toks@ . . . . . . 62, 74,

108, 110, 176, 179

                                                   \totalheight . . . . . . 69

\tw@ . . . . . . . . . 192, 193

W \width . . . . . . . 192, 202

Z \z@ 186–188, 195, 201, 205