%
%  Handout for the IAP '90 PS/TeX course
%
%  Copyright (C) 1990 Student Information Processing Board, MIT
%
\nopagenumbers
\def\\#1/{{\tt\char`\\#1}}
\def\LaTeX{{ L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em\TeX}}
%
\font\sc=cmcsc10
\font\bigbf=cmbx12
\font\titlefont=cmr10 scaled \magstep 4 \relax
\font\logo=logo10
\font\biglogo=logo10 scaled \magstep 4 \relax
\advance\hsize by -1in
\advance\hoffset by .5in
%
\def\qglue{\hskip .5em plus .3em minus .1em}
\def\biggskip{\vskip .2in plus .1in minus .1in}
%
\centerline{Student Information Processing Board}
\centerline{Massachusetts Institute of Technology}
\centerline{Room W20-557\quad$\bullet$\quad 253-7788}
\biggskip
\centerline{\titlefont Using PostScript with \TeX\ and \LaTeX\ }
\medskip
\centerline{Andr\'e DeHon}
\centerline{\tt amdehon@athena.mit.edu}
\biggskip
%
\def\inn{\null\hskip 1.5in\relax}
\parindent=0pt
\parskip=6pt plus 1pt minus 2pt
%
%\centerline{\titlefont Handout 5}
\biggskip
%
\catcode`\@=\active
\def@#1\par{\null\hskip -2em\relax$\bullet$\ {\parskip=0pt\bigbf #1\par}}
\def\{{\char`\{}
\def\}{\char`\}}
%


\input psbox
\input psadobe

@ Dvi2ps special command

Most versions of {\tt dvi2ps} support the \\special/ command and allow the
{\tt psfile} option.  This allows you to instruct \TeX\ or \LaTeX\ to
insert the specified PostScript file into the PostScript output generated
by {\tt dvi2ps}.  The following invocation followed this paragraph and
instructed {\tt dvi2ps} to insert the PostScript for the SIPB owl and the
THiRD EAst squanch at the top left and right corners of the page:

\inn\\special\{psfile=h1.ps hoffset=-36 voffset=250\}/

\special{psfile=h1.ps hoffset=-36 voffset=250}

The \\special/ command reserves no space for the included image.  If you
want to reserve blank space for the PostScript image, you must do so
explicitly.  See the man page for {\tt dvi2ps} for a detailed description
of the \\special/ command.



@ PSbox Macro

A macro called {\tt psbox} will insert a postscript file and enclose it in
a \TeX\ box of the size specified.  However, it does not guarantee that you
actually place the postscript in the box created since it has no idea where
your PostScript file will actually be imaged.  The two grumpy fuzzballs
below were inserted using the following:


\null\hskip 1in\relax
\\centerline/ {\tt \{} \\psbox\{1 in\}\{1.5 in\}\{g.ps\}/ \hfil \break
\null\hskip 1.5in\relax \\hskip 1 in/ \\psbox\{1 in\}\{1.5 in\}\{g.ps\}/
{\tt \}}


\centerline{ \psbox{1 in}{1.5 in}{g.ps} \hskip 1 in \psbox{1 in}{1.5
in}{g.ps} } 

The general usage of {\tt psbox} is: 

\inn\\psbox\{width\}\{height\}\{filename\}/

On Athena, the {\tt psbox} macro can be found in {\tt
/mit/postscript/psbox.tex}.  When you want to use the {\tt psbox} macro,
remember to include the macro definition using a line like:

\inn\\input psbox.tex/


@ PSAdobe

When your PostScript file follows Adobe's conventions, bounding box
information is included at the top of the PostScript file.  In these cases,
the {\tt psadobe} macro allows \TeX\ to align and size the picture
automatically.  The following Matlab plot was including using:

\inn\\psadobe\{epsf-ex.ps\}/

\advance\hsize by 1in
\advance\hoffset by -0.5in

\centerline{\psadobe{epsf-ex.ps}}

\advance\hsize by -1in
\advance\hoffset by .5in

The first few lines of the Adobe Encapsulated PostScript (EPS) formatted
file included above are shown below for reference.

\null\hskip 1in\relax
{\tt \%!PS-Adobe-1.0} \hfil \break
\null\hskip 1in\relax
{\tt \%\%Creator: MATLAB, The MathWorks, Inc.} \hfil \break
\null\hskip 1in\relax
{\tt \%\%Title: MATLAB Graph} \hfil \break
\null\hskip 1in\relax
{\tt \%\%CreationDate: 1/1/87 00:00:00 PM} \hfil \break
\null\hskip 1in\relax
{\tt \%\%BoundingBox: 72 396 540 756} \hfil \break
\null\hskip 1in\relax
{\tt \%\%EndComments} \hfil \break


On Athena, the {\tt psadobe} macro can be found in {\tt
/mit/postscript/psadobe.tex}.  When you want to use the {\tt psadobe} macro,
remember to include the macro definition using a line like:

\inn\\input psadobe.tex/






\bye
