%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% UlSU_Transactions class for LaTeX files            v1.1 July-08-2004%%
%% Developed by I.V. Semushin                                          %%
%% The regular article class commands still exist and may be used.     %%
%% 10pt, 11pt and twocolumn options are disabled.                      %%
%%                                                                     %%
%% \maketitul make the first page of each included paper automatically %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{UlSU}[2004/07/08 UlSU_Transactions paper class]

\DeclareOption{10pt}{\OptionNotUsed}
\DeclareOption{11pt}{\OptionNotUsed}
\DeclareOption{twocolumn}{\OptionNotUsed}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

\ProcessOptions\relax

\LoadClass[12pt]{article}

\RequirePackage{calc}
\RequirePackage{indentfirst}

%% Title
\newcommand{\maketitul}[3]{%
 \newpage
 \thispagestyle{plain}
 \begin{minipage}[t][3cm][t]{15.5cm}
  \begin{flushright}
   \scriptsize
%   4$^{\mathrm{th}}$ 
Ученые записки Ульяновского государственного университета\\
Сер. \textsl{Фундаментальные проблемы математики и механики}\\ Вып. 1(14), с. #1 -- #2.\\
%Под ред. академ. РАЕН проф. А. С. Андреева\\
\copyright УлГУ, Ульяновск, 2005
  \end{flushright}
УДК #3
  \end{minipage}
 \begin{center}%
  {%3
   \fontsize{14}{16}\selectfont
   \bfseries
   \MakeUppercase{\@title}
   \par
  }%3
  \vspace{18pt}%
  {%4
\fontsize{12}{14}\selectfont
   \bfseries\@author
   \par
  }%4
  \vspace{14pt}%
  {%5
\fontsize{11}{12}\selectfont
   \def\and{\\\vspace{14pt}}
   \normalfont\@address
   \par
  }%5
 \end{center}
 \vspace{18pt}%
 \noindent\textbf{Ключевые слова: \space}\@keywords
 \par
 \vspace{18pt}%
 \noindent\textbf{Аннотация. %\space%
 }{\textit\@abstract}
 \par
 \vfill
 \newpage
}% End of \@maketitle

\def\author{\@ifnextchar[{\@getshortauthor}{\@getauthor}}
\def\@getauthor#1{\gdef\@author{#1}\gdef\@shortauthor{#1}}
\def\@getshortauthor[#1]#2{\gdef\@shortauthor{#1}\gdef\@author{#2}}

\newcommand{\address}[1]{\gdef\@address{#1}}

\newcommand{\keywords}[1]{\gdef\@keywords{#1}}

\renewcommand{\abstract}[1]{\gdef\@abstract{#1}}

\newcommand{\heading}[1]{\gdef\@heading{#1}}

\def\ps@myheadings{%
    \def\@oddfoot{\normalfont\hfil\thepage\hfil}
    \let\@evenfoot\@oddfoot
    \def\@evenhead{%
        \parbox[t][11.5pt][t]{\textwidth}{%
        \centering
        \normalfont
        \fontsize{10}{10}\selectfont
        \@heading\\
\vspace{-.2cm}
        \rule{\textwidth}{1pt}%
     }
    }%
    \let\@oddhead\@evenhead
    \let\@mkboth\@gobbletwo
    \let\sectionmark\@gobble
    \let\subsectionmark\@gobble
}

\def\sectionLevel{1}
\def\sectionIndent{0pt}
\def\sectionSpaceBefore{12pt}
\def\sectionSpaceAfter{6pt}
\def\sectionStyle{\normalsize\bfseries\MakeUppercase}

\renewcommand{\section}{%
  \@startsection{section}{\sectionLevel}{\sectionIndent}{\sectionSpaceBefore}%
                {\sectionSpaceAfter}{\sectionStyle}}%


\def\sectionLevel{2}
\def\sectionIndent{0pt}
\def\sectionSpaceBefore{12pt}
\def\sectionSpaceAfter{6pt}
\def\sectionStyle{\normalsize\bfseries}

\renewcommand{\subsection}{%
  \@startsection{subsection}{\sectionLevel}{\sectionIndent}{\sectionSpaceBefore}%
                {\sectionSpaceAfter}{\sectionStyle}}%


\renewcommand{\@makecaption}[2]{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\normalsize\fontsize{10}{12}\selectfont #1: #2}%
  \ifdim \wd\@tempboxa >\hsize
    \normalsize\fontsize{10}{12}\selectfont #1: #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}

\renewenvironment{thebibliography}[1]
  {%\newpage
   \section*{\MakeUppercase\refname\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}}%
   \list{\@biblabel{\@arabic\c@enumiv}}%
        {\settowidth\labelwidth{\@biblabel{#1}}%
         \leftmargin\labelwidth
         \advance\leftmargin\labelsep
         \@openbib@code
         \usecounter{enumiv}%
         \let\p@enumiv\@empty
         \renewcommand\theenumiv{\@arabic\c@enumiv}}%
   \sloppy
   \clubpenalty4000
   \@clubpenalty \clubpenalty
   \widowpenalty4000%
   \sfcode`\.\@m}
  {\def\@noitemerr
   {\@latex@warning{Empty `thebibliography' environment}}%
   \endlist}
\setlength{\oddsidemargin}{0mm}
\setlength{\textheight}{210mm}
\setlength{\textwidth}{160mm}
\setlength{\textfloatsep}{12pt}
\setlength{\abovedisplayskip}{6pt}
\setlength{\belowdisplayskip}{6pt}
\setlength{\parindent}{5mm}
\setlength{\abovecaptionskip}{6pt}
\setlength{\belowcaptionskip}{6pt}
\setlength{\itemsep}{0pt}

%%%%%%%%%%%%%%%definitions for making the Contents%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\@pnwidth}{1em}%    % place size for page number in toc
\renewcommand{\@tocrmarg}{4em}% % right indent for toc lines with their length 
%                               % is greater than the toc line's length
\renewcommand{\@dotsep}{4.5}    % density of dot-leaders in toc

\newcounter{papernumber}        % counter of papers included
%\setcounter{papernumber}{0}     % set to zero the counter of papers included

\newcommand{\l@paper}[2]% the first argument=text in the third argument of 
%                       % addcontentsline command used in the main LaTeX file
{\pagebreak[0]\vspace{1em plus 1pt}%
\@tempdima=2.5em%       % place size for each toc entry number
{%                      % beginning the command group
\rightskip=\@pnwidth plus 4em%   % right indent left for page numbers
\leftskip=\@tempdima%   % left indent left for numbers of each toc entry
%\noindent%              % begin a toc paragraph with zero indent...
\hspace{-\leftskip}%    % ... and from the left margin
#1 \nolinebreak %
\leaders \hbox to 1em{\hss . \hss} \hfill%
\rlap{\makebox[\@pnwidth][r]{\bf#2}} \par\nopagebreak[3]%
}%                      % ending the command group
}%                      % ending the definition of newcommand{\l@paper}...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\l@section}{\@dottedtocline{1}{2.4em}{2em}}

\newcounter{chapter}
\renewcommand{\thechapter}{\arabic{chapter}}
\newcommand{\chapter}{\@startsection%
{chapter}{0}{0pt}{1cm}%
{2cm}{\Large\bf}}

\newcommand{\l@abcd}[2]{\vspace{2ex}\hbox to\textwidth{#1 \leaders \hbox to 1em{\hss . \hss} \hfill #2}}

\AtBeginDocument{%
  \pagestyle{myheadings}
  \setcounter{papernumber}{0}
  \setcounter{chapter}{0}
}

\endinput
