\documentstyle[a4wide,11pt]{article}
\begin{document}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\footskip}{2cm}
\newfont{\hash}{cmr8 scaled\magstep0}
\centerline{\Large Some Notes}
\smallskip
\centerline{\large concerning the use of the conversion program PS2EPS}
\bigskip
\centerline{by J.H.\,SATTER}
\vspace{1cm}
\noindent
There are some special macro's, for example EPSF and FIG/P, which can be used
in combination with the conversion program DVIPS$^{\,\dagger}$ to include graphic
files in \TeX\ files. In order to work properly, the graphic files must be
written in the Encapsulated PostScript (EPS) language. Unfortunately, most
drawing programs do not produce EPS. Although they claim to write their output
files in PostScript (PS), modifications are necessary to correct for deviations
and omissions.
The conversion program PS2EPS does this automatically for several types of PS
files. As a default it creates an output file with the same name as the input
file, but with the extension 'eps'. In the conversion program options have been
included to make locating figures as easy as possible.\\[2ex]
{\bf PS2EPS}\\[.5ex]
This program converts PS files into EPS files. The conversion program has been
especially written to process files which are generated by GEM 3.0,
DrawPerfect 1.1, PSpice 4.05, OrCAD 3.11, PrintGL 1.18, Mathcad 3.0 and 
GNUPLOT 3.0, and is
meant to be used with the program DVIPS or DVIALW. However, the user may find
that other versions of these programs will also be converted in the right way.
Of course it is possible to incorporate other drawing programs when the need
arises. \\
The synopsis of PS2EPS is\,:\\[.75ex]
{\bf ps2eps} [-{\bf G} -{\bf D} -{\bf P} -{\bf O} -{\bf H} -{\bf T} -{\bf M}]
     [-{\bf b}{\hash \#},{\hash \#},{\hash \#},{\hash \#}]
     [-{\bf w}{\hash \#}] [-{\bf h}{\hash \#}] [-{\bf s}{\hash \#},{\hash \#}]\\
\hspace*{39.5pt}[-{\bf d}] [-{\bf f}\,] [-o{\it Output file}]
     {\it Input file}.\\[.75ex]
The options -{\bf G}, -{\bf D}, -{\bf P}, -{\bf O}, -{\bf H}, -{\bf T}, -{\bf M}
are mutually exclusive.\\
The meaning of the program options will be explained next\,:
\begin{tabbing}
xxxxxxxxxxxx\=\kill
-{\bf G} \> {\it Input file} is a PS file from GEM.\\
-{\bf D} \> {\it Input file} is a PS file from DrawPerfect.\\
-{\bf P} \> {\it Input file} is a PS file from PSpice.\\
         \> PSpice generates its figures always in a bounding box (BB) with\\
         \> the same dimensions. Initially the box is scaled so that the width\\
         \> takes on the default value of 140\,mm.\\
-{\bf O} \> {\it Input file} is a PS file from OrCAD.\\
         \> Owing to the simple structure of an OrCAD PS file, PS2EPS could be\\
         \> made to determine the dimensions of the BB by itself.\\
-{\bf H} \> {\it Input file} is a PS file from PrintGL.\\
-{\bf T} \> {\it Input file} is a PS file from GNUPLOT.\\
-{\bf M} \> {\it Input file} is a PS file from Mathcad.\\
-{\bf b}{\hash \#},{\hash \#},{\hash \#},{\hash \#} \> Figure BB in mm.
      {\hash \#},{\hash \#},{\hash \#},{\hash \#} respectively means\,:\\
              \> llx=lower left x coordinate.\\
              \> lly=lower left y coordinate.\\
              \> urx=upper right x coordinate.\\
              \> ury=upper right y coordinate.\\
              \> -{\bf b} is required with the -{\bf G}, -{\bf M} and -{\bf D}
              option, but will be\\
              \> neglected in all other cases.\\
\end{tabbing}

\begin{tabbing}
xxxxxxxxxxxx\=\kill
-{\bf w}{\hash \#} \> Denotes figure width in mm. The maximum width is 140\,mm.\\
-{\bf h}{\hash \#} \> Denotes figure height in mm. The maximum height is 200\,mm.\\
-{\bf s}{\hash \#},{\hash \#} \> Extra space in mm above and below the figure
                           respectively.\\
-{\bf d} \> Gives headerline with Date, Time and Temperature. This option is\\
   \> only valid for PSpice.\\
-{\bf f} \> No BB around the figure. This option is only valid for OrCAD.\\
   \> When using OrCAD, the user has to switch off the OrCAD frame\\
   \> and has to draw a BB around the figure himself.\\
-{\bf o} \> The user can define another {\it output file} name.\\
\,\,{\bf ?} \> A brief description of all options is displayed.\\
\end{tabbing}
To make the conversion program work correctly, some demands must be made upon
the drawing programs.\\[2ex]
{\bf GEM}\\[.5ex]
First of all, in the printer part of the GEM setup program the Laserwriter Plus
driver must be installed. This produces the PostScript 35 icon in the output
screen of the GEM program. This icon must be chosen, to make PS files which will
be accepted by a PostScript printer. Unfortunately, in its original form the
PostScript driver of GEM will refuse to process circles! To correct this, some
modifications must be made in the file "pst.pre", which can be found in the
directory "Gemsys". Modified files can be obtained from the author of the PS2EPS
program$^{\,*}$.\\
When GEM has been switched on, the following settings must be made and saved as
preferences\,:
\begin{enumerate}
\item In the drawing screen menu's item "Page" choose the option "Page size"
      and set
\begin{enumerate}
\item layout\,: portrait
\item units\,: centimeters
\item paper\,: A4(21$\times$29.7\,cm)
\item border\,: 1\,cm
\end{enumerate}
\item In the output screen menu's item "Preferences" choose the option
      "Page size" and set
\begin{enumerate}
\item page size\,: scale is "true size", final formfeed is "no"
\item paper size\,: units is "centimeters", paper size
      is "A4(21$\times$29.7\,cm)"
\item paper tray\,: papertray is "default"
\end{enumerate}
\item Check the presence of the icon "PostScript 35" in the output screen menu.
\end{enumerate}
The conversion program PS2EPS needs the BB coordinates of the figure
(-b option). The BB is an invisible rectangle which encloses the whole figure
symmetrically. The necessary coordinates are the x and y values in millimeters
of the lower left corner and the upper right corner of the BB, with respect to
the lower left corner of the \underline{drawing area} of the page, which is used
by the drawing program. A BB can easily be faked by using the "select all" and
"make group" options in GEM.\\
Determine the BB coordinates of each figure when the figure is ready and write
them down, so you need not start GEM again afterwards. It is recommended to save
the coordinates of the BB's in a separate file for future use.\\[2ex]
{\bf DrawPerfect}\\[.5ex]
While processing the PS files produced by DrawPerfect, there appeared to be an
inconsistency in the DrawPerfect file "dr.exe", which can be found in the
directory "DR11". Modified files can be obtained from the author of the PS2EPS
program$^{\,*}$.\\
When DrawPerfect is started the following settings must be made\,:
\begin{enumerate}
\item In the drawing screen menu's item "File" choose the option "Setup".
\begin{enumerate}
\item Then choose the option "Environment" and set "Units of Measure" is c.
\end{enumerate}
\item Next choose the option "Initial Settings".
\begin{enumerate}
\item and set "Paper Size" is 29.7c$\times$21c, "Type" is Standard.
\item Then choose "Page Options" and set all margins to 1\,c.
\end{enumerate}
\end{enumerate}
The coordinates of the BB can be obtained by drawing a rectangle \underline
{symmetrically} around the figure and using the readings of the position
display for the lower left corner and the upper right corner. After that, the
rectangle can be deleted. To generate the PS file, choose the item "File" and
use the option "Export EPS".\\[2ex]
{\bf PSpice}\\[.5ex]
PSpice can generate a hardcopy in PostScript format. However, in order to make
this file suitable to be processed by PS2EPS, an extra line must be inserted in
the file "pspice.dev" ("probe.dev" in older versions), that is, of course, if
this line is not already present. The file reads now, for example\,:
\begin{tabbing}
xxxxxxxxx\=\kill
Display   \>= Hercules\\
Hard-copy \>= PRN:\,, Epson\\
Hard-copy \>= File, HP6\\
Hard-copy \>= File, PS
\end{tabbing}
The last line was inserted to generate the PS file, which can be
processed by PS2EPS. The intended graph must be drawn on the screen by using
"Probe". Then, from the main menu, the item "Hard\_copy" must be selected.
If more than one hard copy device was defined in the previously mentioned file
"pspice.dev", it is necessary to use the option "PS (File)". Now a name for the
output file must be entered, thereby using the extension "ps", and the size of
the plot must be chosen as\,: 1\_page\_long. During the generation of the output
file the main menu will temporarily disappear. The figure, which is produced
by this PS file, will always have the same size and will always be in the
landscape format.\\
PS2EPS converts this PS file to an EPS-file, which is suitable for the A4
portrait format. The default width of the figure is A4 text width but, if so
desired, the dimensions can be adjusted. Annoying information such as Date,
Time and Temperature, will be suppressed, unless option -d is invoked.\\[2ex]
\newpage
\noindent
{\bf OrCAD}\\[.5ex]
With OrCAD, nice looking schematic drawings can be made. However, it is
necessary to reconfigure some settings. With Draftini (or Draft/c) the
Configuration Menu of OrCAD is accessible. The following settings are
recommended\,:
\begin{description}
\item[1 ]As Plotter Driver a PostScript driver must be selected. Either the
         original PS driver PSCRIPT.DRV or the patched PSCRIPT1.DRV can be
         used.\\
Installing the Plotter Driver\,:
\begin{description}
\item Select\,: PL
\item Select\,: S
\item Type\hspace*{5pt}:\, PSCRIPT1.DRV
\end{description}
\item[2 ]The frame around the figure must be suppressed, because it is usually
far too big in relation to the drawing. To achieve this the Plotter Pen Table
must be changed.\\
Changing the Plotter Pen Table\,:
\begin{description}
\item Select\,: CT
\item Select\,: M
\item Select\,: P, Item$\Longrightarrow$27, Pen NUMBER$\Longrightarrow$99
\item Select\,: P, Item$\Longrightarrow$28, Pen NUMBER$\Longrightarrow$99
\item Select\,: Q
\end{description}
\item[3 ]Now the configuration can be updated and the program can be quit, which\\
      is done by using the following selections.
\begin{description}
\item Select\,: U
\item Select\,: Q
\end{description}
\end{description}
The figures can be drawn with Draft figure{\hash \#\#}.sch.\\
Most of the time only a small amount of the available worksheet will be used for
the drawing. In order to suppress the unused blank space, only a portion of the
worksheet must be selected. This is achieved by drawing a close rectangle
\underline{symmetrically} around the the total drawing, which will serve as a
visible BB.\\
It is recommended to select from the Set menu in Draft\,:
\begin{tabbing}
xxxx\=xxxxxxxxxxx\=xxxxx\=\kill
Title Block   \>\>NO\\
Worksheet Size\>\>A\\
X,Y Display   \>\>YES\\
Grid parameters\,:\\
\>Grid References   \>\>NO\\
\>Stay on Grid      \>\>YES\\
\>Visible Grid Dots\>\>YES
\end{tabbing}
If several figures with different sizes has to be drawn, it is advised to use
BB's of the same width for all drawings. The resulting figures will
then consist of elements of the same size.\\
After the figure has been saved, a PS file can be produced with OrCAD's
"plotall" command.\\[.75ex]
The suggested syntax is\,: plotall figure{\hash \#\#}.sch figure{\hash \#\#}.\\
[.75ex]
User defined extensions for the output files are not allowed, because OrCAD
generates them automatically. Therefore, the above mentioned command converts
the schematic file "figure{\hash \#\#}.sch" into the PS file
"figure{\hash \#\#}.000". It is recommended to rename the latter as
figure{\hash \#\#}.ps.\\
PS2EPS can convert this file to the intended EPS file. If it is not desired to
print the rectangle of the BB, the option -f must be used.\\[2ex]
{\bf PrintGL}\\[.5ex]
PrintGL is a shareware pen plotter emulator. It prints or displays an HP-GL
plotfile on various printers or PC graphics devices respectively. It can also
be used to convert plotfiles for the widely used HP 7475 plotter to PS files.\\
PrintGL offers a lot of options, for which the user is invited to consult the
manual. The only options dealt with here are those which must be used to obtain
PS files. Scaling and extra space above and below the figure are left to
PS2EPS.\\
A useful set of options is combined in a batch file "hpgl2ps.bat" which contains
the line\,:\\[.75ex]
printgl /p\%1 /fs /ck /lf 4,1,0,0 /mf1 /o2 /dhpgl.ps\\[.75ex]
The HP-GL input file \%1 is converted to a PS file "hpgl.ps".\\[2ex]
{\bf GNUPLOT}\\[.5ex]
Graphs made by GNUPLOT must be presented to PS2EPS as separate files.\\[2ex]
\begin{tabbing}
xx\=\kill
$\dagger$\\
\>DVIPS and DVIALW are shareware programs, which have been written especially
  to\\
\>convert DVI files into PS files. The source of the Unix version is written in
  C and is\\
\>suitable for PC usage after some modifications.\\
\end{tabbing}
\begin{tabbing}
xx\=\kill
*\\
\>Jan Nusteling\\
\>Delft University of Technology\\
\>Dept. of Electrical Engineering\\
\>Mekelweg 4\\
\>2628 CD Delft, The Netherlands\\
\>email\,: j.nusteling@\,et.tudelft.nl\\
\end{tabbing}
\newpage
\input epsf
\noindent
To demonstrate how EPS files are included into a \LaTeX\ file, a cheerful
example is given below. First the \LaTeX\ file must 'know of' the EPSF macro.
This can be done by adding {\bf epsf} as an option, that is between the square
brackets, to the document style declaration, or by putting \verb@\input epsf@ at
the top of the file. At the point where the figure must be placed, insert the
line \verb@\centerline{\epsffile{----.eps}}@.\\
\centerline{\epsffile{cupid.eps}}
If it is desired to include a figure caption, this can be done by putting
the inserted line into a figure environment.
\begin{figure}[h]
\centerline{\epsffile{cupid.eps}}
\caption{This is cupid: beware!}
\end{figure}\\
It must not be overlooked that the EPSF macro has also several options, which
can be used independently from the conversion program PS2EPS. For the options of
the macro the reader is referred to the relevant documentation.\\
To show the reader more exactly how it is done, a complete work sheet of this page is on the next page.\\
Viewing the "dvi" file, after the "tex" file has been processed by
\LaTeX\/, shows empty spaces of the right dimensions, where the figures will be
placed. Inserting the figures is realized during the conversion of the 
"dvi" file to the "ps" file, which is done by the "dvips" program.\\
\newpage
\begin{verbatim}
\documentstyle[a4,11pt]{article}                                   %Worksheet
\begin{document}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\footskip}{2cm}
\setcounter{page}{6}
\input epsf
\noindent
To demonstrate how EPS files are included into a \LaTeX\ file, a cheerful
example is given below. First the \LaTeX\ file must 'know of' the EPSF macro.
This can be done by adding {\bf epsf} as an option, that is between the
square brackets, to the document style declaration, or by putting
\verb@\input epsf@ at the top of the file. At the point where the figure must
be placed, insert the line \verb@\centerline{\epsffile{----.eps}}@.\\
\centerline{\epsffile{cupid.eps}}
If it is desired to include a figure caption, this can be done by putting
the inserted line into a figure environment.
\begin{figure}[h]
\centerline{\epsffile{cupid.eps}}
\caption{This is cupid: beware!}
\end{figure}\\
It must not be overlooked that the EPSF macro has also several options, which
can be used independently from the conversion program PS2EPS. For the options
of the macro the reader is referred to the relevant documentation.\\
To show the reader more exactly how it is done, a complete work sheet of this pa
ge is on the next page.\\
Viewing the "dvi" file, after the "tex" file has been processed by
\LaTeX\/, shows empty spaces of the right dimensions, where the figures will be
placed. Inserting the figures is realized during the conversion of the
"dvi" file to the "ps" file, which is done by the "dvips" program.\\

\end{document}
\end{verbatim}

\end{document}


