% \iffalse meta-comment
%
% file: siggraph.dtx
% version: 1.1.1
% date: January 17, 1996
%
% Provides `siggraph' document class for use with LaTeX2e.
% Formats a document according to ACM Siggraph conference proceedings
%  specifications.
%
%%
%% Copyright (C) 1996 Daniel Kartch
%%                    Program of Computer Graphics
%%                    Cornell University
%%                    dan@graphics.cornell.edu
%%
%% This file is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%%
%
% This file may be freely copied in whole or in part under the following 
%  conditions:
% 1) Unmodified copies may be freely distributed separately or as part
%    of larger packages.
% 2) You may make modified copies of this file for you own personal use,
%    but you may not distribute modified copies.  You may place modifications
%    in a siggraph.cfg file (see the documentation), and distribute that
%    file individually or along with this source.  However, if you do
%    so, the .cfg file must contain code to issue a warning when it is
%    invoked by LaTeX that states:
%       a) The fact that it is being loaded and it is not part of the
%           standard distribution
%       b) What it does (briefly)
%       c) That it can be disabled by removing or renaming the .cfg file
% 3) Excerpts from this file may be freely used and distributed as part
%    of other macro packages.
%
% Portions of this file (namely the \@maketitle macro and the commands to
%  set up 9pt type) are modified versions of those provided with the standard
%  LaTeX files article.cls file and size10.clo, and their distribution may
%  be further restricted by the LaTeX copyright. (Probably not, but better
%  safe than sorry.)
%
%%
%% NOTE:
%%  This is a beta release and hasn't been thoroughly tested yet. Please
%%  send me any bug reports, suggestions for improvement, or other comments.
%%  I will do my best to fix any problems before the Siggraph submission
%%  deadline, but I make no promises.  The likelihood of my responding to
%%  any given comment is directly proportional to the amount of time before
%%  the deadline that the comment is received.
%%
% \fi
%
% \CheckSum{814}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
%
% \iffalse
%    \begin{macrocode}
%<+class>\NeedsTeXFormat{LaTeX2e}[1994/06/01]
%<+class>\ProvidesClass{siggraph}
%<*driver>
	\ProvidesFile{siggraph.drv}
%</driver>
		[1996/01/17 v1.1.1
%<+class>		Siggraph proceedings document class]
%<*driver>
]
%</driver>
%    \end{macrocode}
%
% \section{Driver for this document}
%
% The following contains the driver for generating this document.
% It can be extracted from the |.dtx| file with the \dst{} program.
%
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\GetFileInfo{siggraph.drv}
%\DisableCrossrefs
\RecordChanges
\OnlyDescription % comment out for full source description
\begin{document}
    \DocInput{siggraph.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%\fi
%
% \newenvironment{mylist}{%
%	\begin{list}{\labelitemi}{%
%		\addtolength{\leftmargin}{2em}%
%		\setlength{\itemindent}{-1em}%
%		\setlength{\parsep}{0in}%
%		\setlength{\itemsep}{0.5ex}}}{\end{list}}
%
% \changes{v0.6.1}{1994/12/26}{Minor modifications to user's guide}
%
% \title{The |siggraph| Document Class Users' Guide\thanks{
%    This file has version number \fileversion{} dated \filedate{}.
%    The most recent version can be found at
%    {\ttfamily http://www.graphics.cornell.edu/\~{}dan/texstuff/siggraph/}}}
%
% \author{Daniel Kartch\thanks{dan@graphics.cornell.edu}}
%
% \date{\filedate}
%
% \maketitle
%
% \begin{abstract}
%   This document class modifies the standard |article| class to conform to
%   the specifications for papers published in the proceedings of the annual
%   ACM Siggraph conference.
%   It sets all the necessary layout parameters and handles the differences
%   in format between a paper being submitted for blind review and a camera
%   ready copy of an accepted paper.
%   Several additional features are also provided.
%
%   \vspace{\baselineskip}
%   \begin{quote}
%     DISCLAIMER:  This class is distributed in the hope that it will be useful,
%     and to promote compatibility of documents created at different sites.
%     However it is provided WITHOUT ANY WARRANTY; without even the implied
%     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%     Please see the |siggraph.dtx| source file for copyright and distribution
%     information.
%   \end{quote}
% \end{abstract}
%
% \section{Introduction}
%
% This document describes the |siggraph| document class, for use with \LaTeXe{}.
% It is intended as a replacement for the various versions of the old
% |siggraph.sty| file that have been floating around for years.
% It loads in the |article| class and modifies several parameters
% to comply with the layout specifications for a paper submitted to
% the ACM Siggraph conference.
% Currently, these specifications are:
% \begin{mylist}
%   \label{layoutlist}
%   \item $\frac{3}{4}$ inch margins on top and sides, 1 inch margin on bottom
%   \item two column mode with 2 pica column separation
%   \item space for copyright is 1.5 inch
% \changes{v0.8.1}{1995/03/22}{Made copyright space 1 inch}
% \changes{v1.1.1}{1996/01/17}{Made copyright space 1.5 inch}
%   \item 9 point type on 10 point baselines
%   \item no page numbers
% \changes{v0.6.3}{1995/01/06}{Put page numbers back in for review option}
% \end{mylist}
% Also set by the class but not part of the siggraph specifications are:
% \begin{mylist}
% \changes{v0.6.1}{1994/12/26}{Made titles bold}
%   \item titles and section headings are bold sans serif
%   \item 1 em paragraph indentation
%   \item |flushbottom| mode
% \end{mylist}
%
% The class also allows the user to specify whether the paper is being
% submitted for blind review or as a final, camera-ready document.
% When review mode is specified, it will automatically generate a
% cover sheet for the paper, modify the title block on the first page
% to protect anonymity, and (optionally) switch to a more widely spaced
% layout.
% Mechanisms are also provided to allow the user to introduce text conditional
% on the chosen submission mode.
%
% \section{Usage}
%
% To use this class, specify
% \begin{verbatim} \documentclass{siggraph} \end{verbatim}
% at the beginning of your document.
% The following options may be included in the |\documentclass| command:
%
% \begin{mylist}
%  \item \DescribeMacro{cameraready}|cameraready|,
%	 \DescribeMacro{preprint}|preprint|,
%	 \DescribeMacro{review}|review|, or
%	 \DescribeMacro{widereview}|widereview|
% \changes{v0.7.0}{1995/01/23}{Added widereview option}
% \changes{v1.0.0}{1995/12/18}{Added preprint option}
%	\newline These specify the submission mode for the paper.
%	|cameraready|, the default, sets the layout parameters as
%	described in section~\ref{layoutlist}.
%	The |preprint| option adds page numbers and prints the message
%	``To appear in the SIGGRAPH conference proceedings'' in the top
%	margin.  This message can be changed with the
%	\DescribeMacro{\preprinttext}|\preprinttext{|\meta{message}|}|
%	command.
%	The |review| option uses the same layout as |cameraready| but
%	adds page numbers and modifies the title block as described
%	in the next section.
%	The |widereview| option is for people who prefer review papers
%	that have a more widely spaced layout.
%	It uses one-column mode with 12 point, double-spaced type.
%	Other effects of these options will be described later.
%
%  \item \DescribeMacro{onecolumn}|onecolumn| or
%	 \DescribeMacro{twocolumn}|twocolumn|
% \changes{v0.6.3}{1995/01/09}{Fixed onecolumn option}
%  \item \DescribeMacro{singlespace}|singlespace| or
%	 \DescribeMacro{doublespace}|doublespace|
% \changes{v0.8.3}{1995/03/27}{Added singlespace and doublespace options}
%  \item \DescribeMacro{9pt}|9pt|,
%	 \DescribeMacro{10pt}|10pt|,
%	 \DescribeMacro{11pt}|11pt|, or
%	 \DescribeMacro{12pt}|12pt|
%	\newline These three sets of options will override the default
%	settings for the number of columns, line spacing, and point size
%	determined by the submission mode.
%	Overriding the settings when in camera-ready mode, while allowed,
%	is a violation of the submission specifications and will produce
%	a warning message.
%
%  \item \DescribeMacro{version1996}|version1996| or
%        \DescribeMacro{version1994}|version1994|
%	\newline The submission specifications can change from year to
%         year, and I will try to keep this class updated to match them.
%         However, since many papers are painstakingly typeset to fit
%         the allotted pages exactly, small changes in the format can
%         radically change their appearance.  This class therefore includes
%         a specification date to allow old documents to maintain their
%         appearance even if the specs change.  Although the most recent
%         version is always the default, I recommend including it in the
%         options list anyways, so that you won't have to think about
%         it several years down the road.
%         (The only difference between the 94 and 96 versions is that
%         the space for the copyright is now a half inch larger.)
%
%  \item Additionally, any other options supported by the |article| class
%	may be used, except for |landscape| and |titlepage|, which are
%	disabled.
% \end{mylist}
%	
%
% \section{Title Block, Abstract, and Cover Page}
%
% \subsection{Data fields}
%
% In addition to the |\title| and |\author| commands provided by the |article|
% class, several other pieces of information can be set.
% Each of these commands takes a single argument, the value to which the
% corresponding field should be set.
% \begin{mylist}
%   \item \DescribeMacro{\affiliation}|\affiliation|
%
%       If all the authors share an affiliation, it can be set with this
%       command rather than individually within the author command.
%       The affiliation will appear centered below the author list.
%
%   \item \DescribeMacro{\category}|\category| and
%	  \DescribeMacro{\format}|\format|
% \changes{v1.1.0}{1996/01/08}{Replaced acmcategory/acmformat with
%				category/format. Old versions still enabled.}
%
%	The paper category (research, systems, ...) and format (print, video).
%
%   \item \DescribeMacro{\contactname}|\contactname|,
%	  \DescribeMacro{\contactaddress}|\contactaddress|,
%	  \DescribeMacro{\contactphone}|\contactphone|,
%	  \DescribeMacro{\contactfax}|\contactfax|,
%	  \DescribeMacro{\contactemail}|\contactemail|
%
%	These should be used to set the information about the person to
%	be contacted about the paper.
%
%   \item \DescribeMacro{\passport}|\passport|
% \changes{v1.0.0}{1995/12/18}{Replaced acmpassport with passport.
%				Old version still enabled.}
% \changes{v1.1.0}{1996/01/08}{Disabled passport command; no longer required.}
%
%	The author who will receive compensation if the paper is accepted.
%	\emph{As of 1996, this is no longer requested when submitting papers
%	for review and the command has been disabled.}
%
%   \item \DescribeMacro{\keywords}|\keywords|
% \changes{v1.1.0}{1996/01/08}{Added keywords command}
%
%	A list of keywords to be printed on the cover page
%
%   \item \DescribeMacro{\estpages}|\estpages|
% \changes{v1.1.0}{1996/01/08}{Added estpages command}
%
%	The estimated number of pages that the paper would require in the
%	conference proceedings.
%
% \end{mylist}
%
% \subsection{Title block}
%
% The title block is generated with the normal \LaTeX{}
% \DescribeMacro{\maketitle}|\maketitle| command.
% For a camera ready document it will contain:
% \begin{mylist}
%   \item Title
%   \item Authors
%   \item Affiliation (if any)
% \changes{v0.6.2}{1995/01/05}{Fixed missing affiliation in title block}
% \end{mylist}
%
% For a review paper it will instead contain:
% \begin{mylist}
%   \item Title
%   \item Paper category
% \end{mylist}
% \changes{v1.1.0}{1996/01/08}{Removed paper format from first page of paper.}
% The review options will also suppress printing of any information
% specified with the |\thanks| command.
%
% \changes{v0.9.0}{1994/04/20}{Added teaser}
% Some authors like to include a pretty picture of their results between
% the title block and the start of the text to act as a teaser.
% Because of the way \LaTeX's float placement scheme works, this seemingly
% simple task is apparently impossible to do in a two column document
% without making the picture part of the |\maketitle| command.
% Therefore, that's exactly what I've done.
% The class provides a \DescribeMacro{\teaser}|\teaser{|\meta{figure}|}|
% command, whose contents will appear as a figure centered below the
% title block.
% Theoretically, anything that can appear in a |figure| environment can
% appear here.
% However, the current implementation is a bit of a kludge, so some things
% might not work.
% I've already been told that it isn't compatible with the |float| package.
% I'll see what I can do to improve it when I get the chance.
%
% \changes{v0.9.0}{1994/04/20}{Added \cmd{\titlespace} and \cmd{\teaserspace}}
% The space between the title block text and the rest of the document, and
% between the teaser (if any) and the start of the main text are controlled
% by the length parameters \DescribeMacro{\titlespace}|\titlespace| and
% \DescribeMacro{\teaserspace}|\teaserspace|.
% They both default to $\frac{1}{4}$ inch, but can be changed with the
% normal \LaTeX{} length setting commands.
%
% \subsection{Abstract}
%
% The abstract should be specified with the |abstract| environment.
% In addition to appearing in the paper itself, its contents will stored
% and will appear on the cover page (in review mode).
%
% \subsection{Cover page}
%
% When the |review| or |widereview| option is specified,
% a cover sheet will automatically be generated at the end of the document.
% Placing the \DescribeMacro{\suppresscover}|\suppresscover| command
% in the preamble will prevent this.
% The cover sheet will contain:
% \begin{mylist}
%   \item Title
%   \item Authors
%   \item Affiliation (if any)
%   \item Paper category
%   \item Contact information
%   \item A copy of the abstract
%   \item List of keywords
%   \item Estimated number of pages
% \end{mylist}
%
% \subsection{Obsolete command}
%
% In previous versions of this class, it was necessary to use a command
% called \DescribeMacro{\acmopening}|\acmopening| in place of the
% |\maketitle| command and
% \changes{v0.8.0}{1995/03/07}{Eliminated \cmd{\acmopening} command}
% |abstract| environment in order to get the abstract to appear on the
% cover page as well as in the text.
% This is no longer necessary, and users should switch back to
% the normal commands.
%
%
% \section{Other Features}
%
% \subsection{Copyright notice}
%
% As with the old |siggraph.sty|, this class provides a 
% \DescribeMacro{\copyrightspace}|\copyrightspace|
% command to leave space at the bottom of the first column for the copyright
% notice.
% This command should be placed after the last footnote that will appear in
% the first column.
% As of yet, there is no way to have this done automatically, but I am looking
% into it.
%
% \subsection{Title and section heading font}
%
% By default, this class uses bold sans-serif for the title and
% section heading font.
% This behavior can be altered with the
% \DescribeMacro{\sectionfont}|\sectionfont{|\meta{fontcommands}|}| command.
% \changes{v0.8.3}{1995/03/27}{Added \cmd{\sectionfont} command}
% \meta{fontcommands} should be one or more font changing commands,
% for instance ``|\rmfamily\scshape|'' or ``|\fontfamily{pcr}\selectfont|''.
%
% \subsection{Conditional text}
%
% \DescribeMacro{\ifcamera}\DescribeMacro{\ifreview}
% \DescribeMacro{\ifcameraelse}\DescribeMacro{\ifreviewelse}
% The class also provides the following four commands for writing text
% conditional on whether camera-ready or review mode has been
% chosen:
% \begin{quote}
%	|\ifcamera{|\meta{thenclause}|}|
%
%	|\ifreview{|\meta{thenclause}|}|
%
%	|\ifcameraelse{|\meta{thenclause}|}{|\meta{elseclause}|}|
%
%	|\ifreviewelse{|\meta{thenclause}|}{|\meta{elseclause}|}|
% \end{quote}
% The first two will generate the \meta{thenclause} if camera-ready
% (resp. review) mode is chosen, otherwise they resolve to a null string.
% The second two are the same as the first two but generate the
% \meta{elseclause} instead of a null string if the condition is not met.
%
% These can be used for writing the paper so as to protect anonymity for
% a submission for review, without having to worry about going back over it
% months later to put the identifying information back in if the paper
% is accepted.  For example:
% \begin{quote}^^A
%   |In \cite{FooBar1994}, \ifcameraelse{we}{Foo and Bar} showed that ...|
% \end{quote}
% or
% \begin{quote}^^A
%   |as illustrated in the following \ifcameraelse{three}{two} images:|
%
%   [include generic image]
%
%   |\ifcamera{| [include our logo] |}|
%
%   [include another generic image]
% \end{quote}
%
% \subsection{Configuration file}
%
% Individual users or sites may wish to modify the behavior of this
% class (for instance, to use a particular set of fonts.)
% Rather than having people hack the |.cls| file, which can lead to
% various incompatible versions at different sites, the class provides
% for a configuration file.
% After the class has finished loading, it will check to see if a
% |siggraph.cfg| file exists in the \TeX{} search path.
% If so, it will be input.
% Any user-- or site--specific modifications should be placed in this file.
% \textit{(See the copyright notice in the |siggraph.dtx| source file for
% information on distribution of configuration files.)}
%
% \StopEventually{\PrintChanges}
%
% \iffalse
%<*class>
% \fi
%
% \section{Implementation}
%
% \begin{quote}
% Warning: The implementation is a work in progress and may undergo radical
% alterations before the first non-beta release.  Do not count on any of
% the internal representations remaining the same.  Any suggestions for
% improving any aspects of the implementation are welcome.
% \end{quote}
%
% \subsection{Initial stuff}
%
%  \begin{macro}{\ifacm@camera}
%  \begin{macro}{\acm@columnmode}
%  \begin{macro}{\acm@pointsize}
%  \begin{macro}{\ifacm@doublespaced}
%   First off, we need to initialize a few variables.
%   |acm@camera| is a boolean which determines whether or not we're in
%   camera ready mode.
%   |\acm@preprint|, |\acm@columnmode|, |\acm@pointsize|
%   and |acm@doublespaced| are pretty obvious.
%    \begin{macrocode}
\newif\ifacm@camera
\newif\ifacm@preprint
\newcommand{\acm@columnmode}{}
\newcommand{\acm@pointsize}{}
\newif\ifacm@doublespaced
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \subsection{Option processing}
%
% \subsubsection{Submission mode}
%
%  \begin{macro}{cameraready}
%  \begin{macro}{preprint}
%  \begin{macro}{review}
%  \begin{macro}{widereview}
%   The |cameraready|, |preprint|, |review|, and |widereview| options set the 
%   variables defined above appropriately.
%    \begin{macrocode}
\DeclareOption{cameraready}{%
    \acm@cameratrue%
    \acm@preprintfalse%
    \renewcommand{\acm@columnmode}{twocolumn}%
    \acm@doublespacedfalse%
    \renewcommand{\acm@pointsize}{9pt}}
\DeclareOption{review}{%
    \acm@camerafalse%
    \renewcommand{\acm@columnmode}{twocolumn}%
    \acm@doublespacedfalse%
    \renewcommand{\acm@pointsize}{9pt}}
\DeclareOption{widereview}{%
    \acm@camerafalse%
    \renewcommand{\acm@columnmode}{onecolumn}%
    \acm@doublespacedtrue%
    \renewcommand{\acm@pointsize}{12pt}}
\DeclareOption{preprint}{%
    \acm@preprinttrue}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  By default, |cameraready| mode should be used.
%    \begin{macrocode}
\ExecuteOptions{cameraready}
%    \end{macrocode}
%
% \subsubsection{Layout parameters}
%
%  \begin{macro}{\acm@optwarning}
%   The |\acm@optwarning| command produces a warning message when one
%   tries to override the default layout parameters while in camera-ready
%   mode.
%    \begin{macrocode}
\newcommand{\acm@optwarning}[1]{%
    \ifacm@camera
        \ClassWarningNoLine{siggraph}%
            {#1 option used in camera-ready mode.\MessageBreak
             This violates submission specifications}
    \fi
}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{onecolumn}
%  \begin{macro}{twocolumn}
%  \begin{macro}{9pt}
%  \begin{macro}{10pt}
%  \begin{macro}{11pt}
%  \begin{macro}{12pt}
%  \begin{macro}{doublespace}
%  \begin{macro}{singlespace}
%   The various layout parameters can be set individually, overriding the
%   values set by the specified submission mode.
%    \begin{macrocode}
\DeclareOption{onecolumn}{%
    \acm@optwarning{onecolumn}
    \renewcommand{\acm@columnmode}{onecolumn}}
\DeclareOption{twocolumn}{%
    \renewcommand{\acm@columnmode}{twocolumn}}
\DeclareOption{9pt}{%
    \renewcommand{\acm@pointsize}{9pt}}
\DeclareOption{10pt}{%
    \acm@optwarning{10pt}
    \renewcommand{\acm@pointsize}{10pt}}
\DeclareOption{11pt}{%
    \acm@optwarning{11pt}
    \renewcommand{\acm@pointsize}{11pt}}
\DeclareOption{12pt}{%
    \acm@optwarning{12pt}
    \renewcommand{\acm@pointsize}{12pt}}
\DeclareOption{singlespace}{%
    \acm@doublespacedfalse}
\DeclareOption{doublespace}{%
    \acm@optwarning{doublespace}
    \acm@doublespacedtrue}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \subsubsection{Version}
%
%  \begin{macro}{\acm@specversion}
%  \begin{macro}{version1994}
%  \begin{macro}{version1996}
%   Set the version number.
%    \begin{macrocode}
\newcount\acm@specversion
\DeclareOption{version1996}{\acm@specversion=1996}
\DeclareOption{version1994}{\acm@specversion=1994}
\ExecuteOptions{version1996}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \subsubsection{Remaining options}
%
%  Disable the |titlepage| and |landscape| options, and pass any remaining
%  options on to the |article| class.
%
%    \begin{macrocode}
\DeclareOption{titlepage}{%
    \OptionNotUsed%
    \ClassWarningNoLine{siggraph}{titlepage option not allowed}}
\DeclareOption{landscape}{%
    \OptionNotUsed%
    \ClassWarningNoLine{siggraph}{landscape option not allowed}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
%    \end{macrocode}
%
% \subsubsection{Option processing}
%
%  Process the options, cause the appropriate column and point size options
%  to be passed to the |article| class, and load the |article| class.
%
%    \begin{macrocode}
\ProcessOptions
\PassOptionsToClass{\acm@columnmode}{article}
\ifdim\acm@pointsize>9pt
    \PassOptionsToClass{\acm@pointsize}{article}
\fi
\LoadClass{article}
%    \end{macrocode}
%
% \subsection{Conditional text}
%  \begin{macro}{\preprinttext}
%   Set up default message for preprints and command to change it.
%    \begin{macrocode}
\newcommand{\acm@preprinttext}{To appear in the SIGGRAPH conference proceedings}
\newcommand{\preprinttext}[1]{\renewcommand{\acm@preprinttext}{#1}}
%    \end{macrocode}
%  \end{macro}
%
%
% \subsection{Conditional text}
%
%  \begin{macro}{\ifcamera}
%  \begin{macro}{\ifreview}
%  \begin{macro}{\ifcameraelse}
%  \begin{macro}{\ifreviewelse}
%   Here we define the commands to include text conditionally, based on
%   the submission mode.
%    \begin{macrocode}
\newcommand{\ifcamera}[1]{\ifacm@camera #1 \fi}
\newcommand{\ifreview}[1]{\ifacm@camera \else #1 \fi}
\newcommand{\ifcameraelse}[2]{\ifacm@camera #1 \else #2 \fi}
\newcommand{\ifreviewelse}[2]{\ifacm@camera #2 \else #1 \fi}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \subsection{Page layout}
%
% Set the margins, header and footer sizes, column separation, and indentation.
%
%    \begin{macrocode}
\setlength{\textheight}{9.25in}
\setlength{\topmargin}{-0.700in}
\setlength{\headheight}{0.2in}
\setlength{\headsep}{0.250in}
\setlength{\footskip}{0.5in}
\flushbottom
\setlength{\textwidth}{7in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\setlength{\columnsep}{2pc}
\setlength{\parindent}{1em}
%    \end{macrocode}
%
% Modify plain and empty page styles to turn off page numbering or turn on
%  preprint message.
%
%    \begin{macrocode}
\renewcommand{\ps@plain}%
    {%
    \ifacm@preprint%
	\renewcommand{\@oddhead}{\hfil\textit{\large\acm@preprinttext}\hfil}%
    \else%
	\renewcommand{\@oddhead}{}%
    \fi%
    \ifacm@camera%
	\ifacm@preprint%
	    \renewcommand{\@oddfoot}{\hfil\textrm{\thepage}\hfil}%
	\else%
	    \renewcommand{\@oddfoot}{}%
	\fi%
    \else%
	\renewcommand{\@oddfoot}{\hfil\textrm{\thepage}\hfil}%
    \fi%
    \renewcommand{\@evenhead}{\@oddhead}%
    \renewcommand{\@evenfoot}{\@oddfoot}%
    }
\renewcommand{\ps@empty}%
    {%
    \ifacm@preprint%
	\renewcommand{\@oddhead}{\hfil\textit{\large\acm@preprinttext}\hfil}%
    \else%
	\renewcommand{\@oddhead}{}%
    \fi%
    \renewcommand{\@oddfoot}{}%
    \renewcommand{\@evenhead}{\@oddhead}%
    \renewcommand{\@evenfoot}{\@oddfoot}%
    }
\pagestyle{plain}
%    \end{macrocode}
%
% \subsection{Setting up 9pt point type}
%
% The code in this section is a modified version of that found in the
% |size10.clo| file from the June 1994 \LaTeX{} distribution, with values
% taken from the old |siggraph.sty| file.
%
%  \begin{macro}{\acm@setninepoint}
%   The |\acm@setninepoint| command sets the type size to 9pt.
%    \begin{macrocode}
\newcommand{\acm@setninepoint}{
%    \end{macrocode}
%
%   Redefine |\normalsize| to 9 points.
%
%    \begin{macrocode}
    \renewcommand\normalsize{%
        \@setfontsize\normalsize\@ixpt\@xpt
        \abovedisplayskip 9\p@ \@plus2\p@ \@minus4\p@
        \abovedisplayshortskip \z@ \@plus3\p@
        \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
        \belowdisplayskip \abovedisplayskip
        \let\@listi\@listI}
%    \end{macrocode}
%
%   Redefine |\small| to 8 points.
%
%    \begin{macrocode}
    \renewcommand\small{%
        \@setfontsize\small\@viipt\@ixpt
        \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
        \abovedisplayshortskip \z@ \@plus2\p@
        \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
        \def\@listi{\leftmargin\leftmargini
                    \topsep 4\p@ \@plus2\p@ \@minus2\p@
                    \parsep 2\p@ \@plus\p@ \@minus\p@
                    \itemsep \parsep}%
        \belowdisplayskip \abovedisplayskip}
%    \end{macrocode}
%
%   |\footnotesize|, |\scriptsize|, and |\tiny| remain the same as for
%   10 point documents.
%
%    \begin{macrocode}
    \renewcommand\footnotesize{%
        \@setfontsize\footnotesize\@viiipt{9.5}%
        \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
        \abovedisplayshortskip \z@ \@plus\p@
        \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
        \def\@listi{\leftmargin\leftmargini
                    \topsep 3\p@ \@plus\p@ \@minus\p@
                    \parsep 2\p@ \@plus\p@ \@minus\p@
                    \itemsep \parsep}%
        \belowdisplayskip \abovedisplayskip}
    \renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
    \renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
%    \end{macrocode}
%
%   All the larger than normal sizes get decremented one step from their
%   values in 10 point documents.
%
%    \begin{macrocode}
    \renewcommand\large{\@setfontsize\large\@xpt\@xiipt}
    \renewcommand\Large{\@setfontsize\Large\@xiipt{14}}
    \renewcommand\LARGE{\@setfontsize\LARGE\@xivpt{18}}
    \renewcommand\huge{\@setfontsize\huge\@xviipt{22}}
    \renewcommand\Huge{\@setfontsize\Huge\@xxpt{25}}
%    \end{macrocode}
%
%   To make sure the size changes are loaded immediately, we call |\selectfont|.
%    \begin{macrocode}
    \selectfont
}
%    \end{macrocode}
%  \end{macro}
%
%  If not overridden, set type size to 9 points.
%
%    \begin{macrocode}
\ifdim\acm@pointsize=9pt
    \acm@setninepoint
\fi
%    \end{macrocode}
%
% \subsection{Section headings}
%
%  \begin{macro}{\sectionfont}
%   The |\sectionfont| command lets the user modify the font used for
%   section headings and the title.
%    \begin{macrocode}
\newcommand{\acm@sectionfont}{}
\newcommand{\sectionfont}[1]{\renewcommand{\acm@sectionfont}{#1}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\section}
%  \begin{macro}{\subsection}
%  \begin{macro}{\subsubsection}
%  \begin{macro}{\paragraph}
%  \begin{macro}{\subparagraph}
%   We redefine the section headings to use bold sans serif type plus
%   any modifications set with |\sectionfont|.  (Otherwise
%   these are the same definitions given in the |classes.dtx| file.)
%    \begin{macrocode}
\renewcommand\section{\@startsection {section}{1}{\z@}%
                {-3.5ex \@plus -1ex \@minus -.2ex}%
                {2.3ex \@plus.2ex}%
                {\reset@font\Large\sffamily\bfseries\acm@sectionfont}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                {-3.25ex\@plus -1ex \@minus -.2ex}%
                {1.5ex \@plus .2ex}%
                {\reset@font\large\sffamily\bfseries\acm@sectionfont}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                {-3.25ex\@plus -1ex \@minus -.2ex}%
                {1.5ex \@plus .2ex}%
                {\reset@font\normalsize\sffamily\bfseries\acm@sectionfont}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                {3.25ex \@plus1ex \@minus.2ex}%
                {-1em}%
                {\reset@font\normalsize\sffamily\bfseries\acm@sectionfont}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
                {3.25ex \@plus1ex \@minus .2ex}%
                {-1em}%
                {\reset@font\normalsize\sffamily\bfseries\acm@sectionfont}}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%
%
% \subsection{Title block}
%
%  \begin{macro}{\acm@empty}
%   This is used to check whether the affiliation and teaser have been set.
%    \begin{macrocode}
\newcommand{\acm@empty}{}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\affiliation}
%  \begin{macro}{\acm@affiliation}
%   We define the |\affiliation| macro to set the authors' affiliation,
%   and the |\acm@affiliation| macro to hold it.
%    \begin{macrocode}
\newcommand{\acm@affiliation}{}
\newcommand{\affiliation}[1]{\renewcommand{\acm@affiliation}{#1}}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\category}
%  \begin{macro}{\acm@category}
%  \begin{macro}{\format}
%  \begin{macro}{\acm@format}
%   These macros set and hold the paper's category and format.
%    \begin{macrocode}
\newcommand{\acm@category}{}
\newcommand{\category}[1]{\renewcommand{\acm@category}{#1}}
\newcommand{\acmcategory}[1]{\category{#1}}
\newcommand{\acm@format}{}
\newcommand{\format}[1]{\renewcommand{\acm@format}{#1}}
\newcommand{\acmformat}[1]{\format{#1}}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\teaser}
%  \begin{macro}{\acm@teaser}
%   These macros hold the teaser (if any).
%    \begin{macrocode}
\newcommand{\acm@teaser}{}
\newcommand{\teaser}[1]{\renewcommand{\acm@teaser}{#1}}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\titlespace}
%  \begin{macro}{\teaserspace}
%   We also need to set up lengths for the distance between the title block
%   and teaser from the rest of the text.  We initialize them to
%   $\frac{1}{4}$ inches.
%    \begin{macrocode}
\newlength{\titlespace}
\setlength{\titlespace}{0.25in}
\newlength{\teaserspace}
\setlength{\teaserspace}{0.25in}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\@maketitle}
%   Now we redefine the \@maketitle command to properly format the title block.
%   For camera-ready papers, it should have the title, authors, and affiliation.
%   For review papers, it should have the title, paper category and format,
%   plus all information specified with the |\thanks| command should be
%   suppressed.
%    \begin{macrocode}
\ifacm@camera
    \renewcommand{\@maketitle}{%
        \begin{center}%
            {\LARGE\sffamily\bfseries\acm@sectionfont \@title \par}%
            \vspace{1\baselineskip}%
            \large
            \begin{tabular}[t]{c}%
                \@author
            \end{tabular}\par%
            \ifx\acm@affiliaton\acm@empty \else%
                \vspace{1\baselineskip}%
                \acm@affiliation\par%
            \fi%
            \vspace{\titlespace}%
            \ifx\acm@teaser\acm@empty \else%
                \begingroup%
                    \def\@captype{figure}%
                    \acm@teaser%
                \endgroup\par%
                \vspace{\teaserspace}%
            \fi%
        \end{center} \par%
    }
\else
    \renewcommand{\@maketitle}{%
        \begin{center}%
            \renewcommand{\thanks}[1]{}
            {\LARGE\sffamily\bfseries\acm@sectionfont \@title \par}%
            \vspace{1\baselineskip}%
            {Category: \acm@category \par}%
%            \vspace{0.25\baselineskip}%	% no longer needed (1996)
%            {Format: \acm@format \par}%	% no longer needed (1996)
            \vspace{\titlespace}%
            \ifx\acm@teaser\acm@empty \else%
                \begingroup%
                    \def\@captype{figure}%
                    \acm@teaser%
                \endgroup\par%
                \vspace{\teaserspace}%
            \fi%
        \end{center} \par%
    }
\fi
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\maketitle}
%   We also need to make several modifications to the |\maketitle| command.
%   Since |\maketitle| wipes out the values of the title, author, etc\ldots,
%   we have to make sure a copy gets saved.
%   After the title block is output,
%   the page numbering for the first page should be turned off, and
%   double spacing, if selected, should be turned on.
%    \begin{macrocode}
\let\acm@origmaketitle\maketitle
\renewcommand{\maketitle}{%
    \let\acm@title\@title%
    \let\acm@author\@author%
    \acm@origmaketitle%
    \thispagestyle{empty}%
    \ifacm@doublespaced%
        \renewcommand{\baselinestretch}{1.66}\selectfont%
    \fi
}
%    \end{macrocode}
%  \end{macro}
%
%
%
% \subsection{Capturing the abstract}
%
%  \begin{environment}{abstract}
%   In order to have the abstract appear on the cover sheet, we need to
%   redefine the |abstract| environment to store its contents so that
%   the can be used later.
%   This seemingly trivial problem is actually quite difficult.
%   The code to do it is a modified version of the |\@collectbody| stuff
%   from the AMS-\LaTeX{} source code.
%   See that code for a more detailed explanation of how it works.
%
%  \begin{macro}{\acm@abs}
%   The |\acm@abs| token list is used to store the text of the abstract.
%    \begin{macrocode}
\newtoks\acm@abs
%    \end{macrocode}
%  \end{macro}
%
%   We only make these modifications if we are in review mode.
%    \begin{macrocode}
\ifacm@camera\else
%    \end{macrocode}
%
%  \begin{macro}{\acm@add}
%   The |\acm@add| command appends its argument to |\acm@abs|.
%    \begin{macrocode}
    \long\def\acm@add#1{\global\acm@abs\expandafter{\the\acm@abs#1}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\acm@collect}
%  \begin{macro}{\acm@@collect}
%   The |\acm@collect| and |\acm@@collect| commands scan the input for the
%   |\end{abstract}| command and place all input tokens leading up to it
%   into |\acm@abs|.
%    \begin{macrocode}
    \long\def\acm@collect{%
        \global\acm@abs{}%
        \let\abstract\acm@@collect
        \abstract
    }
    \long\def\acm@@collect#1\end#2{%
        \def\@tempa{#2}%
        \ifx\@tempa\@currenvir
            \acm@add{#1}%
            \edef\abstract{\noexpand\end{\@tempa}}%
        \else
            \acm@add{#1\end{#2}}%
        \fi
        \abstract
    }
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\acm@modify}
%   The |\acm@modify| command makes the actual modifications to the |abstract|
%   environment.
%   The new |abstract| stores its contents with the above macros, then
%   outputs the abstract using its original definition.
%    \begin{macrocode}
    \newcommand{\acm@modify}{%
        \let\acm@origabs\abstract%
        \let\acm@origendabs\endabstract%
        \renewenvironment{abstract}%
            {\acm@collect}%
            {\begingroup
                \let\abstract\acm@origabs
                \let\endabstract\acm@origendabs
                \begin{abstract} \the\acm@abs \end{abstract}
            \endgroup}%
    }
%    \end{macrocode}
%  \end{macro}
%
%  We want to allow the user to redefine the appearance of the |abstract|
%  environment however he/she likes, so we hold off actually making the 
%  modifications to |abstract| until after the preamble.
%    \begin{macrocode}
    \AtBeginDocument{\acm@modify}
%    \end{macrocode}
%
%  End of review mode conditional:
%    \begin{macrocode}
\fi
%    \end{macrocode}
%  \end{environment}
%
%
%
% \subsection{Copyright notice and footnote rule}
%
%  \begin{macro}{\copyrightspace}
%   The |\copyrightspace| macro creates an empty footnote tall enough
%   for the copyright notice.
%    \begin{macrocode}
\newlength{\acm@copyrightlength}
\ifnum\acm@specversion=1994
    \setlength{\acm@copyrightlength}{1in}
\else
    \setlength{\acm@copyrightlength}{1.5in}
\fi
\newcommand{\copyrightspace}{%
    \renewcommand{\thefootnote}{}%
    \footnotetext[0]{\rule[\acm@copyrightlength]{2.71828in}{0in}}%
    \renewcommand{\thefootnote}{\arabic{footnote}}
}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\footnoterule}
%   I wanted a way to tell how many of the papers published in Siggraph
%   are using my class, so I changed the size of the footnote rule from 40\%
%   of the column width to 45\%.
%   This doesn't make a noticable change in the paper's appearance, but
%   can be quickly checked with a ruler.
%   Thanks go to the devious little mind of Pete Shirley for suggesting
%   this sneaky hack.
%    \begin{macrocode}
\renewcommand{\footnoterule}{%
    \kern-3pt
    \hrule width 0.45\columnwidth
    \kern 2.6pt}
%    \end{macrocode}
%  \end{macro}
%
%
%
% \subsection{Cover page}
% 
%  \begin{macro}{\contactname}
%  \begin{macro}{\acm@contactname}
%  \begin{macro}{\contactaddress}
%  \begin{macro}{\acm@contactaddress}
%  \begin{macro}{\contactphone}
%  \begin{macro}{\acm@contactphone}
%  \begin{macro}{\contactfax}
%  \begin{macro}{\acm@contactfax}
%  \begin{macro}{\contactemail}
%  \begin{macro}{\acm@contactemail}
%  \begin{macro}{\passport}
%  \begin{macro}{\acm@passport}
%  \begin{macro}{\acmpassport}
%  \begin{macro}{\keywords}
%  \begin{macro}{\acm@keywords}
%  \begin{macro}{\estpages}
%  \begin{macro}{\acm@estpages}
%   We define macros to set and hold all the information about the person
%   to be contacted about the paper and the author to receive compensation.
%    \begin{macrocode}
\newcommand{\acm@contactname}{}
\newcommand{\contactname}[1]{\renewcommand{\acm@contactname}{#1}}
\newcommand{\acm@contactaddress}{}
\newcommand{\contactaddress}[1]{\renewcommand{\acm@contactaddress}{#1}}
\newcommand{\acm@contactphone}{}
\newcommand{\contactphone}[1]{\renewcommand{\acm@contactphone}{#1}}
\newcommand{\acm@contactfax}{}
\newcommand{\contactfax}[1]{\renewcommand{\acm@contactfax}{#1}}
\newcommand{\acm@contactemail}{}
\newcommand{\contactemail}[1]{\renewcommand{\acm@contactemail}{#1}}
%\newcommand{\acm@passport}{}
%\newcommand{\passport}[1]{\renewcommand{\acm@passport}{#1}}
\newcommand{\passport}[1]{%
  \ClassWarningNoLine{siggraph}{%
    You no longer need to specify which author should \MessageBreak%
    receive a free conference passport when submitting \MessageBreak%
    papers for review.\MessageBreak%
    The passport command has therefore been disabled}}
\newcommand{\acmpassport}[1]{\passport{#1}}
\newcommand{\acm@keywords}{}
\newcommand{\keywords}[1]{\renewcommand{\acm@keywords}{#1}}
\newcommand{\acm@estpages}{}
\newcommand{\estpages}[1]{\renewcommand{\acm@estpages}{#1}}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{acm@cover}
%   Set up a control to determine whether or not to print the cover page.
%    \begin{macrocode}
\newif\ifacm@cover
\ifacm@camera
    \acm@coverfalse
\else
    \acm@covertrue
\fi
\newcommand{\suppresscover}{\acm@coverfalse}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\acm@coverpage}
%   The |\acm@coverpage| macro handles the formatting of the cover page.
%    \begin{macrocode}
\newcommand{\acm@coverpage}{%
    \begin{titlepage}%
        \def\thanks##1{}
        \acm@setninepoint\normalsize
        \renewcommand{\baselinestretch}{1}\selectfont
        \begin{center}%
            \vspace*{\fill}
            {\LARGE\sffamily\bfseries\acm@sectionfont \acm@title \par}%
            \vspace{2\baselineskip}%
            {\large
                \begin{tabular}[t]{c}%
                \acm@author
             \end{tabular}\par%
            }%
            \vspace{1\baselineskip}%
            {\large \acm@affiliation \par}%
            \addvspace{3\baselineskip}%
            {Category: \acm@category \par}%
            \vspace{0.5\baselineskip}%
            {Format: \acm@format \par}%
            \vspace{3\baselineskip}%
            \begin{tabular}{ll}
                Contact: & \acm@contactname \\[1\baselineskip]
                         & \begin{tabular}[b]{@{}l@{}}
                               \acm@contactaddress
                               \end{tabular} \\[1\baselineskip]
                phone: & \acm@contactphone \\
                fax: & \acm@contactfax \\
                email: & \acm@contactemail
            \end{tabular}\par%
%            \vspace{3\baselineskip}%
%            Author to receive compensation: \acm@passport \par%
            \vspace*{3\baselineskip}%
            {Estimated \# of pages: \acm@estpages \par}%
            \vspace*{\baselineskip}%
            {Keywords: \acm@keywords \par}%
            \vspace*{\fill}%
            \begin{minipage}{5in}%
                \the\acm@abs
            \end{minipage}\par%
            \vspace*{\fill}
        \end{center}%
    \end{titlepage}%
}
%    \end{macrocode}
%  \end{macro}
%
% We cause the cover page to be generated at the end of the paper.
%    \begin{macrocode}
\AtEndDocument{\ifacm@cover \acm@coverpage \fi}
%    \end{macrocode}
%
%
%
% \subsection{Obsolete commands}
%
% The |\acmopening| command was needed before I figured out how to
% get the abstract environment to save its contents.   It is no longer
% used, and now produces an error message.
% 
%    \begin{macrocode}
\newcommand{\acmopening}[1]{%
  \ClassError{siggraph}{%
    The acmopening command is no longer needed.\MessageBreak%
    Switch to the maketitle command and abstract environment}{}}
%    \end{macrocode}
%
% \subsection{Configurations file}
%
% Finally, we load the configuration file if it exists.
%
%    \begin{macrocode}
\InputIfFileExists{siggraph.cfg}
        {\typeout{***************************************^^J%
                  * Local config file siggraph.cfg used *^^J%
                  ***************************************}}
        {}
%    \end{macrocode}
%
% \iffalse
%</class>
% \fi
%
% \Finale
