%% iccbb.cls - Version 00.00.01
%% LaTeX2e class file to format manuscript for ICCBB Proceedings
%  requires following LaTeX packages:
%  graphicx.sty
%  amssymb.sty
%  amsmath.sty
%  bm.sty
%  fancyhdr.sty
%  geometry.sty
%
% maketitle code inspired by sigplanconf.cls
% Author: Robert Cimrman, with help of Vladimir Lukes
%
% Changes:
% - 25.04.2007, c
% - 26.04.2007
% - 28.04.2007
% - 02.05.2007
% - 03.05.2007
% - 30.05.2007
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{iccbb}[25/04/2007 ICCBB 2007 proceedings class]

\DeclareOption*{%
   \PassOptionsToClass{\CurrentOption}{article}%
}
\ProcessOptions\relax

\LoadClass[a4paper,12pt]{article}

\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{graphicx}
\RequirePackage{fancyhdr}
\RequirePackage{bm}
%\RequirePackage{natbib}
\RequirePackage[a4paper, 
                left=25mm, width =160mm,
                top =25mm, height=250mm]{geometry}

\renewcommand{\figurename}{Fig.}
\renewcommand{\tablename}{Tab.}

\newcommand{\headings}[2] {
  \pagestyle{fancy}
  \fancyhead{}
  \fancyhead[LE]{\textbf{\textsf{#1}}}
  \fancyhead[RO]{\textbf{\textsf{#2}}}
  \fancyfoot{}
%   \fancypagestyle{plain}{
%     \fancyhf{}
%     \renewcommand{\headrulewidth}{0pt}
%     \renewcommand{\footrulewidth}{0pt}
%   }
}

\newcommand{\acknowledgement}[1] {
  \vspace{3mm}
  \noindent
  \textbf{Acknowledgement:} #1
  \par
}

\def \@discardtok #1{}%                                  token
\def \@name #1{%                                        {\tokens}
  \csname \expandafter\@discardtok \string#1\endcsname}
\def \@withname #1#2{%                                  {\command}{\tokens}
  \expandafter#1\csname \expandafter\@discardtok \string#2\endcsname}
\def \@increment #1{\advance #1 by 1\relax}%             {\count}

% Title page.
\def \@titletext {\@latex@error{No title was provided}{}}
\def \@subtitletext {}

\newcount{\@authorcount}
\newcount{\@authorindex}

\newcount{\@affilcount}
\newcount{\@affilindex}

\renewcommand{\title}[1]{%
  \gdef \@titletext {#1}
}

\newcommand{\subtitle}[1]{%
  \gdef \@subtitletext {#1}
}

\newcommand{\articleid}[1] {
  \@withname\gdef {\@articleid}{#1}
}

\newcommand{\authorinfo}[2] {
  \global\@increment \@authorcount
  \@withname\gdef {\@authorname\the\@authorcount}{#1}
  \@withname\gdef {\@authoraffil\the\@authorcount}{#2}
}

\newcommand{\affiliation}[3] {
  \global\@increment \@affilcount
  \@withname\gdef {\@affilident\the\@affilcount}{#1}
  \@withname\gdef {\@affilemail\the\@affilcount}{#2}
  \@withname\gdef {\@affiltext\the\@affilcount}{#3}
}

\renewcommand{\author}[1]{%
  \@latex@error{The \string\author\space command is obsolete;
                use \string\authorinfo}{}
}

\renewcommand{\maketitle}{%
  \@maketitle
}

\def \@settitlebanner {%
  \vspace*{-17mm}
  \centering
  \begin{minipage}{0.25\linewidth}
    \includegraphics[width=0.9\linewidth]{logo_iccbb2007}
  \end{minipage}
  \hfill
  \begin{minipage}{0.57\linewidth}
    \vspace*{4mm}
    \textsf{Short Communication of the
      International Conference \\ on Computational Biomechanics and Biology, \\
      September 10--13, 2007, Plze\v{n}, Czech Republic \\
      University of West Bohemia}
  \end{minipage}
  \hfill
  \begin{minipage}{0.15\linewidth}
    \vspace{-11mm}
    \hfill\textsf{\textbf{\#\@articleid}}
  \end{minipage}
  \par
  \vspace*{5mm}
}

\def \@maketitle {%
  \begin{center}
  \@settitlebanner
  \let \thanks = \titlenote
  \noindent \LARGE \bfseries \@titletext \par
  \vskip 6pt
  \noindent \Large \@subtitletext \par
  \vskip 18pt
  \noindent
  \ifcase \@authorcount
     \@latex@error{No authors were specified for this paper}{}\or
  \fi
  \global\@authorindex=0
  \@authorloop
  \vspace{5mm}
  \noindent
  \ifcase \@affilcount
     \@latex@error{No affiliations were specified for this paper}{}\or
  \fi
  \global\@affilindex=0
  \@affilloop
  \vspace{2mm}
  \end{center}}

\def \@authorloop {%
  \relax\ifnum\@authorindex<\@authorcount\@increment{\@authorindex}
    \@setauthor{\the\@authorindex}
    \@authorloop
  \fi
}

\def \@affilloop {
  \relax\ifnum\@affilindex<\@affilcount\@increment{\@affilindex}
     \@setaffil{\the\@affilindex}
     \vspace{15pt}
     \@affilloop
  \fi
}

\def \@setauthor#1 {
  \large \mbox{\@name{\@authorname#1}$^{\@name{\@authoraffil#1}}$}
}

\def \@setaffil#1 {
  \par
  \normalfont
  \normalsize$^{\@name{\@affilident#1}}$\@name{\@affiltext#1}\par
  \vspace{2pt}
  \textsf{\@name{\@affilemail#1}}
}

\AtBeginDocument{
  \pagestyle{fancy}
  \fancyhead{}
  \fancyhead[C]{\textsf{ ICCBB 2007, September 10--13, 2007, Plze\v{n}}}
  \fancyfoot{}
  \thispagestyle{empty}
  \bibliographystyle{rcfplain}
}
