%%%% Simple macros for including illustrations in TeX.

%%% The basic control sequence is used like:
%%%     \illustration{/usr/kt/figure-1}{3 in}
%%% This puts an illustration into a vbox.  If you don't know what a vbox is,
%%% let it suffice to say that you can put the \illustration sequence between
%%% paragraphs if you want the figure to appear between paragraphs, in a floating
%%% environment if you want it to float, etc.  The first argument is the name
%%% of the postscript file containing your illustration, not including the
%%% ".ps" suffix.  The file must be on NEWTOWNE, and be readable by others
%%% (check your file and directory protection).  The second argument is the
%%% height of the illustration, as printed by the Illustrate command "Show
%%% Illustration Size".
%%%
%%% If you don't want to include the directory name in every call to
%%% \illustration, you can put this at the top of your file:
%%%    \def\illustrationfileprefix{/usr/kt/}
%%% This says that /usr/kt/ should be put at the front of the filename.  You
%%% issue this several times within a document; each instance has effect over
%%% all subsequent calls to \illustration.
%%%
%%% A call to \illustration between paragraphs puts the lower left corner of
%%% the illustration at the left margin of the document (not the left edge of
%%% the paper).  The lower left corner of the illustration is defined to be at
%%% Illustrate coordinates (1 in, 10.5 in), which is the lower left corner of
%%% the drawing pane when not magnified (Illustrate coordinates are displayed
%%% in a pane near the lower right of the Illustrate frame).  Thus, if you want
%%% your illustration centered within a 6.5 inch line, the bottom center of
%%% your illustration should be at the bottom center of the drawing pane:
%%% Illustrate coordinates (4.25 in, 10.5 in).
%%%
%%% If you would rather use a different lower left coordinate than (1 in, 10.5
%%% in), issue a command like this in your TeX file:
%%%   \illustrationcorner = (2 in, 9 in)
%%% The example above makes \illustration use Illustrate coordinates (2 in, 9
%%% in) as the lower left corner of the illustration.  Again, you can issue
%%% this command several times within your manuscript.
%%%
%%% For users of TeX's \magnification command:  any magnification you specify
%%% for your document does NOT affect the appearence of the Illustrations you
%%% include.  Therefore, you should use "true" units in the second argument to
%%% \illustration:  e.g. \illustration{figure-1}{3 true in}.  On the other
%%% hand, you should NEVER use "true" units in the \illustrationcorner command.


%%% What follows is the TeX code for all this good stuff.

\newcount\illustrationhoffset
\newcount\illustrationvoffset
\def\illustrationcorner = (#1,#2){%
  \dimen0=#1
  \illustrationhoffset=-\dimen0
  \advance\illustrationhoffset by -32891
  \divide\illustrationhoffset by 65782
  \dimen0=#2
  \illustrationvoffset=\dimen0
  \advance\illustrationvoffset by -52132044
  \divide\illustrationvoffset by 65782}
\def\illustration#1#2{%
  \vbox to #2{\vfill
              \special{psfile=\illustrationfileprefix#1.ps
                       hoffset=\the\illustrationhoffset\space
                       voffset=\the\illustrationvoffset}}}

\def\illustrationfileprefix{}			       % Default is no prefix
\illustrationcorner = (1 in, 10.5 in)		       % Default corner is
						       %  (1 in, 10.5 in)
