\makeatletter


% From KS's macros
%
% \fig{name} -- reference a figure.
\def\fig#1{Figure~\ref{fig:#1}}
%
% \tab{name} -- reference a table.
\def\tab#1{Table~\ref{tab:#1}}
%
% \chap{name} -- reference a chapter.
\def\chap#1{Chapter~\ref{chap:#1}}
%
% \sec{name} -- reference a section.
\def\sec#1{Section~\ref{sec:#1}}
\def\sec#1{Section~\ref{sec:#1}}



%\illustration{filename}
\def\illustration#1{\begin{center}\psadobe{\illustrationfileprefix#1.ps}%
                       \end{center}}

% \illfigure{filename}{Title}: Standard figure.
\def\illfigure#1#2{\begin{figure}[htbp]
			\illustration{#1}
			\caption{#2}
			\label{fig:#1}
			\end{figure}}

% \illfigurepp{filename}{Title}: Standard figure.
\def\illfigurepp#1#2{\begin{figure}[htb]
			\illustration{#1}
			\caption{#2}
			\label{fig:#1}
			\end{figure}}


%% Put text on page with figures, even if text is at least .25 of page
\def\topfraction{.75}
\def\bottomfraction{.5}
\def\textfraction{.25}
\def\floatpagefraction{.75}
\def\dbltopfraction{.75}
\def\dblfloatpagefraction{.5}


%%%%%%%%%%%%%%%%%%%%%%%%%




%%% From KT: The example environment.   This is similar to verbatim, but only treats end
%%% of line and space as verbatim; control sequences, braces, and such work as
%%% before.  One situation in which this is useful is when you want to include
%%% italic text.  Unfortunately, if you include {\it stuff} the space between
%%% \it and stuff is typeset, since spaces are treated verbatim.  One way to
%%% avoid this is to type {\it{}stuff}.  A better way is to say \i{stuff}; \i
%%% is defined within example for just this purpose.

%%% We reuse as much LaTeX code as possible -- in a sneaky way by making
%%% \dospecials be a no-op, thus preventing the deactivation of the special
%%% characters.  Because special characters still work, we don't need the
%%% hackery needed by \endverbatim.
%%% Adjacent lines of an example environment get \examplepenalty inserted
%%% between them.  Beginning a line with \hinge removes the immediately
%%% preceding penalty.  Thus, setting \examplepenalty to 10000 prevents
%%% line breaks except between lines separated by \hinge.
\newcount\examplepenalty
\examplepenalty=0
\def\example{%
  \def\{{\relax\char`\{}%
  \def\}{\relax\char`\}}%
  \let\temp=\dospecials\let\dospecials=\relax
  \let\@@@par=\@@par
  \def\@@par{\@@@par\penalty\examplepenalty}%
  \@verbatim
  \def\hinge{\penalty0\relax}%
  \let\dospecials=\temp
  \def\i##1{{\it ##1}}%
  \frenchspacing\@vobeyspaces}
\def\endexample{\penalty0\endtrivlist}

