GNU Info

Info Node: (dvips.info)EPSF scaling

(dvips.info)EPSF scaling


Next: EPSF clipping Up: EPSF macros
Enter node , (file) or (file)node

EPSF scaling
............

  Usually, you will want to scale an EPSF figure to some size
appropriate for your document, since its natural size is determined by
the creator of the EPS file.

  The best way to do this is to assign the desired size to the TeX
`\epsfxsize' or `\epsfysize' variables, whichever is more convenient
for you.  That is, put

     \epsfxsize=DIMEN

right before the call to `\epsffile'.  Then the width of the TeX box
will be DIMEN and its height will be scaled proportionately.
Similarly, you can set the vertical size with

     \epsfysize=DIMEN

in which case the height will be set and the width scaled
proportionally.

  If you set both, both will be honored, but the aspect ratio of the
included graphic may necessarily be distorted, i.e., its contents
stretched in one direction or the other.

  You can resize graphics in a more general way by redefining the
`\epsfsize' macro.  `\epsffile' calls this with two parameters: the
natural horizontal and vertical sizes of the PostScript graphic.
`\epsfsize' must expand to the desired horizontal size, that is, the
width of the `\vbox'.  Schematically:

     \def\epsfsize#1#2{BODY}

  Some useful definitions of BODY:

`\epsfxsize'
     This definition (the default) enables the default features listed
     above, by setting `\epsfxsize' to the same value it had before the
     macro was called.

`#1'
     Force the natural size by returning the first parameter (the
     original width).

`0pt'
     A special case, equivalent to `#1'.

`0.5#1'
     Scale to half the natural size.

`\hsize'
     Scale to the current `\hsize'.  (In LaTeX, use `\textwidth'
     instead of `\hsize'.)

`\ifnum#1>\hsize\hsize\else#1\fi'
     If the natural width is greater than the current `\hsize', scale to
     `\hsize', otherwise use the natural width.

  For compatibility with other PostScript drivers, it is possible to
turn off the default scaling of included figures by the DVI
magnification with the following TeX command:

     \special{! /magscale false def}

Use of this command is not recommended because it will make the
`\epsffile' graphics the "wrong" size if global magnification is being
used, and it will cause any PostScript graphics to appear improperly
scaled and out of position if a DVI to DVI program is used to scale or
otherwise modify the document.

  DVI magnification is not applied to any output from code you write in
`bop-hook' or its ilk (Note: PostScript hooks.),


automatically generated by info2www version 1.2.2.9