%  A LaTeX2e class for doing HCI Conference proceedings.
%
% This is not the class actually use to generate the CRC for HCI
% conference proceedings.  Two reasons:
%
%  1.  This class needs to deal with papers as stand alone documents
%  and not componenets within an overall proceedings.
%  2.  The class used in the final CRC production is an integral part
%  of a macro library and it is not sensible to issue the whole
%  library.
%
%  This class is based as much as possible on the ``real'' one so that
%  the the typeset format achieved using this class is very close
%  indeed if not identical to the final format.
%
%  Copyright (c) 2001, 2005 Russel Winder
%
\def \fileversion{v1.2}
\def \filedate{2005/04/28}
\def \docdate{\filedate}
%
%  Essentially a standard looking LaTeX2e document with a few preamble
%  additions:
%
%  \documentclass{hci_proceedings}
%  \usepackage{natbib}  %%  Remove if not using BibTeX.
%  \title{...}
%  \author{...}
%  \address{...}
%  \telephone{...}
%  \fax{...}
%  \email{...}
%  \url{...}
%  \keywords{...}
%  \bibliographystyle{rnmdt}  %%  Remove if not using BibTeX.
%  \begin{document}
%  \maketitle
%  \begin{abstract}
%   ...
%  \end{abstract}
%   ...
%  {\small \bibliography{...}}  %%  Remove if not using BibTeX but note that
%                               %%  references are typeset in \small font.
%  \end{document}
%
%  \title{..} and \author{...} can actually appear as \title[...]{...}
%  and \author[...]{...}.  The part inside the square brackets will be
%  used for the running heads instead of the part in the curly braces
%  which is the title and author list used on the title page; this is
%  for the cases where the title and/or author list are too long to be
%  running heads, running heads can be defined explicitly.
%
%  If there are multiple authors then name all the authors in the
%  \author{...} macro.  If there are miltiplt addresses the do
%  something along the lines of:
%
%  \documentclass{hci_proceedings}
%  \usepackage{natbib}  %%  Remove if not using BibTeX.
%  \title{...}
%  \author{First Author$^\dagger$ ,
%     Second Author$^\dagger$  and 
%    Third Author$^\ddagger$}
%  \address{$^\dagger$  First address}
%  \telephone{First telephone number}
%  \fax{First fax number}
%  \emailfirst email}
%  \url{First URL}
%  \keywords{...}
%  \bibliographystyle{rnmdt}  %%  Remove if not using BibTeX.
%  \begin{document}
%  \maketitle
%  \contactdetails{}{$^\ddagger$ Second address}{Second telephone
%      number}{Second fax number}{Second email}{Second URL}
%  \begin{abstract}
%   ...
%  \end{abstract}
%   ...
%  {\small \bibliography{...}}  %%  Remove if not using BibTeX but note that
%                               %%  references are typeset in \small font.
%  \end{document}
%
%
%  The rnmdt.bst file required for correct formatting of citations
%  can be found at http://www.winder.org.uk/HCI_support/rnmdt.bst.
%  The Natbib citation macros should be used which means that
%  \citep{XXX} results in (xxx, ddd) type citations.  If you want
%  xxx (ddd) type citations use \citet{XXX}.
%
%  If anyone finds any errors or wants to comment on this file please
%  contact me: russel@winder.org.uk.
%
\NeedsTeXFormat{LaTeX2e}[1997/12/01]
\ProvidesClass{hci_proceedings}[\filedate\space\fileversion\space HCI
Conference Proceedings class]
\DeclareOption{twocolumn}{%
    \ClassError{hci_proceedings}{Option `twocolumn' not supported}{}}
\PassOptionsToClass{10pt,a4paper,onecolumn}{book}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions
\LoadClass{book}
\RequirePackage{times}
\RequirePackage{mathptm}
\RequirePackage{multicol}
\RequirePackage{a4}
\def \title{\@ifnextchar[{\@gettitletwo}{\@gettitleone}}
\def \@gettitleone#1{\@gettitletwo[#1]{#1}}
\def \@gettitletwo[#1]#2{{%
    \gdef \@title{#2}%
    \def \thanks##1{\relax}%
    \def \\{\unskip \space \ignorespaces}%
    \xdef \@titlehead{#1}%
}}
\def \author{\@ifnextchar[{\@getauthortwo}{\@getauthorone}}
\def \@getauthorone#1{\@getauthortwo[#1]{#1}}
\def \@getauthortwo[#1]#2{{%
    \global \let \latexand \and%
    \gdef \and{\space \@authorand \space \ignorespaces}%
    \gdef \@author{#2}%
    \def \and{\unskip \space \@authorand \space \ignorespaces}%
    \def \thanks##1{\relax}%
    \def \\{\unskip \space \ignorespaces}%
    \xdef \@authorhead{#1}%
    \gdef \@@author{#2}%
}}
\def \@name{}
\def \@address{}
\def \@telephone{}
\def \@fax{}
\def \@email{}
\def \@url{}
\newcommand \@contactdetails[6]{%
    \gdef \@name{#1}%
    \gdef \@address{#2}%
    \gdef \@telephone{#3}%
    \gdef \@fax{#4}%
    \gdef \@email{#5}%
    \gdef \@url{#6}%
}
\let \contactdetails \@contactdetails
\newcommand \address[1]{\gdef\@address{#1}}
\newcommand \telephone[1]{\gdef \@telephone{#1}}
\newcommand \fax[1]{\gdef \@fax{#1}}
\newcommand \email[1]{\gdef \@email{#1}}
\newcommand \url[1]{\gdef \@url{#1}}
\newcommand \keywords[1]{\gdef \@keywords{#1}}%
\renewcommand \thesection{\arabic{section}}%
\renewcommand \theequation{\arabic{equation}}%
\renewcommand \thefigure{\arabic{figure}}%
\renewcommand \thetable{\arabic{table}}%
\def \section{\@startsection{section}{1}{\z@}{-2ex \@plus -.4ex \@minus 
 -.2ex}{1ex \@plus .1ex \@minus .1ex}{\sectionheadfont}}
\def \subsection{\@startsection{subsection}{2}{\z@}{-1ex \@plus -.3ex \@minus 
 -.2ex}{.5ex \@plus .1ex \@minus .1ex}{\subsectionheadfont}}
\def \subsubsection{\@startsection{subsubsection}{3}{\z@}{-.75ex \@plus 
 -.2ex \@minus -.2ex}{.3ex \@plus .1ex \@minus .1ex}{\subsubsectionheadfont}}
\setcounter{secnumdepth}{3}
\def \ps@paper{%
    \let \@mkboth \papermarkboth%
    \def \@oddhead{\rightmark}%
    \def \@oddfoot{}%
    \def \@evenhead{\leftmark}%
    \def \@evenfoot{}%
    \let \chaptermark \@gobble%
    \let \sectionmark \@gobble%
}
\let \ps@plain \ps@empty
\hyphenpenalty = \@M
\tolerance = \@m
\emergencystretch = 20\p@
\hfuzz = 2\p@
\vfuzz = 2\p@
\renewcommand \footnoterule {%
    \kern -3\p@%
    \hrule%
    \kern 2.6\p@%
}
\setlength \parskip{\z@ \@plus 1\p@}
\setlength \parindent{2em}
\setlength \headsep{16\p@}
\setlength \partopsep{1\p@ \@minus 1\p@}
\setlength \topsep{\z@}
\setlength \footskip{26\p@}
\renewcommand \topfraction{.85}
\renewcommand \textfraction{.15}
\renewcommand \floatpagefraction{.75}
\renewcommand \bibname{References}
\renewenvironment{thebibliography}[1]{%
    \section*{\bibname}%
    \list{\@biblabel{\arabic{enumiv}}}%
         {\settowidth\labelwidth{\@biblabel{#1}}%
          \leftmargin \labelwidth%
          \advance \leftmargin \labelsep%
          \@openbib@code%
          \usecounter{enumiv}%
          \let \p@enumiv \@empty%
          \renewcommand \theenumiv{\arabic{enumiv}}}%
    \small%
    \sloppy%
    \clubpenalty 4000%
    \widowpenalty 4000%
    \sfcode `\.=\@m%
    \relax%
}{%
    \def \@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
    \endlist%
}
\newcommand \papermarkboth[2]{%
    \markboth{\noexpand \small \itshape \noexpand \thepage \hfill #1}%
             {\noexpand \small \itshape #2\hfill \noexpand \thepage}%
}
\pagestyle{paper}
\setlength \textwidth{118 true mm}
\setlength \textheight{192 true mm}
\newcommand \@authorand{\&}
\newlength{\@titleindent}
\setlength \@titleindent {\parindent}
\newenvironment{@titlesp}{%
    \list{}{\leftmargin \@titleindent}\item[]%
}{%
    \endlist%
}
\renewcommand \maketitle{%
  \begin{@titlesp}%
    \renewcommand \thefootnote{\fnsymbol{footnote}}%
    \def \@makefnmark{\hb@xt@ \z@{$\m@th^{\@thefnmark}$\hss}}%
    \long \def \@makefntext##1{\parindent 1em\noindent
            \hb@xt@ 1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
    \setcounter{footnote}{1}%
    \thispagestyle{empty}%
    \vspace*{3\bigskipamount}%
    {\LARGE \itshape \begin{flushleft} \@title \end{flushleft}}%
    \vspace*{\medskipamount}%
    {\Large \bfseries \begin{flushleft} \@author \end{flushleft}}%
    \vspace*{\medskipamount}%
    \@docontactdetails{\@address}{\@telephone}{\@fax}{\@email}{\@url}%
  \end{@titlesp}%
  \@mkboth{\@authorhead}{\@titlehead}%
}
\def\@makechapterhead#1{%
  \begin{@titlesp}%
    \vspace*{3\bigskipamount}%
    {\huge \itshape \begin{flushleft} #1 \end{flushleft}}%
    \vspace*{3\bigskipamount}%
  \end{@titlesp}%
}
\let \@makeschapterhead = \@makechapterhead
\newcommand \@@contactdetails[6]{%
    \begin{@titlesp}%
        \vspace*{-\medskipamount}%
        \@docontactdetails{#2}{#3}{#4}{#5}{#6}%
    \end{@titlesp}%
}
\newcommand \@docontactdetails[5]{%
    {\large%
     {\itshape \begin{flushleft} #1 \end{flushleft}}%
     \vspace*{\smallskipamount}%
     \setbox0 = \hbox{#2}%
     \ifdim \wd0 > \z@%
        Tel: {\notsolarge \textit{#2}}%
        \\*[\smallskipamount]%
     \fi%
     \setbox0 = \hbox{#3}%
     \ifdim \wd0 > \z@%
        Fax: {\notsolarge \textit{#3}}%
        \\*[\smallskipamount]%
     \fi%
     \setbox0 = \hbox{#4}%
     \ifdim \wd0 > \z@%
        Email: \textit{#4}%
        \\*[\smallskipamount]%
     \fi%
     \setbox0 = \hbox{#5}%
     \ifdim \wd0 > \z@%
        URL: \textit{#5}%
        \\*[\smallskipamount]%
     \fi%
    }%
    \global \let \contactdetails \@@contactdetails%
}
\newenvironment{abstract}{%
  \vspace*{-\bigskipamount}%
  \begin{@titlesp}%
    \bfseries%
    \let \acronym = \aacronym%
}{%
    \par%
    \bigskip%
    \mdseries%
    \setbox0 = \hbox{\@keywords}%
    \ifdim \wd0 > \z@%
        \newdimen \@keywordspace%
        \@keywordspace \hsize%
        \advance \@keywordspace by -\@titleindent%
        \def \@keywordtag{\textbf{Keywords:}\ }%
        \setbox0 = \hbox{\@keywordtag}%
        \advance \@keywordspace by -\wd0%
        \advance \@keywordspace by -2\p@%
        \@keywordtag \parbox[t]{\@keywordspace}{\@keywords}%
    \fi%
    \medskip%
  \end{@titlesp}%
}
\newcommand \notsolarge {\@setfontsize\notsolarge{11}{13}}
\def \sectionheadfont{\large\bfseries}
\def \subsectionheadfont{\large\bfseries\itshape}
\def \subsubsectionheadfont{\notsolarge\itshape}
\renewcommand \thefootnote{\fnsymbol{footnote}}%

\newcommand \acronym[1]{{\small #1}}
\newcommand \aacronym[1]{{\small\textbf{#1}}}
\newcommand \facronym[1]{{\scriptsize #1}}
