%
%   Style file for CLIN articles
%
%   Use:    \documentclass[10pt,twoside]{article}
%       \usepackage{...,clin}
%
%-----------------------------------------------------------------
%
%   Lettertype: Times Roman
%
\usepackage{times}
\fontfamily{ptm}\selectfont

%
%   Sections
%
%
\def\@seccntformat#1{\mbox{\protect\makebox[1cm][l]{\csname the#1\endcsname}}}
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.25ex \@plus -1ex \@minus -.2ex}%
                                   {1.5ex \@plus.2ex}%
                                   {\normalfont\normalsize\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries}}
%
%
%   Title
%
%
\def\shorttitle#1{% running head
    \message{Shorttitle defined as: #1}%
    \gdef\shorttitel{#1}}
\gdef\shorttitel{\@title}
\def\subtitle#1{%
    \message{Subtitle defined as: #1}%
    \gdef\subtitel{\subsubsection*{#1}}}
\gdef\subtitel{\relax}
\def\maaktitel{\maketitle\thispagestyle{empty}}
\def\@maketitle{%
  \newpage
  \vskip 1cm%
    \section*{\large \@title}
    \subtitel
    {{\normalsize\itshape \@author}\vskip 1ex
     \noindent\@date}
  \markboth{\hfill\@author}{\shorttitel}
  \par
 \vskip 1.5em}
%
%   Headers, footers
%
%
\def\ps@myheadings{%
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{\makebox[2.5em][l]{\thepage}\itshape \leftmark\hfil\strut}%
    \def\@oddhead{{\itshape \rightmark}\hfil\thepage}%
    \let\@mkboth\@gobbletwo
    \let\sectionmark\@gobble
    \let\subsectionmark\@gobble
    }
\pagestyle{myheadings}
%
%   Abstract
%
%
\renewenvironment{abstract}{%
    \section*{Abstract}
    \small}%
        {\par\normalsize}
%
%
%   Redefinition of equations (option fleqn)
%
\renewenvironment{equation}%
    {%
     \@beginparpenalty\predisplaypenalty
     \@endparpenalty\postdisplaypenalty
     \refstepcounter{equation}%
     \trivlist \item[\hspace{2mm}\@eqnnum]\leavevmode
%       \hb@xt@\linewidth%
         \bgroup $\m@th% $
         \displaystyle
          \hskip\mathindent}%
        {$\hfil % $
         \displaywidth\linewidth\hbox{\strut}%
       \egroup
     \endtrivlist}
%
%   Captions in small
%
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{{\small #1: #2}}%
  \ifdim \wd\@tempboxa >\hsize
    {\small #1: #2}\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{10\p@}
%
%   Footnotes
%
\long\def\@makefntext#1{%
%    \parindent 1em%
    \noindent
    \hb@xt@3pt{\hss\@makefnmark}#1}
%
%   Bibliography
%
\newcommand*\clinbiblabel[1]{\hspace\labelsep
                             \normalfont #1}

\renewenvironment{thebibliography}[1]
     {\section*{\refname
        \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
%            \if@openbib
%               \advance\leftmargin\bibindent
%               \itemindent -\bibindent
%               \listparindent \itemindent
%             \fi
        \leftmargin 1cm
        \labelwidth\z@
        \labelsep\z@
        \itemsep\z@
        \parsep\z@
        \itemindent-\leftmargin
        \let\makelabel\clinbiblabel
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
%      \if@openbib
%        \renewcommand\newblock{\par}%
%      \else
        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
%      \fi
      \sloppy\clubpenalty4000\widowpenalty4000%
      \sfcode`\.=\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
%
%
%
%   First page
%
\newcommand{\ps@clinfirst}{%
    \renewcommand{\@oddhead}{}%
    \renewcommand{\@evenhead}{}%
    \renewcommand{\@oddfoot}%
    {}
%   {\parbox[t]{\textwidth}%
    \renewcommand{\@evenfoot}{}
}
%
%   Page Dimensions
%
%
\setlength{\textwidth}{11.5cm}
\setlength{\textheight}{19cm}
\setlength{\oddsidemargin}{2.3cm}
\setlength{\evensidemargin}{2.3cm}
\setlength{\topmargin}{-10mm}
\addtolength{\headsep}{-4mm}
\parindent 0.5cm
\itemindent 0cm
\leftmargin 1cm
\bibindent 1cm
\parskip 0cm
\sloppy
\raggedbottom
