home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / text / tex / pastex / macros / latex2e / contrib / supported / epsfig / epsfig.sty < prev    next >
Text File  |  1994-01-27  |  49KB  |  1,338 lines

  1. %----------------------------------------------
  2. \NeedsTeXFormat{LaTeX2e}
  3. \def\fileversion{2}%
  4. \def\filedate{1994/01/25}%
  5. \ProvidesPackage{epsfig}[\filedate]
  6. \message{ Epsfig }
  7. % minimal reworking for LaTeX2e!
  8. % this will be all be rewritten when the LaTeX2e includegraphics
  9. % comes out.
  10. %
  11. % SPQR Jan 94
  12. %
  13. %%%--------------------------------------------------------------------
  14. %%% psfig merged with EPSF = epsfig Release 1
  15. %%% 1.0 November 91
  16. %%% 1.1 Dec 91  fixed some bugs
  17. %%% 1.2 Jan 92  fixed bug that it never stopped reading PS file until
  18. %%%             it reached the end! merged in changes from psfig1.8
  19. %%%             (plain TeX definition of \fbox, new code for rotation)
  20. %%% 1.3 Jan 92  separated out \special code so that dvitops can be
  21. %%%             supported. use \psfigdriver{dvitops}%
  22. %%% 1.4 Jan 92  fixed dvitops. need to input psfig at different point
  23. %%%      in dvips from dvitops. define \psfig@start and \psfig@end to cope
  24. %%%      with this
  25. %%% 1.5 Jan 92  force use of psfig method if using dvitops
  26. %%% 1.6 May 92 fixed bugs
  27. %%% 1.7 Sep 92 added support for emtex, sort of. reads a .bb file
  28. %%%            and imports .pcx file. Boolean flag \epsfigdos used
  29. %%%             to indicate that we cannot have more than one . in the
  30. %%%             suffix (ie we will look at file.bb not file.eps.bb)
  31. %%%
  32. %%% 1.8 Sep 92 added support for OzTeX; fixed bugs in dvips support
  33. %%% (including clipping to bounding box); removed use of dimen100.
  34. %%%
  35. %%% 1.9 Dec 92 cleaned up documentation again
  36. %%% 1.10 Mar 93 cleaned up for plain TeX
  37. %%% 1.11 Mar 93 merged in changes by Peter Galko (supplied by CERN) for
  38. %%%             use with Textures
  39. %%% 1.12 Apr 93 actually *tested* the Textures additions, and so rewrote
  40. %%%            from scratch (borrowed an idea from psbox)
  41. %%% 1.13 May 93 allow for file names with _ or $ in them in \psdraft, and
  42. %%%             fix problem that occurred with missing BoundingBox
  43. %%% 1.14 May 93 allow for .z suffix
  44. %%% 1.15 July 93 allow for .gz suffix
  45. %%%              use \leavevmode as appropriate
  46. %%%              fix plain \TeX mode 
  47. %%%             (fixes from Peter-Klaus Schilling <R02SCH@DSYIBM.DESY.DE>)
  48. %%% 1.16 August 93 [peta@mcrcim.mcgill.edu (Peter Whaite)]
  49. %%%        -- Implement Perl scripts to do compressed file inclusion and bb
  50. %%%           generation. 
  51. %%%        -- Add \pscompress.
  52. %%%        -- Tidy up comments.
  53. %%% 1.17 September 93 SPQR
  54. %%%     better code for literal name printing
  55. %%%     allowed for spaces around , and =
  56. %%% 1.18 17.9.93
  57. %%%   updates to epsbb and epsfig from Peter W
  58. %%% 1.19 14.11.93
  59. %%%   mistaken placement of calculation of EPS@Height resulted in errors
  60. %%%
  61. %--------------------------------------------------------
  62. %%%
  63. %%% code rearranged by Sebastian Rahtz (spqr@uk.ac.york.minster)
  64. %%% from work by
  65. %%% Trevor Darrell; Tom Rokicki; Daniel Smith; H. Payne, Robert Russell
  66. %%%
  67. %%% This is a version of Darrell's `psfig' macros which are designed
  68. %%% to be used with dvips or dvitops, and the `epsf' macros (these are
  69. %%% automaticaly included by the style file). I did this because the
  70. %%% \special commands used by `epsf' appear to be more robust and
  71. %%% portable than the raw \specials used by `psfig', but I preferred
  72. %%% the psfig interface. This system preserves the psfig interface,
  73. %%% but mainly uses epsf macros to carry out the job. The user
  74. %%% interface is identical to \psfig, but you just use \epsfig
  75. %%% instead. Rotation uses the original psfig macros: I could not work
  76. %%% out how to do rotation with the epsf macros.
  77. %%%
  78. %%% The same applies to `rheight' and `rwidth'
  79. %%%
  80. %%% If you *really* want old psfig behaviour regardless, use \psfig. It is
  81. %%% still there. Some of the features have gone, however. \figurepath
  82. %%% seemed redundant, since it could be controlled by the TEXINPUTS
  83. %%% variable anyway.
  84. %%%
  85. %%% As an added feature, if FILE cannot be found, a file called FILE.bb
  86. %%% is searched for. This should simply contain a %%BoundingBox line. A perl
  87. %%% script "epsbb" is provided to generate these automatically.  It is
  88. %%% assumed that if this exists, then the actual postscript is in UNIX
  89. %%% compress format in FILE.Z or in GNU gzip format in FILE.gz or FILE.z.
  90. %%%
  91. %%% The macros then read the BB from FILE.bb, but insert "`epsfig FILE`" in
  92. %%% the  output for dvips to interpret (don't worry, it knows about this).
  93. %%% "Epsfig" is another perl script which  searches the TEXINPUTS path for
  94. %%% FILE or FILE.{gz,z,Z}.
  95. %%%
  96. %%% As an added bonus if you say \pscompress the -c switch will be passed to
  97. %%% epsfig, causing automatic FILE.bb generation and compression the first
  98. %%% time dvips is run.  Files in the system directories will NOT be
  99. %%% compressed.
  100. %%% If you are *not* on a Unix system and use this, deliberately or by
  101. %%% mischance, you will have problems!
  102. %%%
  103. %%% This file can be included in a dumped format, or used as a LaTeX
  104. %%% style file, or used in plain TeX. It does not load itself twice (I hope)
  105. %%%
  106. %--------------------------------------------------------------------
  107. %--------------------------------------------------------------------
  108. %%% previous notes. this copy of psfig.tex inherited from versions 1.8
  109. %--------------------------------------------------------------------
  110. %%% All psfig/tex software, documentation, and related files
  111. %%% in this distribution of psfig/tex are
  112. %%% Copyright 1987, 1988, 1991 Trevor J. Darrell
  113. %
  114. %%% Permission is granted for use and non-profit distribution of psfig/tex
  115. %%% providing that this notice be clearly maintained. The right to
  116. %%% distribute any portion of psfig/tex for profit or as part of any commercial
  117. %%% product is specifically reserved for the author(s) of that portion.
  118. %%%
  119. %%% Thanks to Greg Hager (GDH) and Ned Batchelder for their contributions
  120. %%% to this project.
  121. %%%--------------------------------------------------------------------------
  122. %%% GDH 7/26/87 -- changed so that it first looks in the local directory,
  123. %%% then in a specified global directory for the ps file.
  124. %%% SPQR 12/91 removed that last change. it follows TEXINPUTS anyway
  125. %%% RPR 6/25/91 -- changed so that it defaults to user-supplied name if
  126. %%% boundingbox info is specified, assuming graphic will be created by
  127. %%% print time.
  128. %%% SPQR 12/91 removed that last change. use LaTeX error message instead
  129. %%% SPQR 12/91 -- `no file found' produces LaTeX error message.
  130. %%%                If you recover from that the file name is set in draft
  131. %%%                mode in place of the file.
  132. %%%
  133. %%% Modified by J. Daniel Smith on 9 October 1990 to accept the
  134. %%% %%BoundingBox: comment with or without a space after the colon.  Stole
  135. %%% file reading code from Tom Rokicki's EPSF.TEX file (see below).
  136. %%% --- SPQR 12.91 removed most of this to use epsf directly
  137. %%%
  138. %%% More modifications by J. Daniel Smith on 29 March 1991 to allow the
  139. %%% the included PostScript figure to be rotated.  The amount of
  140. %%% rotation is specified by the "angle=" parameter of the \epsfig command.
  141. %%%
  142. %%% Modified by Robert Russell on June 25, 1991 to allow users to specify
  143. %%% .ps filenames which don't yet exist, provided they explicitly provide
  144. %%% boundingbox information via the \epsfig command. Note: This will only work
  145. %%% if the "file=" parameter follows all four "bb???=" parameters in the
  146. %%% command. This is due to the order in which psfig interprets these params.
  147. %%% ---- SPQR 12.91 removed all this
  148. %%%
  149. %%% 3 Jul 1991  JDS     check if file already read in once
  150. %%%
  151. %-----------------------------USAGE---------------------------------------
  152. % From: gvr@cs.brown.edu (George V. Reilly)
  153. %
  154. % \psdraft      draws an outline box, but doesn't include the figure
  155. %               in the DVI file.  Useful for previewing.
  156. %
  157. % \psfull       includes the figure in the DVI file (default).
  158. %
  159. % \psscalefirst width= or height= specifies the size of the figure
  160. %               before rotation.
  161. % \psrotatefirst (default) width= or height= specifies the size of the
  162. %                figure after rotation.  Asymetric figures will
  163. %                appear to shrink.
  164. %
  165. % usage: \epsfig{file=, figure=, height=, width=,
  166. %                       bbllx=, bblly=, bburx=, bbury=,
  167. %                       rheight=,