% intelligent customisable spacing
% usage: \begin{spacing}{1.0} text \end{spacing}
% allowed spacing values: 1.0, 1.5, 2.0
%
\usepackage{setspace}
\onehalfspacing

% we use times ...
\usepackage{times}

% let umlauts gop through:
\usepackage[latin9]{inputenc}

% make reference to last page easy, automatise the pages
% information on the first page footer
\usepackage{lastpage}
% some coarse adjustments, margins, font sizes, footnote format
\setlrmarginsandblock{2.5cm}{2.5cm}{*}
\addtolength{\oddsidemargin}{0.5cm}
\addtolength{\evensidemargin}{-0.5cm}
\setulmarginsandblock{3.5cm}{2.5cm}{*}
\setlength{\footmarkwidth}{.5cm} \setlength{\footmarksep}{0em} 
\setlength{\thanksmarkwidth}{.5cm} \setlength{\thanksmarksep}{0em} 
\footmarkstyle{\textsuperscript{#1}\hfill}
\thanksmarkstyle{\textsuperscript{#1}\hfill}

\let\footnotesize\small


% headings
\pagestyle{myheadings}
\makeheadrule{myheadings}{\textwidth}{0.4pt}
\makeevenhead{myheadings}{\small\normalfont\thepage}{}{\small\normalfont\leftmark}
\makeoddhead{myheadings}{\small\normalfont\rightmark}{}{\small\normalfont\thepage}

% maketitle starts at the top
\setlength{\droptitle}{-4\baselineskip}

% this is a trick to get the footer on the first page right:
\addtolength{\textheight}{-3.5cm}

% the package is based on the memoir class, section headings ...
\maxsecnumdepth{subsection}
\renewcommand{\chapnumfont}{\bfseries}
\renewcommand{\chaptitlefont}{\bfseries}
\setsecheadstyle{\bfseries\raggedright}
\setsubsecheadstyle{\itshape\raggedright}

% abstract and keywords 
\renewenvironment{abstract}{\vspace*{-4ex}%
 \removelastskip \begin{spacing}{1.0}\small
    \begin{adjustwidth}{2cm}{2cm}\removelastskip}
  {\end{adjustwidth}\end{spacing}\renewcommand{\@ptsize}{4}}

\renewcommand{\abstractname}{}
\newcommand{\keywords}[1]{%
 \begin{adjustwidth}{2cm}{2cm}
\vspace*{-2ex}\small\itshape Keywords:~#1
  \end{adjustwidth}
}
\renewcommand{\abstracttextfont}{\small}


% definitions for maketitle
\def\@institution{} \def\institution#1{\gdef\@institution{#1}}
\def\@LIPeds{} \def\LIPeds#1{\gdef\@LIPeds{#1}}
\def\@LIPtitle{} \def\LIPtitle#1{\gdef\@LIPtitle{#1}}
\def\@LIPyear{} \def\LIPyear#1{\gdef\@LIPyear{#1}}
\def\@LIPno{} \def\LIPno#1{\gdef\@LIPno{#1}}

\newcommand{\nextauthor}{\and\itshape}

\pretitle{\begin{center}\large\bfseries}
\posttitle{\end{center}}
\preauthor{\begin{center}\begin{spacing}{1.5}\begin{tabular}[t]{c}\itshape}
\postauthor{\end{tabular}\\\textnormal{\@institution}\end{spacing}\end{center}}

% redefinitions of maketitle commands
\renewcommand{\maketitle}{\label{FirstPage}%
  \begingroup
    \@bsmarkseries
%%    \def\@makefnmark{\rlap{\@textsuperscript{%
%%       \normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}%
    \def\@makefnmark{\@textsuperscript{%
       \normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}%
    \long\def\@makefntext##1{\makethanksmark ##1}
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@
      \@maketitle
    \fi
    \thispagestyle{LIPfirstpage}\@thanks
  \endgroup
  \@bscontmark  %  \setcounter{footnote}{0}%
  \addtolength{\textheight}{2cm}
  }

\renewcommand{\@maketitle}{%
  \let\footnote\@mem@titlefootkill
%  \newpage
%  \null
%  \vskip 2em%
        \vspace*{\droptitle}
%  \maketitlehooka
  {\@bspretitle \@title \@bsposttitle}
%  \maketitlehookb
  {\@bspreauthor \@author \@bspostauthor}
%  \maketitlehookc
%  {\@bspredate \@date \@bspostdate}
%  \maketitlehookd
%  \par
%  \vskip 1.5em
}

% The footer of the first page

\newcommand{\LIPissue}%
{Linguistics in Potsdam \@LIPno\ (\@LIPyear): \pageref{FirstPage}--\pageref{LastPage}}
\newcommand{\LIPcopyright}[1]%
{{\copyright}\@LIPyear\ \@author}

\setheadfoot{28pt}{0pt}
\makepagestyle{LIPfirstpage}
\makeevenfoot{LIPfirstpage}{}%
{\begin{center}\small
\begin{tabular}{c}
    \textbf{\LIPissue}\\
    \LIPeds \\
    \LIPtitle
      \end{tabular}%
    \end{center}
}{}
\makeoddfoot{LIPfirstpage}{}%
{\begin{center}\small%\vspace*{-5ex}
\begin{tabular}{c}
    \textbf{\LIPissue}\\
    \@LIPeds: \\
    \@LIPtitle{}
      \end{tabular}%
    \end{center}
}{}


% Formatting the contact info

\newenvironment{contact}%
{\vspace*{24pt}\begin{spacing}{1.0}\raggedright\itshape}{\end{spacing}}


