%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                vestnik.cls                                  %
%                                                                             %
%                        Класс vestnik (для LaTeX2e)                          %
%                      для публикации статей в журнале                        %
%                  "ЭКОЛОГИЧЕСКИЙ ВЕСТНИК НАУЧНЫХ ЦЕНТРОВ                     %
%                ЧЕРНОМОРСКОГО ЭКОНОМИЧЕСКОГО СОТРУДНИЧЕСТВА"                 %
%                                                                             %
%                         Версия 1.1 от 1/12/2008                             %
%                                                                             %
%        Все вопросы по использованию по эл. почте vestnik@kubsu.ru.          %
%                                                                             %
%   Последнюю версию этого фала можно всегда найти на веб-станице журнала     %
%    "Экологический вестник научных центров Черноморского Экономического      %
%  сотрудничества" на сайте www.kubsu.ru в разделе "Наука/Научные журналы"    %
%                                                                             %
%            2006-2008 (с) Кубанский государственный университет              %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
% История изменений:                                                          %
%                                                                             %
% 1.0 - 01/02/2006 Первая публичная версия                                    %
% 1.1 - 01/12/2008 Введена поддержка ключевых слов (keywordsrus, keywordseng) %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
% Известные проблемы:                                                         %
%                                                                             %
% * Если текст на титульной странице (заглавия и рефераты) превышает          %
%   по объему одну страницу, на первой странице остается только заглавие и    %
%   сноски, а рефераты целиком переходят на вторую страницу                   %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{vestnik}[2008/01/12]


\message
 {^^J=======================================================================
  ^^J VESTNIK package v1.1 - 2008/01/12 of
  ^^J ECOLOGICAL BULLETIN OF RESEARCH CENTERS OF THE BSEC
  ^^J=======================================================================^^J^^J}

\def\package@warning#1{\message{^^JVESTNIK Package Warning: #1
 ^^JPress any key... }\read\m@ne to \@tempa}

\def\package@error#1{\begingroup \errorcontextlines=1
 \errmessage{VESTNIK Package error: #1}\endgroup}


\RequirePackage{ifthen}
\newboolean{preprint}
\newboolean{ref}
\newboolean{engref}
\newboolean{keywordsrus}
\newboolean{keywordseng}
\setboolean{preprint}{true}
\setboolean{ref}{true}
\setboolean{engref}{true}
\setboolean{keywordsrus}{false}
\setboolean{keywordseng}{false}

% Опция [press] 
\DeclareOption{press}{\setboolean{preprint}{false}}
% Опция [noref]
\DeclareOption{noref}{\setboolean{ref}{false}}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions

\LoadClass[11pt]{extarticle}

\RequirePackage{mathtext}
\RequirePackage[cp1251]{inputenc}
\RequirePackage[TS1,T2A,OMS]{fontenc}
\RequirePackage[english,russian]{babel}

%%%%%%% Установка необходимой величины полей для разворота и шрифтов
\ifthenelse{\boolean{preprint}}{%
    \RequirePackage[14pt]{extsizes}}{}
\ifthenelse{\boolean{preprint}}{%
    \RequirePackage[mag=1000,a4paper,left=2.5cm,right=2cm,top=2cm,bottom=2.5cm,includehead,includefoot]{geometry}
}{%
    \RequirePackage[mag=1000,a4paper,inner=2.5cm,outer=0cm,top=2cm,bottom=2.5cm,includehead,includemp]{geometry}
    \marginparwidth=2cm
}

%%%%%%% Интерлиньяж
\ifthenelse{\boolean{preprint}}{%
    \renewcommand{\baselinestretch}{1.5}}{%
    \renewcommand{\baselinestretch}{0.9}}

%%%%%%% Установка обычных интервалов после конца предложения
\frenchspacing

%%%%%%% "Русский" вариант минимального количества букв, после которого слово можно переносить
\lefthyphenmin=3
\righthyphenmin=2

%%%%%% Уменьшение интервалов над и под выключными формулами
\abovedisplayskip=.7\abovedisplayskip
\belowdisplayskip=.7\belowdisplayskip

%%%%%%% Полный запрет переносов во внутритекстовых формулах
\binoppenalty=10000 \relpenalty=10000

%%%%%%% Запрет висячих строк
\clubpenalty=10000 \widowpenalty=10000

%%%%%%% Упрощение переносов длинных слов в черновом режиме
\ifthenelse{\boolean{preprint}}{%
    \tolerance=1000}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%% Включение нумерации таблиц, рисунков и библиографии арабскими цифрами
\RequirePackage[center,small,labelsep=period]{caption}

%%%%%%% Обычный размер шрифта для заголовка секции
\renewcommand\section{\@startsection {section}{1}{0mm}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\numberwithin{equation}{section}\normalfont\normalsize\bfseries\raggedright\centering}}
%%%%%%% Обычный размер шрифта для заголовка подсекции
\renewcommand\subsection{\@startsection{subsection}{2}{0mm}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\slshape\raggedright\centering}}
%%%%%%% Обычный размер шрифта для заголовка подподсекции
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{0mm}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\itshape\raggedright\centering}}

