postscript.sty 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. %*************************************************************************
  2. %*
  3. %* University of Gent
  4. %* Department of Applied Mathematics, Biometrics and Process Control
  5. %*
  6. %* Project: NONE
  7. %* File: $Source: /usr/net_people/template/RCS/postscript.sty,v $
  8. %* Type: LaTeX
  9. %* Author: $Author: template $
  10. %* Locker: $Locker: $
  11. %* Date: $Date: 1995/11/16 13:13:54 $
  12. %* Revision: $Revision: 1.2 $
  13. %* State: $State: Exp $
  14. %*
  15. %*************************************************************************
  16. %*
  17. %* Description: LaTeX style file allowing for Encapsulated PostScript
  18. %* files to be included in LaTeX, contains macro
  19. %* definitions building on the basic epsf capabilities
  20. %* (see epsf.sty).
  21. %*
  22. %* Needs to be included as follows:
  23. %* \documentstyle[<...>,postscript,<...>]{<...>}
  24. %*
  25. %* Commands:
  26. %* \postscript{<eps_file_name>}{<factor>}
  27. %* Will include the Encapsulated PostScript document in the file
  28. %* <eps_file_name> into the current LaTeX document.
  29. %*
  30. %* Typical usage:
  31. %* \begin{figure}
  32. %* \postscript{my_picture.eps}{1}
  33. %* \caption{my picture}
  34. %* \end{figure}
  35. %*
  36. %* \fpostscript{<eps_file_name>}{<factor>}
  37. %* Similar to \postscript, but will draw a frame around the eps
  38. %* picture. The frame is drawn by TeX, so it will show up in a
  39. %* dvi preview. Hence, one can "debug" LaTeX files with
  40. %* Encapsulated PostScript, without actually generating
  41. %* PostScript. Just xdvi (or xpreview) the .dvi file and the eps
  42. %* will show up as an empty frame.
  43. %*
  44. %* <factor> determines the final size of the included picture.
  45. %* It is a factor (e.g., 0.5) relating to the actual textwidth
  46. %* of the document. Hence, if the a4wide style is used,
  47. %* \postscript{my_picture.eps}{1} will scale the picture to the
  48. %* full a4wide textwidth, whereas the twocolumn style option will
  49. %* result in scaling to the width of a single column.
  50. %* Note: using \begin{figure*} allows one to have the picture
  51. %* scaled to the full textwidth, even in twocolumn style.
  52. %* Factor 0 means: keep the natural size of the image.
  53. %*
  54. %* For more direct control of PostScript inclusion, use espf.sty
  55. %* directives directly (see /usr/local/tex/inputs/epsf.sty).
  56. %*
  57. %* If verbose output is wanted about the inclusion proces:
  58. %* \epsfverbosetrue
  59. %*
  60. %* To facilitate the draft/final version generation process,
  61. %* \epsincl is provided. \epsincl is nothing but \postscript
  62. %* or \fpostscript, depending on whether \drafttrue has
  63. %* been set.
  64. %*
  65. %*
  66. %* Files this document depends on:
  67. %* epsf.sty
  68. %*
  69. \NeedsTeXFormat{LaTeX2e}[1995/06/01]
  70. \ProvidesPackage{postscript}
  71. \RequirePackage{epsf}
  72. % include Encapsulated PostScript
  73. \newcommand{\postscript}[2]
  74. {
  75. \setlength{\epsfxsize}{#2\hsize}
  76. \centerline{\epsfbox{#1}}
  77. }
  78. % include Encapsulated PostScript with frame
  79. \newcommand{\fpostscript}[2]
  80. {
  81. \setlength{\epsfxsize}{#2\hsize}
  82. \centerline{\fbox{\epsfbox{#1}}}
  83. }
  84. % Encapsulated PostScript inclusion controlled by \draft
  85. \newif\ifdraft % to distinguish beween draft and final versions
  86. % use \drafttrue to set draft mode
  87. \newcommand{\epsincl}[2]
  88. {
  89. \ifdraft
  90. \fpostscript{#1}{#2}
  91. \else
  92. \postscript{#1}{#2}
  93. \fi
  94. }
  95. \endinput
  96. %*************************************************************************