\NeedsTeXFormat {LaTeX2e}[2001/06/01]
\def \filename {modsim07.sty}
\def \filedate {05-May-2005}
\def \fileversion {1.0}
\ProvidesPackage {modsim07}

\typeout{Document Style Option `modsim07' for latex2e \fileversion\space\filedate\space by Dr. Glen Yu-Chu Tian.}
\typeout{Note that this tries to fulfill the requirements of the files for MODSIM07.}

% Author: Dr. Glen Yu-Chu Tian
%         School of Software Engineering and Data Communications
%         Faculty of Information Technology
%         GPO Box 2434, Brisbane 4001
%         Australia
%         E-Mail: y.tian@qut.edu.au
%         URL:    http://www.fit.qut.edu.au/~tian
% The package is provided ``AS IS" without express or implied warranty.
% It should be mentioned that:
%   1. The author is not responsible for the consequences of using this style file.
%   2. Modification is allowed to the style fle provided the modified version is marked as such and
%   3. This notice is to remain intact.

%% First thing we do is to make sure that documentclass "article" has been loaded.
%% A common error is to try to use modsim07 as a documentstyle rather than a package.
\@ifundefined{title}{\@latexerr{The `modsim07' option should be used
as a package with the document class `article'}{You may want to read the
modsim07 documentation.}}{}

%----------use times font----------
\usepackage{times}

%--------set page layout----------
       %useless: left 2.5cm, right 2cm, top 2cm, bottom 2cm
%margins: left 30mm, right 25mm, top 25mm, bottom 30mm
\setlength{\oddsidemargin}{1.6mm}
\setlength{\evensidemargin}{1.6mm}
\setlength{\topmargin}{-19.4mm}
\setlength{\textwidth}{161mm}  % seems should be {155mm}
\setlength{\textheight}{252mm} % seems should be {242mm}
\setlength{\parindent}{0pt}
\setlength{\parskip}{12pt}
\twocolumn
\setlength{\columnsep}{10mm}
\sloppy
\flushbottom
\pagestyle{empty}

%----------set brokenpenalty-------
% Disallow page breaks at hyphens (this will give some underfull vbox's,
% so an alternative is to use \brokenpenalty=100 and manually search
% for and fix such page breaks)
\brokenpenalty=9000

%----------set hypenpenalty-------
% Disallow hyphens (this will give some underfull vbox's,so an alternative
% is to use disable this setting to allow default hyphenpenalty
\hyphenpenalty=9000

%----------set normalsize to 10pt
\def\@normalsize{\@setsize\normalsize{11.9pt}\xpt\@xpt}

%---------Define \institute and \keywords -----------
\def\institute#1{\gdef\@institute{#1}}
%\def\@institute{Institute}
\def\keywords#1{\gdef\@keywords{#1}}
%\def\@keywords{keywords}

%---------Define \maketitle---------
\def\maketitle{\par
 \begingroup
 \def\@makefnmark{\hbox{$^{\@thefnmark}$\hss}}
 \if@twocolumn
 \twocolumn[\@maketitle]
 \else \newpage
 \global\@topnum\z@ \@maketitle \fi\pagestyle{myheadings}\@thanks
 \endgroup
 \setcounter{footnote}{0}
 \let\maketitle\relax
 \let\@maketitle\relax
 \gdef\@keywords\gdef\@institute\gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}

\def\@maketitle{\newpage
 \null \vskip 0pt %.3em
\begin{center}
 {\LARGE\bf \@title \par} \vskip 12pt {\normalsize \lineskip 12pt %.5em
 \begin{tabular}[t]{c}\textbf{\@author}\\[12pt]
\@institute\\[12pt]
\textit{\textbf{Keywords:} \@keywords}
 \end{tabular}\par}
 \end{center}
 \par
% \vskip 1.5em
}

%-----------Renew \abstract----------
\renewcommand{\abstract}{\noindent\textbf{ABSTRACT}\par}

%-----------Renew \section and \subsection--------
%--------renewcommands--------

%section & subsection ****
\renewcommand{\section}{%
    \@startsection{section}{1}{\z@}%
      {-0.5\baselineskip \@plus -.4\baselineskip \@minus -.2\baselineskip}%
      %{0.5ex \@plus .3ex \@minus -.2ex}%
    {0.5\baselineskip  \@plus 0.3\baselineskip \@minus -0.1\baselineskip}%
      {\normalfont\normalsize\bfseries\uppercase}
    }
\renewcommand{\subsection}{%
    \@startsection{subsection}{2}{\z@}% put B infront of the section title
      {-0.5\baselineskip \@plus -.4\baselineskip \@minus -.2\baselineskip}%
      % {0.3ex \@plus .2ex \@minus -.2ex}%
    {0.5\baselineskip \@plus 0.3\baselineskip \@minus -0.1\baselineskip}%
      {\normalfont\normalsize\bfseries}
}

%---------------------Renew Caption format----------------
\renewcommand{\@makecaption}[2]{%
	\setlength{\abovecaptionskip}{0.3\baselineskip}
	\vskip\abovecaptionskip %
	\sbox\@tempboxa{\normalsize\textbf{#1.}~#2}%
	\ifdim \wd\@tempboxa >\hsize
		\normalsize \textbf{#1.}~#2\par
	\else
		\global \@minipagefalse
		\hb@xt@\hsize{%
			\hfill\box\@tempboxa\hfill}%
	\fi
	\setlength{\belowcaptionskip}{0.3\baselineskip}
	\vskip\belowcaptionskip
}

%----------new command \ack and \acknowledegment
\def\ack#1{\section{Acknowledgement}#1}

%--------------renew thebibliography----------
\def\@biblabel#1{}
%\renewcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}

\def\thebibliography{%
\newlength{\refindent}
\setlength{\refindent}{5mm} %6.3mm
\def\refname{REFERENCES}
\section{\uppercase{\refname}}
  \@thebibliography}
\let\endthebibliography=\endlist
\def\@thebibliography#1{%\@bibliosize
  \list{\@biblabel{\arabic{enumiv}}}{
  \settowidth\labelwidth{\@biblabel{#1}}
  \labelwidth\z@ \labelsep\z@ \leftmargin\refindent %6.3mm% \parindent
  \itemindent-\refindent %6.3mm %\parindent
  \itemsep \z@ \@plus 0.5\p@ \@minus 0.5\p@
  \usecounter{enumiv}\let\p@enumiv\@empty
  \def\theenumiv{\arabic{enumiv}}
  }%
  \tolerance\@M
  \hyphenpenalty=50
  \hbadness5000 \sfcode`\.=1000\relax
}

%===============END OF modsim07.sty 