\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{procimm}[2014/11/01 v1.0 Proceedings of the Institute of Mathematics and Mechanics class]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{amsart}}
\ProcessOptions\relax

\LoadClass[11pt,reqno]{amsart}

\RequirePackage[twoside, includehead, papersize={180mm, 280mm}, hmargin={25mm, 20mm}, vmargin={25mm, 30mm}]{geometry}

\usepackage{amsmath,amsthm,amssymb}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{algorithm}{Algorithm}[section]

\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{example}{Example}[section]
\newtheorem{problem}{Problem}[section]

\theoremstyle{remark}
\newtheorem{remark}{Remark}[section]

\numberwithin{equation}{section}

\def\publname{Proceedings of the Institute of Mathematics and Mechanics, \\ National Academy of Sciences of Azerbaijan}

\def\@logofont{\normalfont\Small}

\def\article@logo{%
  \set@logo{%
    \publname
    \ifx\@empty\currentvolume
    \else \newline\volinfo, \currentyear, \pageinfo
    \fi
  }%
}

\copyrightinfo{}{}

\def\@maketitle{%
  \normalfont\normalsize
  \@adminfootnotes
  \@mkboth{\@nx\shortauthors}{\@nx\shorttitle}%
  \global\topskip72\p@\relax
  \@settitle
  \ifx\@empty\authors \else \@setauthors \fi
  \ifx\@empty\@dedicatory
  \else
    \baselineskip18\p@
    \vtop{\centering{\footnotesize\itshape\@dedicatory\@@par}%
      \global\dimen@i\prevdepth}\prevdepth\dimen@i
  \fi
  \@setabstract
  \normalsize
  \if@titlepage
    \newpage
  \else
    \dimen@34\p@ \advance\dimen@-\baselineskip
    \vskip\dimen@\relax
  \fi
}

\def\@adminfootnotes{%
  \let\@makefnmark\relax  \let\@thefnmark\relax
  \ifx\@empty\@date\else \@footnotetext{\@setdate}\fi
  \ifx\@empty\@subjclass\else \@footnotetext{\@setsubjclass}\fi
  \ifx\@empty\@keywords\else \@footnotetext{\@setkeywords}\fi
}

\renewcommand{\abstractname}{{\bfseries Abstract}}

\renewenvironment{abstract}{%
  \ifx\maketitle\relax
    \ClassWarning{\@classname}{Abstract should precede
      \protect\maketitle\space in AMS document classes; reported}%
  \fi
  \global\setbox\abstractbox=\vtop \bgroup
    \normalfont\small
    \list{}{\labelwidth\z@
      \leftmargin3pc \rightmargin\leftmargin
      \listparindent\normalparindent \itemindent\z@
      \parsep\z@ \@plus\p@
      \let\fullwidthdisplay\relax
    }%
    \item[\hskip\labelsep\abstractname.]%
}{%
  \endlist\egroup
  \ifx\@setabstract\relax \@setabstracta \fi
}

\newenvironment{acknowledgements}{%
  \@xp\section\@xp*\@xp{Acknowledgements}%
  \normalfont
}{}

\def\@secnumfont{\bfseries}

\renewcommand{\urladdr}[2][]{}

\def\section{\@startsection{section}{1}%
  \z@{1.2\linespacing\@plus\linespacing}{.5\linespacing}%
  {\normalfont\large\bfseries\centering}}

\renewcommand{\author}[2][]{%
  \ifx\@empty\authors
    \gdef\authors{#2}%
  \else
    \g@addto@macro\authors{\and#2}%
  \fi
  \g@addto@macro\addresses{\par\addvspace\bigskipamount\indent #2\par}%
  \@ifnotempty{#1}{%
    \ifx\@empty\shortauthors
      \gdef\shortauthors{#1}%
    \else
      \g@addto@macro\shortauthors{\and#1}%
    \fi
  }%
}
\edef\author{\@nx\@dblarg
  \@xp\@nx\csname\string\author\endcsname}

\def\emailaddrname{E-mail address}

\def\@setaddresses{\par
  \nobreak \begingroup
%\footnotesize
  \def\author##1{\nobreak\addvspace\bigskipamount}%
  \def\\{\unskip, \ignorespaces}%
  \interlinepenalty\@M
  \def\address##1##2{\begingroup
    \@ifnotempty{##1}{(\ignorespaces##1\unskip) }%
    {\itshape\ignorespaces##2}\par\endgroup}%
  \def\curraddr##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak\indent\curraddrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      ##2\par}\endgroup}%
  \def\email##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak\indent{\small\emailaddrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      \ttfamily##2}\par}\endgroup}%
  \def\urladdr##1##2{\begingroup
    \def~{\char`\~}%
    \@ifnotempty{##2}{\nobreak\indent\urladdrname
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      \ttfamily##2\par}\endgroup}%
  \addresses
  \endgroup
}

\renewcommand{\bibliofont}{\small}

\def\received#1{\def\@received{#1}}
\let\@received\@empty
\def\revised#1{\def\@revised{#1}}
\let\@revised\@empty
\def\accepted#1{\def\@accepted{#1}}
\let\@accepted\@empty

\def\@setreceived{{Received: \@received}}
\def\@setrevised{{; Revised: \@revised}}
\def\@setaccepted{{; Accepted: \@accepted\par}}

\def\enddoc@text{\ifx\@empty\@translators \else\@settranslators\fi
  \ifx\@empty\addresses \else\@setaddresses\fi
  \vskip 10pt \par \small \ifx\@empty\@received \else\@setreceived\fi
  \ifx\@empty\@revised \else\@setrevised\fi
  \ifx\@empty\@accepted \else\@setaccepted\fi}

\endinput