%%%%%%% Точка после номеров разделов
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname . }
\renewcommand\thesubsection{\thesection.\arabic{subsection}\hskip 0.0em}
\renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}\hskip -0.0em}

%%%%%%% Определения для библиографического списка
\renewcommand\@biblabel[1]{#1.\hfill}
\addto\captionsrussian{\def\refname{\textbf{\textit{Литература}}}}

\renewenvironment{thebibliography}[1]
     {\section*{\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\small\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}

%%%%%%% Новые окружения для теорем, лемм, доказательств, замечаний и др.
\newenvironment{newthm}[2][s]{%
    \vskip1mm 
    \ifthenelse{\equal{#1}{s}}
    {{\small \sc #2.}}
    {{\small \sc #2 #1.}}}{}
\newenvironment{proof}[1][s]{%
    \vskip1mm
    \ifthenelse{\equal{#1}{s}}
    {{\it Доказательство. }}
    {{\it #1. }}}{$\square$}
\newenvironment{theorem}[1][s]{%
    \vskip1mm 
    \ifthenelse{\equal{#1}{s}}
    {{\small \sc Теорема. }}
    {{\small \sc Теорема #1.}}}{}
\newenvironment{remark}[1][s]{%
    \vskip1mm 
    \ifthenelse{\equal{#1}{s}}
    {{\small \sc Замечание. }}
    {{\small \sc Замечание #1.}}}{}
\newenvironment{example}[1][s]{%
    \vskip1mm 
    \ifthenelse{\equal{#1}{s}}
    {{\small \sc Пример. }}
    {{\small \sc Пример #1.}}}{}
\newenvironment{lemma}[1][s]{%
    \vskip1mm 
    \ifthenelse{\equal{#1}{s}}
    {{\small \sc Лемма. }}
    {{\small \sc Лемма #1.}}}{}
\newenvironment{definition}[1][s]{%
    \vskip1mm 
    \ifthenelse{\equal{#1}{s}}
    {{\small \sc Определение. }}
    {{\small \sc Определение #1.}}}{}

%%%%%%% Изменение вида списков
\def\@listI{\leftmargin\leftmargini
 \topsep\z@ \parsep\z@ \itemsep.3ex}

\def\@listii{\leftmargin\leftmarginii
   \labelwidth\leftmarginii\advance\labelwidth-\labelsep
   \topsep\z@ \parsep\z@ \itemsep\z@}

\def\itemize{\ifnum\@itemdepth>\@ne \@toodeep \else \advance\@itemdepth\@ne
  \vskip .2ex plus 0ex minus 0.2ex\leftmarginii 30\p@
  \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
  \list{\csname\@itemitem\endcsname}{\def\makelabel##1{\hss\llap{##1}}}\fi}

\def\enumerate{\ifnum\@enumdepth>\@ne \@toodeep \else
  \advance\@enumdepth\@ne
  \settowidth\leftmargini {\indent 9)\enskip}%
  \leftmarginii 27\p@
  \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
  {\csname label\@enumctr\endcsname}{\usecounter
    {\@enumctr}\def\makelabel##1{\hss\llap{##1}}}\fi}

\def\labelitemi{$\bullet$}
\def\labelitemii{--}

\def\labelenumi{\theenumi)}
\def\labelenumii{\theenumii)}
\def\theenumi{\arabic{enumi}}
\def\theenumii{\alph{enumii}}

%%%%%%% Описание новых и переопределение некоторых стандартных команд
\def\ISSN{ISSN 1729-5459}
\def\Name{\uppercase{Экологический вестник научных центров ЧЭС}}
\def\TitulLine{\vbox{}\vspace{-17mm}
 \vbox{\small\hfil\ISSN.~\Name.~\theYear.~\No\,\theCurrNo\hfil\hrule}\par}

\newcommand{\udk}{}
\newcommand{\theudk}{}
\renewcommand{\udk}[1]{%
    \renewcommand{\theudk}{{УДК #1}}}

\newcommand{\Year}{}
\newcommand{\theYear}{}
\renewcommand{\Year}[1]{%
    \renewcommand{\theYear}{{#1}}}

\newcommand{\CurrNo}{}
\newcommand{\theCurrNo}{}
\renewcommand{\CurrNo}[1]{%
    \renewcommand{\theCurrNo}{{#1}}}

\newcommand{\grant}{}
\newcommand{\thegrant}{}
\renewcommand{\grant}[1]{%
    \renewcommand{\thegrant}{{#1}}}

\newcommand{\rubrika}{}
\newcommand{\therubrika}{}
\renewcommand{\rubrika}[1]{%
    \renewcommand{\therubrika}{{#1}}}

\newcommand{\thetitle}{}
\newcommand{\thetitleshort}{}
\newcommand{\thetitleheader}{}
\renewcommand{\title}[2][]{%
    \renewcommand{\thetitleheader}{\normalsize\textbf{\uppercase{#2}}}
    \renewcommand{\thetitle}{#2}
    \ifthenelse{\equal{#1}{}}{%
        \renewcommand\thetitleshort{\thetitle}}{%
        \renewcommand{\thetitleshort}{#1}}}

\newcommand{\theauthor}{}
\renewcommand{\author}[1]{%
    \renewcommand{\theauthor}{#1}}

\newcommand{\address}{}
\newcommand{\theaddress}{}
\renewcommand{\address}[1]{%
    \renewcommand{\theaddress}{\noindent {{#1}}}}

\newcommand{\thethanks}{}
\newcommand{\makethanks}{}
\renewcommand{\thanks}[1]{%
    \renewcommand{\makethanks}{\vspace{2ex}\textit{#1}}}

\newcommand{\thedate}{}
\renewcommand{\date}[1]{%
    \renewcommand{\thedate}{\footnotesize{#1}}}

\newcommand{\titleeng}{}
\newcommand{\thetitleeng}{}
\renewcommand{\titleeng}[1]{%
    \renewcommand{\thetitleeng}{\uppercase{#1}}}

\newcommand{\authoreng}{}
\newcommand{\theauthoreng}{}
\renewcommand{\authoreng}[1]{%
    \renewcommand{\theauthoreng}{{#1}}}

\newcommand{\refeng}{}
\newcommand{\therefeng}{}
\renewcommand{\refeng}[1]{%
    \renewcommand{\therefeng}{{#1}}}

\newcommand{\refrus}{}
\newcommand{\therefrus}{}
\renewcommand{\refrus}[1]{%
    \renewcommand{\therefrus}{{#1}}}

\newcommand{\keywordsrus}{}
\newcommand{\thekeywordsrus}{}
\renewcommand{\keywordsrus}[1]{%
    \ifthenelse{\equal{#1}{}}{}{\setboolean{keywordsrus}{true}}
    \renewcommand{\thekeywordsrus}{{#1}}}

\newcommand{\keywordseng}{}
\newcommand{\thekeywordseng}{}
\renewcommand{\keywordseng}[1]{%
    \ifthenelse{\equal{#1}{}}{}{\setboolean{keywordseng}{true}}
    \renewcommand{\thekeywordseng}{{#1}}}

\newcounter{figurescounter}
\newcounter{tablescounter}
\newcounter{articlepagecounter}

\RequirePackage{fancyhdr}

\IfFileExists{_number.dat}{\input{_number.dat}}{}

\selectlanguage{russian}

\ifthenelse{\boolean{preprint}}{}{%
\pagestyle{fancy}
\lhead[\thepage]{}\chead[\small\renewcommand{\@footnotemark}{}\theauthor]{\small\thetitleshort}\rhead[]{\thepage}\cfoot[]{}
}

\renewcommand{\maketitle}{%
\selectlanguage{russian}
\ifthenelse{\boolean{preprint}}{%
\raggedbottom
\pagestyle{plain}}{%
\thispagestyle{empty}
\vbox{}\vspace{-17mm}
 \vbox{\noindent\small\hfil\ISSN.~\Name%
 \ifthenelse{\equal{\theYear}{} \and \equal{\theCurrNo}{}}{}{%
 .~\theYear.~\No\,\theCurrNo\hfill}}\hrule\par
\vspace{6ex}
{
\Large
\ifthenelse{\equal{\therubrika}{}}{\phantom{~}}{\begin{center}\Large\textsc{\textbf{\therubrika}}\end{center}}
}\par
\vspace{10ex}
}
\noindent\theudk
\begin{center}
\thetitleheader%
\ifthenelse{\equal{\thegrant}{}}{}{\footnote{\thegrant}}
\par\vspace{1ex}\textit{\textbf{\theauthor}}\par\vspace{4ex}

\ifthenelse{\boolean{preprint}}
{\parbox{.9\textwidth}{{\parindent=4ex\small\therefrus\par
\ifthenelse{\boolean{keywordsrus}}{%
\par Ключевые слова:~\thekeywordsrus}{}
\vspace{8ex}}}}
{\vspace{4ex}}
%\selectlanguage{english}
\ifthenelse{\boolean{preprint}}
{\small}
{\footnotesize}
{\par\centering\thetitleeng\\[1ex]\theauthoreng\par\vspace{2ex}}
\parbox{.9\textwidth}{{\parindent=4ex%
\small\therefeng
\ifthenelse{\boolean{keywordseng}}{%
\par Keywords:~\thekeywordseng}{}
}\selectlanguage{russian}}
\end{center}
\normalfont\normalsize
\vspace{1ex}
\ifthenelse{\boolean{preprint}}{\newpage}{%
    \begin{multicols}{2}}
}

\renewcommand{\makethanks}{%
    \ifthenelse{\equal{\thethanks}{}}{}%
        {\bigskip\textit{\thethanks}}
}

\newcommand{\makeendtitle}{%
\ifthenelse{\boolean{preprint}}{}{%
    \end{multicols}}
\ifthenelse{\boolean{keywordsrus}}{%
\bigskip\small\noindent Ключевые слова:~\thekeywordsrus\par\medskip}{}
\noindent\parbox{165mm}{%
\vspace{1ex}\hrule height .5pt
\footnotesize\vspace{2ex}
\ifthenelse{\boolean{preprint}}{%
Дата отсылки статьи \thedate\par}{%
Статья поступила \thedate\par}
\footnotesize\theaddress\\
\renewcommand{\@footnotemark}{}
\textcopyright~\theauthor\kern-3pt, \theYear}
\ifthenelse{\boolean{preprint}}{}{%
    \ifthenelse{\boolean{ref}}{%
        \par\bigskip\therefrus}{}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%% Подключение необходимых пакетов
\RequirePackage{amsmath,amssymb}
\RequirePackage{cite}
\RequirePackage{multicol}
\RequirePackage{indentfirst}
\RequirePackage{tabularx}
\RequirePackage{graphicx}
\RequirePackage{rotating}
\RequirePackage{yfonts}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%% Описание новых и переопределение некоторых стандартных команд
\newcommand\const{{\mathrm{const}}}
\renewcommand\Im{\mathop{\mathrm{Im}}\nolimits}
\newcommand\ReGoth{\ensuremath{\text{\usefont{OMS}{cmr}{m}{n}\symbol{"3C}}}}
\renewcommand\Re{\mathop{\mathrm{Re}}\nolimits}
\renewcommand\div{\mathop{\mathrm{div}}\nolimits}
\newcommand\ci{\mathop{\textrm{ci}}\nolimits}
\newcommand\si{\mathop{\textrm{si}}\nolimits}
\newcommand\grad{\mathop{\mathrm{grad}}\nolimits}
\newcommand\rot{\mathop{\mathrm{rot}}\nolimits}
\newcommand\graddiv{\mathop{\mathrm{graddiv}}\nolimits}
\renewcommand\textdiv{\ensuremath{\text{\usefont{TS1}{cmr}{m}{n}\symbol{"F6}}}}
\renewcommand\textcopyright{{\usefont{TS1}{cmr}{m}{n}\symbol{"A9}}}

%%%%%%% Необходимые настройки для пакета tabularx
\setlength{\extrarowheight}{1pt}
\newcolumntype{Y}{>{\footnotesize\centering\arraybackslash}X}
\newcolumntype{C}{>{\footnotesize\arraybackslash}c}
\newcolumntype{L}{>{\footnotesize\arraybackslash}l}
\newcolumntype{R}{>{\footnotesize\arraybackslash}r}
\newcolumntype{P}{>{\footnotesize\centering\arraybackslash}p}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput 
