% vestnik3.cls
%
% This is LaTeX2e class support for submissions authors manuscripts to journal 
% 'Ecological Bulletin of Research Centers of the Black Sea Economic Cooperation'
%
% Latest version of this file can be found on the web page of journal 
% 'Ecological Bulletin of Research Centers of the Black Sea Economic 
%    Cooperation' at https://vestnik.kubsu.ru/latex
% 
% This package may be distributed and/or modified under the conditions of the 
% LaTeX Project Public License, either version 1.3 of this license or any later 
% version. The latest version of this license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX version 
% 2005/12/01 or later.
%
% This package may consists of the following source files:
% LaTeX style class file:
%    vestnik3.cls
% Guide:
%    vestnik3-guide.pdf
% Template files:
%    vestnik3-template.tex Russian template (Unicode UTF-8 encoding)
%    vestnik3-template1251.tex Russian template (Windows Cyrillic CP1251 encoding)
% Read Me:
%    readme.txt Russian readme (Unicode UTF-8 encoding)
%    readme1251.txt Russian readme (Windows Cyrillic CP1251 encoding)
%
% vestnik3 uses the packages:
%    amsmath, amssymb, amsthm, babel, bm, caption, cite, fontenc, geometry,  
%    graphicx, extsizes, epstopdf, fontenc, inputenc, indentfirst, mathtext, 
%    microtype, rotating, subcaption, tabularx, underscore.
%
% 3.0n 2024/04/09 * Fix for refcounts in prop command
% 3.0m 2023/10/07 * New \spin and \edn commands
% 3.0  2022/02/19 * The \authorrus & \authoreng commands now has at least two
%                   arguments. The given name of the author (or first and middle 
%                   names together) to type in the 2nd argument, and the surname - 
%                   in the 1st. The corresponding author is marked with an asterisk
%                   after \authorrus* & \authoreng* commands.
%                 * The \address command is now required for the postal address 
%                   of the corresponding author and his phone number(s).
%                 * Renamed \authorinfo -> \inforus & \infoeng commands
%                   depending on used the language.
%                 * New \orcid command.
%                 * Changing the purpose of the \email command. Now it is used
%                   for each author's email address.
%                 * Renamed \thanks -> \fundingrus & \fundingeng
%                   depending on used the language. The \thanks command now is
%                   used at the end of the article for the acknowledgements only.
%                 * New \doi command for DOI in thebibliography environment
%                 * New \conflictofinterestrus & \conflictofinteresteng,
%                   \contributionrus & \contributioneng commands depending 
%                   on used the language.
% 2.1  2016/09/18 * The \authorinfo command. It can be used instead of the 
%                   \inforus command, which is left for compatibility with 
%                   previous version. 
%                 * One condition is that the commands \authorinfo and \inforus 
%                   cannot be mixed in one article.
%                 * Fixed ability to use environment proof for English-language 
%                   articles
%                 * The command \d to specify a roman style of the differential
%                   symbol after the integral symbol
% 2.0f 2015/02/19 Fix \bm command
% 2.0e 2014/10/06 New justification parameter Q{} for taburarx environment with 
%                 left aligned text and width option
% 2.0d 2014/09/26 Minor bug fixed
% 2.0c 2014/08/25 Fixed compatible with MikTeX 2.9
% 2.0  2014/08/01 Version 2.0 is not compatible with previous versions:
%                 * encoding of files is UTF-8 (Unicode) by default. To compile 
%                   files in CP1251 (Windows Cyrillic) encoding need to specify 
%                   the class option [cp1251]
%                 * preparation of articles in English made possible
%                   (the class option [english])
%                 * Renamed \title -> \titlerus, \refrus -> \briefrus,
%                   udk -> udc
%                 * description of authors in Russian and English is fully 
%                   changed (\authorrus, \inforus, \addressrus, \authoreng, 
%                   \addresseng, \email)
%                 * Support for extended abstracts and references for 
%                   international abstract and citation databases
%                   (\annotationeng, \annotationrus, thereferences)
%                 * command \grant is excluded. To specify the grants you can 
%                   use command \thanks
%                 * rarely used environments 'theorem', 'newthm', 'lemma', 
%                   'definition', 'remark', 'example' excluded. Instead a new 
%                   environment 'prop' was defined
% 1.1  2008/01/12 Support for keywords (keywordsrus, keywordseng)
% 1.0  2006/02/01 Initial release
% 
% Report questions/bugs to <vestnik@kubsu.ru>
%
% Copyright 2006, 2008, 2014, 2022 
% (c) 'Ecological Bulletin of Research Centers of the Black Sea Economic 
%      Cooperation'
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{vestnik3}[09/04/2024 version 3.0n]

\message
 {^^J=====================================================================
  ^^J  vestnik3 version 3.0n (09/04/2024) LaTeX2e paper class for  
  ^^J 'Ecological Bulletin of Research Centers  
  ^^J  of the Black Sea Economic Cooperation' journal
  ^^J=====================================================================^^J^^J}
\makeatletter
\newlinechar=`\^^J
\def\class@warning#1{%
    \ClassWarningNoLine{vestnik3}{#1}
}
\def\class@error#1{%
    \ClassError{vestnik3}{#1}{See LaTeX Documentation for more help}
}

\newif\if@english\@englishfalse%
\newif\if@windows\@windowsfalse%
\newif\if@biblatex\@biblatexfalse%
\newif\if@defaultsize\@defaultsizetrue%
\newif\if@pdf
\ifx\pdfoutput\undefined\@pdffalse 
	\else\pdfoutput=1\@pdftrue
\fi

\def\extbase@baseclass{extarticle}
\def\@@ptsize{14pt}
\DeclareOption{10pt}{\def\@@ptsize{10pt}\@defaultsizefalse}
\DeclareOption{11pt}{\def\@@ptsize{11pt}\@defaultsizefalse}
\DeclareOption{12pt}{\def\@@ptsize{12pt}\@defaultsizefalse}
\DeclareOption{14pt}{\def\@@ptsize{14pt}}

\DeclareOption{english}{\@englishtrue}
\DeclareOption{cp1251}{\@windowstrue}
\DeclareOption{biblatex}{\@biblatextrue}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\extbase@baseclass}}
\ProcessOptions\relax
\LoadClass[\@@ptsize]{\extbase@baseclass}

\usepackage[warn]{mathtext}

\RequirePackage[T2A]{fontenc}
\if@windows
    \RequirePackage[cp1251]{inputenc}
\else
    \RequirePackage[utf8]{inputenc}
\fi
\RequirePackage[english,russian]{babel}

\RequirePackage{amsmath,amssymb,amsthm}
\RequirePackage{indentfirst,underscore}
\if@pdf
	\RequirePackage[pdftex]{graphicx}
	\RequirePackage{microtype}
	\pdfcompresslevel=9
\else
	\RequirePackage{graphicx}
\fi
\graphicspath{{_fig/}}
\RequirePackage{epstopdf}
\RequirePackage[center,small,labelsep=period]{caption}
\RequirePackage{subcaption}
\renewcommand\thesubfigure{\asbuk{subfigure}}
\DeclareCaptionLabelFormat{opening}{#2)}
\captionsetup[subfigure]{labelformat=opening}
\def\captionf#1{}
\def\captiont#1{}
\RequirePackage{rotating,tabularx}

\RequirePackage{geometry}
\geometry{mag=1000,a4paper,%
          inner=2.5cm,outer=2.5cm,top=2.5cm,bottom=2.5cm,%
          ignoreheadfoot}
\if@defaultsize
	\renewcommand{\baselinestretch}{1.5}\selectfont
\else
\fi

\binoppenalty=10000 \relpenalty=10000
\clubpenalty=10000 \widowpenalty=10000
\tolerance=1000
\raggedbottom

\if@english\relax\else\frenchspacing\fi

%%%%%%% Smart comma in math mode
\if@english\relax\else
	\mathchardef\mathcomma\mathcode`\,
	\mathcode`\,="8000
	\bgroup
		\uccode`\~`\,%
		\uppercase{%
	\egroup
		\def~}{\futurelet\@let@token\v@comma}
	\newcommand\ordcommalist{0123456789}
	\def\v@comma{%
		\let\@tempb\@empty
		\expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=%
		\ordcommalist\do{%
		\expandafter\ifx\@tempa\@let@token
		\let\@tempb\mathord \@break@tfor
		\fi
		}%
	\@tempb\mathcomma
	}
\fi

%%%%%%% Strings definitions
\def\s@udc{\IeC{\CYRU}\IeC{\CYRD}\IeC{\CYRK}%
}
\def\s@orcid{ORCID%
}
\def\s@spin{SPIN%
}
\def\s@email{e-mail%
}
\def\s@ru@corresponding{\IeC{\CYRA}\IeC{\cyrd}\IeC{\cyrr}\IeC{\cyre}\IeC{\cyrs}%
	\IeC{\cyra}\space{\cyri}\space\IeC{\cyrt}\IeC{\cyre}\IeC{\cyrl}\IeC{\cyre}%
	\IeC{\cyrf}\IeC{\cyro}\IeC{\cyrn}\IeC{\cyrery}\space\IeC{\cyrd}\IeC{\cyrl}%
	\IeC{\cyrya}\space\IeC{\cyrs}\IeC{\cyrv}\IeC{\cyrya}\IeC{\cyrz}\IeC{\cyri}%
}
\def\s@en@corresponding{Addresses and phone(s)%
}
\def\s@ru@abstract{\IeC{\CYRA}\IeC{\cyrn}\IeC{\cyrn}\IeC{\cyro}\IeC{\cyrt}%
	\IeC{\cyra}\IeC{\cyrc}\IeC{\cyri}\IeC{\cyrya}%
}
\def\s@en@abstract{Abstract%
}
\def\s@ru@keywords{\IeC{\CYRK}\IeC{\cyrl}\IeC{\cyryu}\IeC{\cyrch}\IeC{\cyre}%
	\IeC{\cyrv}\IeC{\cyrery}\IeC{\cyre}\space\IeC{\cyrs}\IeC{\cyrl}\IeC{\cyro}%
    \IeC{\cyrv}\IeC{\cyra}%
}
\def\s@en@keywords{Keywords%
}
\def\s@ru@funding{\IeC{\CYRF}\IeC{\cyri}\IeC{\cyrn}\IeC{\cyra}\IeC{\cyrn}%
	\IeC{\cyrs}\IeC{\cyri}\IeC{\cyrr}\IeC{\cyro}\IeC{\cyrv}\IeC{\cyra}\IeC{\cyrn}%
	\IeC{\cyri}\IeC{\cyre}%
}
\def\s@en@funding{Funding%
}
%\def\s@ru@nofunding{\IeC{\CYRI}\IeC{\cyrs}\IeC{\cyrs}\IeC{\cyrl}\IeC{\cyre}%
%	\IeC{\cyrd}\IeC{\cyro}\IeC{\cyrv}\IeC{\cyra}\IeC{\cyrn}\IeC{\cyri}\IeC{\cyre}%
%	\space\IeC{\cyrn}\IeC{\cyre}\space\IeC{\cyri}\IeC{\cyrm}\IeC{\cyre}\IeC{\cyrl}%
%	\IeC{\cyro}\space\IeC{\cyrs}\IeC{\cyrp}\IeC{\cyro}\IeC{\cyrn}\IeC{\cyrs}%
%	\IeC{\cyro}\IeC{\cyrr}\IeC{\cyrs}\IeC{\cyrk}\IeC{\cyro}\IeC{\cyrishrt}\space%
%	\IeC{\cyrp}\IeC{\cyro}\IeC{\cyrd}\IeC{\cyrd}\IeC{\cyre}\IeC{\cyrr}\IeC{\cyrzh}%
%	\IeC{\cyrk}\IeC{\cyri}.%
%}
%\def\s@en@nofunding{The study did not have sponsorship.%
%}
\def\s@ru@contribution{\IeC {\CYRV }\IeC {\cyrk }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrd } \IeC {\cyra }\IeC {\cyrv }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrv }%
}
\def\s@en@contribution{Author contributions%
}
\def\s@ru@conflictofinterest{\IeC{\CYRK}\IeC{\cyro}\IeC{\cyrn}\IeC{\cyrf}%
	\IeC{\cyrl}\IeC{\cyri}\IeC{\cyrk}\IeC{\cyrt}\space\IeC{\cyri}\IeC{\cyrn}%
	\IeC{\cyrt}\IeC{\cyre}\IeC{\cyrr}\IeC{\cyre}\IeC{\cyrs}\IeC{\cyro}\IeC{\cyrv}%
}
\def\s@en@conflictofinterest{Conflict of interest%
}
\def\s@ru@authorsinfo{\IeC{\CYRI}\IeC{\cyrn}\IeC{\cyrf}\IeC{\cyro}\IeC{\cyrr}%
	\IeC{\cyrm}\IeC{\cyra}\IeC{\cyrc}\IeC{\cyri}\IeC{\cyrya}\space\IeC{\cyro}%
	\IeC{\cyrb}\space\IeC{\cyra}\IeC{\cyrv}\IeC{\cyrt}\IeC{\cyro}\IeC{\cyrr}%
	\IeC{\cyra}\IeC{\cyrh}%
}
\def\s@en@authorsinfo{Authors' Information%
}
\def\s@ru@references{\IeC{\CYRL}\IeC{\cyri}\IeC{\cyrt}\IeC{\cyre}\IeC{\cyrr}%
	\IeC{\cyra}\IeC{\cyrt}\IeC{\cyru}\IeC{\cyrr}\IeC{\cyra}%
}
\def\s@en@references{References%
}
\def\s@ru@date{\IeC{\CYRD}\IeC{\cyra}\IeC{\cyrt}\IeC{\cyra}\space\IeC{\cyro}%
	\IeC {\cyrt}\IeC{\cyrp}\IeC{\cyrr}\IeC{\cyra}\IeC{\cyrv}\IeC{\cyrk}\IeC{\cyri}%
	\space\IeC{\cyrs}\IeC{\cyrt}\IeC{\cyra}\IeC{\cyrt}\IeC{\cyrsftsn}\IeC{\cyri}%
}
\def\s@en@date{Article submission date%
}
\def\s@ru@acknowledgements{\IeC{\CYRB}\IeC{\cyrl}\IeC{\cyra}\IeC{\cyrg}\IeC{\cyro}%
	\IeC{\cyrd}\IeC{\cyra}\IeC{\cyrr}\IeC{\cyrn}\IeC{\cyro}\IeC{\cyrs}\IeC{\cyrt}%
	\IeC{\cyri}%
}
\def\s@en@acknowledgements{Acknowledgements%
}

%%%%%%% Users commands
\def\author@ru@infolist{}
\def\author@en@infolist{}
\def\affil@ru@list{}
\def\affil@en@list{}

\newcounter{author@ru@count}
\newcounter{author@en@count}
\newcounter{author@ru@info@count}
\newcounter{author@en@info@count}
\newcounter{author@email@count}
\newcounter{author@orcid@count}
\newcounter{author@spin@count}
\newcounter{author@address@count}
\newcounter{affil@ru@count}
\newcounter{affil@en@count}
\newcounter{@tmp@ru@a}
\newcounter{@tmp@en@a}

\def\@sep{,}%
\def\@ssep{\@sep\space}
\def\@cep{;}%
\def\@scep{\@cep\space}
\def\@sscript#1{$^\text{#1}$}
\def\doi#1{DOI #1}
\def\edn#1{EDN #1}
\def\OJS#1{\def\theOJS{#1}}
\def\VAK#1{}

\def\rubric#1{}
\def\udc#1{\def\theudc{#1}}
\newcommand{\titlerus}{}
\newcommand{\thetitlerus}{}
\newcommand{\thetitlerusshort}{}
\renewcommand{\titlerus}[2][]{%
    \renewcommand{\thetitlerus}{#2}%
    \ifthenelse{\equal{#1}{}}{%
        \renewcommand{\thetitlerusshort}{\thetitlerus}}{%
        \renewcommand{\thetitlerusshort}{#1}}%
}
\newcommand{\titleeng}{}
\newcommand{\thetitleeng}{}
\newcommand{\thetitleengshort}{}
\renewcommand{\titleeng}[2][]{%
    \renewcommand{\thetitleeng}{#2}%
    \ifthenelse{\equal{#1}{}}{%
        \renewcommand{\thetitleengshort}{\thetitleeng}}{%
        \renewcommand{\thetitleengshort}{#1}}%
}
\def\addtotocrus#1{}
\def\addtotoceng#1{}
\def\addto@initial#1{%
	\def\@lsep{\def\@lsep{\,}}%
	\g@addto@macro\@inittemp{\expandafter\@lsep#1.}%
}

\ExplSyntaxOn
\cs_new:Npn \initials_first_of_words:nn #1#2
  { \exp_not:e { \__crosfield_first_of_words:e { \text_purify:n {#2} } {#1} } }
\group_begin:
\cs_set:Npn \__crosfield_tmp:n #1
  {
    \cs_new:Npn \__crosfield_first_of_words:n ##1 ##2
      {
        \__crosfield_first_of_words_spaces:Nnw \use_none:n {##2} ##1 #1
          \q_recursion_tail #1
          \q_recursion_stop
      }
  }
\__crosfield_tmp:n { ~ }
\group_end:
\cs_generate_variant:Nn \__crosfield_first_of_words:n { e }
\cs_new:Npn \__crosfield_first_of_words_spaces:Nnw #1 #2 #3 ~
  {
    \quark_if_recursion_tail_stop:n {#3}
    #1 {#2}
    \tl_if_head_eq_meaning:oNTF {#3} \UTFviii@two@octets
      { \__crosfield_first_of_words_aux:nnw #3 \q_stop }
      { \tl_head:n {#3} }
    \__crosfield_first_of_words_spaces:Nnw \exp_not:n {#2}
  }
\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNTF { o }
\cs_new:Npn \__crosfield_first_of_words_aux:nnw #1#2#3 \q_stop
  { \exp_not:n { #1#2 } }

\newcommand\@initials[1]{ \initials_first_of_words:nn {.\,} {#1} . }
\ExplSyntaxOff

\def\authorrus{%
	\stepcounter{author@ru@count}
	\@ifstar\@@author@ru@corr\@@author@ru
}
\newcommand\@@author@ru[3][]{%
	\expandafter\gdef\csname @author@ru@affil\arabic{author@ru@count}\endcsname{#1}
	\expandafter\gdef\csname @author@ru@last\arabic{author@ru@count}\endcsname{#2}
	\expandafter\gdef\csname @author@ru@first\arabic{author@ru@count}\endcsname{#3}
	\@ifnextchar[{\@addi@ru{#3}}{\relax}
}
\newcommand\@@author@ru@corr[3][]{%
	\expandafter\gdef\csname @author@ru@affil\arabic{author@ru@count}\endcsname{#1}
	\expandafter\gdef\csname @author@ru@last\arabic{author@ru@count}\endcsname{#2}
	\expandafter\gdef\csname @author@ru@first\arabic{author@ru@count}\endcsname{#3}
	\expandafter\gdef\csname @author@ru@corr\arabic{author@ru@count}\endcsname{*}
	\@ifnextchar[{\@addi@ru{#3}}{\relax}
}
\def\@addi@ru#1[#2]{%
	\expandafter\gdef\csname @author@ru@init\arabic{author@ru@count}\endcsname{#2}
}
\def\author@ru@headlist{%
	\newcounter{@tmp@ru@c}\stepcounter{@tmp@ru@c}
	\whiledo{\not{\value{@tmp@ru@c}>\value{author@ru@count}}}{%
		\ifcsname @author@ru@init\the@tmp@ru@c\endcsname
			\@nameuse{@author@ru@init\the@tmp@ru@c}
		\else
			\@initials{\@nameuse{@author@ru@first\the@tmp@ru@c}}~%
		\fi
		\@nameuse{@author@ru@last\the@tmp@ru@c}%
		\@sscript{\@nameuse{@author@ru@affil\the@tmp@ru@c}}%
		\ifnum\the@tmp@ru@c=\c@author@ru@count\else\@ssep\fi%
		\stepcounter{@tmp@ru@c}%
	}
}
\def\inforus#1{%
	\stepcounter{author@ru@info@count}
	\ifnum\value{author@ru@info@count}<\value{author@ru@count}
		\setcounter{author@ru@info@count}{\value{author@ru@count}}
	\fi
	\expandafter\gdef\csname @author@ru@info\arabic{author@ru@info@count}\endcsname{#1}
}
\def\email#1{%
	\stepcounter{author@email@count}%
	\ifnum\value{author@email@count}<\value{author@ru@count}
		\setcounter{author@email@count}{\value{author@ru@count}}
	\fi
	\expandafter\gdef\csname @author@email\arabic{author@email@count}\endcsname{#1}%
}
\def\orcid#1{%
	\stepcounter{author@orcid@count}%
	\ifnum\value{author@orcid@count}<\value{author@ru@count}
		\setcounter{author@orcid@count}{\value{author@ru@count}}
	\fi
	\expandafter\gdef\csname @author@orcid\arabic{author@orcid@count}\endcsname{#1}%
}
\def\spin#1{%
	\stepcounter{author@spin@count}%
	\ifnum\value{author@spin@count}<\value{author@ru@count}
		\setcounter{author@spin@count}{\value{author@ru@count}}
	\fi
	\expandafter\gdef\csname @author@spin\arabic{author@spin@count}\endcsname{#1}%
}
\def\address#1{%
	\stepcounter{author@address@count}%
	\ifnum\value{author@address@count}<\value{author@ru@count}
		\setcounter{author@address@count}{\value{author@ru@count}}
	\fi
	\expandafter\gdef\csname @author@address\arabic{author@address@count}\endcsname{#1}%
}

\def\make@author@ru@infolist{%
	\whiledo{\value{@tmp@ru@a}<\value{author@ru@count}}{
		\stepcounter{@tmp@ru@a}
		\edef\@tmp@ru@b{\the@tmp@ru@a}%
		\expandafter\@addto@ru@infolist\expandafter{\@tmp@ru@b}
	}
}
\def\@addto@ru@infolist#1{
	\g@addto@macro\author@ru@infolist{\author@ru@infoliststring{#1}\par}
}
\def\author@ru@infoliststring#1{%
	\@nameuse{@author@ru@last#1}
	\@nameuse{@author@ru@first#1}%
	\expandafter%
	\ifx\csname @author@ru@info#1\endcsname\relax
	\else
		\unskip\@ssep%
		\@nameuse{@author@ru@info#1}%
	\fi%
	\expandafter%
	\ifx\csname @author@orcid#1\endcsname\relax
	\else
		\unskip\@scep\s@orcid\space\@nameuse{@author@orcid#1}%
	\fi%
	\expandafter%
	\ifx\csname @author@spin#1\endcsname\relax
	\else
		\unskip\@scep\s@spin\space\@nameuse{@author@spin#1}%
	\fi%
	\expandafter%
	\ifx\csname @author@email#1\endcsname\relax
	\else
		\unskip\@scep\s@email:\space\mbox{\@nameuse{@author@email#1}}%
	\fi.%
	\expandafter
	\if@english\relax\else
		\expandafter
    	\ifx\csname @author@ru@corr#1\endcsname\relax%
    		\else\space{\it\s@ru@corresponding.
    			\@nameuse{@author@address#1}}
    	\fi
	\fi
}
\newcommand{\affilrus}[2][]{%
	\stepcounter{affil@ru@count}
	\expandafter\gdef\csname @affil@ru@affil\arabic{affil@ru@count}\endcsname{#1}
	\expandafter\gdef\csname @affil@ru@name\arabic{affil@ru@count}\endcsname{#2}
	\make@affil@ru@list[#1]{#2}
}
\newcommand{\make@affil@ru@list}[2][]{
	\xdef\affil@ru@list{%
		\ifx\affil@ru@list\@empty%
			\unexpanded{\ifx#1\empty\else\@sscript{#1}\,\fi#2}%
		\else
    		\unexpanded\expandafter{\affil@ru@list}\par%
    		\unexpanded{\ifx#1\empty\else\@sscript{#1}\,\fi#2}%
		\fi
	}%
}
\def\authoreng{%
	\stepcounter{author@en@count}
	\@ifstar\@@author@en@corr\@@author@en
}
\newcommand{\@@author@en}[3][]{%
	\expandafter\gdef\csname @author@en@affil\arabic{author@en@count}\endcsname{#1}
	\expandafter\gdef\csname @author@en@last\arabic{author@en@count}\endcsname{#2}
	\expandafter\gdef\csname @author@en@first\arabic{author@en@count}\endcsname{#3}
	\@ifnextchar[{\@addi@en{#3}}{\relax}
}
\newcommand{\@@author@en@corr}[3][]{%
	\expandafter\gdef\csname @author@en@affil\arabic{author@en@count}\endcsname{#1}
	\expandafter\gdef\csname @author@en@last\arabic{author@en@count}\endcsname{#2}
	\expandafter\gdef\csname @author@en@first\arabic{author@en@count}\endcsname{#3}
	\expandafter\gdef\csname @author@en@corr\arabic{author@en@count}\endcsname{*}
	\@ifnextchar[{\@addi@en{#3}}{\relax}
}
\def\@addi@en#1[#2]{%
	\expandafter\gdef\csname @author@en@init\arabic{author@en@count}\endcsname{#2}
}
\newcommand\author@en@headlist{%
	\newcounter{@tmp@en@c}\stepcounter{@tmp@en@c}
	\whiledo{\not{\value{@tmp@en@c}>\value{author@en@count}}}{%
		\ifcsname @author@en@init\the@tmp@en@c\endcsname
			\@nameuse{@author@en@init\the@tmp@en@c}
		\else
			\@initials{\@nameuse{@author@en@first\the@tmp@en@c}}~%
		\fi
		\@nameuse{@author@en@last\the@tmp@en@c}%
		\@sscript{\@nameuse{@author@en@affil\the@tmp@en@c}}%
		\ifnum\the@tmp@en@c=\c@author@en@count\else\@ssep\fi%
		\stepcounter{@tmp@en@c}%
	}%
}
\def\infoeng#1{%
	\stepcounter{author@en@info@count}
	\ifnum\value{author@en@info@count}<\value{author@en@count}
		\setcounter{author@en@info@count}{\value{author@en@count}}
	\fi
	\expandafter\gdef\csname @author@en@info\arabic{author@en@info@count}\endcsname{#1}
}
\def\make@author@en@infolist{%
	\whiledo{\value{@tmp@en@a}<\value{author@en@count}}{
		\stepcounter{@tmp@en@a}
		\edef\@tmp@en@b{\the@tmp@en@a}%
		\expandafter\@addto@en@infolist\expandafter{\@tmp@en@b}
	}
}
\def\@addto@en@infolist#1{
	\g@addto@macro\author@en@infolist{\author@en@infoliststring{#1}\par}
}
\def\author@en@infoliststring#1{%
	\@nameuse{@author@en@last#1},
	\@nameuse{@author@en@first#1}%
	\expandafter%
	\ifx\csname @author@en@info#1\endcsname\relax
	\else
		\unskip\@ssep%
		\@nameuse{@author@en@info#1}%
	\fi%
	\expandafter%
	\ifx\csname @author@orcid#1\endcsname\relax
	\else
		\unskip\@scep\s@orcid\space\@nameuse{@author@orcid#1}%
	\fi%
	\expandafter%
	\ifx\csname @author@spin#1\endcsname\relax
	\else
		\unskip\@scep\s@spin\space\@nameuse{@author@spin#1}%
	\fi%
	\expandafter%
	\ifx\csname @author@email#1\endcsname\relax
	\else
		\unskip\@scep\s@email:\space\@nameuse{@author@email#1}%
	\fi.%
	\expandafter
	\if@english
		\expandafter
    	\ifx\csname @author@en@corr#1\endcsname\relax%
    		\else\space{\it\s@en@corresponding.
    		\@nameuse{@author@address#1}}
    	\fi
	\fi
	\vspace{4ex}
}
\newcommand{\affileng}[2][]{%
	\stepcounter{affil@en@count}
	\expandafter\gdef\csname @affil@en@affil\arabic{affil@en@count}\endcsname{#1}
	\expandafter\gdef\csname @affil@en@name\arabic{affil@en@count}\endcsname{#2}
	\make@affil@en@list[#1]{#2}
}
\newcommand{\make@affil@en@list}[2][]{
	\xdef\affil@en@list{%
		\ifx\affil@en@list\@empty%
			\unexpanded{\ifx#1\empty\else\,\@sscript{#1}\,\fi#2}%
		\else
    		\unexpanded\expandafter{\affil@en@list}%
    		\par\unexpanded{\ifx#1\empty\else\,\@sscript{#1}\,\fi#2}%
		\fi
	}%
}

\long\def\annotationrus#1{\long\def\theannotationrus{#1}}
\long\def\annotationeng#1{\long\def\theannotationeng{#1}}
\def\and{\unskip, }
\def\keywordsrus#1{\def\thekeywordsrus{#1}}
\def\keywordseng#1{\def\thekeywordseng{#1}}
\def\fundingrus#1{\def\thefundingrus{#1}}
\def\fundingeng#1{\def\thefundingeng{#1}}
\def\conflictofinterestrus#1{\def\theconflictofinterestrus{#1}}
\def\conflictofinteresteng#1{\def\theconflictofinteresteng{#1}}
\def\contributionrus#1{\def\thecontributionrus{#1}}
\def\contributioneng#1{\def\thecontributioneng{#1}}
\long\def\thanks#1{\def\thethanks{#1}}
\def\date#1{\def\thedate{#1}}
\def\revised#1{}
\def\accepted#1{}
\def\draft#1{}
\def\reviewer#1#2{}
\def\inforev#1{}
\def\affilrev#1{}
\def\review#1{}
\newcommand\reviewerrus[3][]{}
\newcommand\reviewereng[3][]{}
\long\def\review#1#2{}
\long\def\altbib#1{[#1]}
\long\def\altbib#1{}
\newcommand\url[1]{#1}

%%%%%%% Titul Page
\long\def\maketitle{%
	\make@author@ru@infolist
	\make@author@en@infolist
	\begingroup
		\if@english
			\title@en@head
			\title@ru@head
		\else
			\title@ru@head
			\title@en@head
		\fi
	\endgroup
	\begingroup
		\sloppy
		\expandafter
		\ifcsname @author@ru@last1\endcsname
			\ifcsname @author@ru@info1\endcsname
				\vspace{4ex}
				{\centering\bf\s@ru@authorsinfo\par}
				\nopagebreak%
				\author@ru@infolist%
			\fi%
		\fi%
		\expandafter
		\ifcsname @author@en@last1\endcsname
			\ifcsname @author@en@info1\endcsname
				\vspace{4ex}
				{\centering\bf\s@en@authorsinfo\par}
				\nopagebreak%
				\author@en@infolist%
			\fi%
		\fi%
	\endgroup
	\vspace{4ex}
	\nopagebreak
	\begingroup
		\ifdefined\thedate
			\if@english\s@en@date%
				  \else\s@ru@date%
			\fi\space\thedate\par
		\fi
	\endgroup
	\if@english\selectlanguage{english}\else\frenchspacing\fi
}

\def\title@ru@head{
	\begingroup
	\vspace{4ex}
	\sloppy
	\begingroup
		\parindent 0ex
		\ifdefined\theudc
			\s@udc\space\theudc\par
		\fi
	\endgroup
	\begingroup
		\raggedright
		\ifdefined\thetitlerus
			\centering\large\bf\thetitlerus\par
		\fi
	\endgroup
	\begingroup
		\raggedright
		\expandafter
		\ifcsname @author@ru@last1\endcsname
			\centering\author@ru@headlist\par
		\fi
	\endgroup
	\begingroup
		\raggedright
		\expandafter
		\ifcsname @affil@ru@name1\endcsname
			\centering\affil@ru@list\par
		\fi
	\endgroup
	\begingroup
		\ifdefined\theannotationrus
			\vspace{4ex}
			{\centering\it\s@ru@abstract\par}
			\nopagebreak
			\theannotationrus\par
		\fi
	\endgroup
	\begingroup
		\ifdefined\thekeywordsrus
			{\it\s@ru@keywords}:
			\thekeywordsrus\unskip.\par
		\fi
	\endgroup
	\begingroup
		\ifdefined\thefundingrus
			{\it\s@ru@funding}.
			\thefundingrus\par
		\fi
	\endgroup
	\begingroup
		\ifx\theconflictofinterestrus\undefined
			\else{\it\s@ru@conflictofinterest}.
			\theconflictofinterestrus\par
		\fi
	\endgroup
	\begingroup
		\ifx\thecontributionrus\undefined
			\else{\it\s@ru@contribution}.
			\thecontributionrus\par
		\fi
	\endgroup
	\endgroup
}
\def\title@en@head{
	\begingroup
	\vspace{4ex}
	\sloppy
	\begingroup
		\raggedright
		\ifdefined\thetitleeng
			\centering\large\bf\thetitleeng\par
		\fi
	\endgroup
	\begingroup
		\raggedright
		\expandafter
		\ifcsname @author@en@last1\endcsname
			\centering\author@en@headlist\par
		\fi
	\endgroup
	\begingroup
		\raggedright
		\expandafter
		\ifcsname @affil@en@name1\endcsname
			\centering\affil@en@list\par
		\fi
	\endgroup
	\begingroup
		\ifdefined\theannotationeng
			\vspace{4ex}
			{\centering\it\s@en@abstract\par}
			\nopagebreak
			\theannotationeng\par
		\fi
	\endgroup
	\begingroup
		\ifdefined\thekeywordseng
			{\it\s@en@keywords}:
			\thekeywordseng\unskip.\par
		\fi
	\endgroup
	\begingroup
		\ifdefined\thefundingeng
			{\it\s@en@funding}.
			\thefundingeng\par
		\fi
	\endgroup
	\begingroup
		\ifx\theconflictofinteresteng\undefined
			\else{\it\s@en@conflictofinterest}.
			\theconflictofinteresteng\par
		\fi
	\endgroup
	\begingroup
		\ifx\thecontributioneng\undefined
			\else{\it\s@en@contribution}.
			\thecontributioneng\par
		\fi
	\endgroup
	\endgroup
}

%%%%%%% Other commands
\def\orgname{}
\def\orgaddress{}
\def\street{}
\def\city{}
\def\postcode{}
\def\country{}

%%%%%%% Overriding sections
\renewcommand\section{\@startsection{section}{1}{0mm}%
                      {-4ex \@plus -.5ex \@minus -.2ex}%
                      {1ex \@plus.2ex \@minus -.2ex}%
                      {\@addtoreset{equation}{section}
                      \normalfont\bf\raggedright}%
}
\renewcommand\subsection{\@startsection{subsection}{2}{0mm}%
                      {-2ex\@plus -.5ex \@minus -.2ex}%
                      {1ex \@plus .2ex \@minus -.2ex}%
                      {\normalfont\normalsize\slshape\raggedright}%
}
\renewcommand{\@seccntformat}[1]{%
    \csname the#1\endcsname.\space%
}
\renewcommand\thesubsection{%
    \thesection.\arabic{subsection}\hskip 0.0em%
}
\renewcommand\thesubsubsection{%
    \thesubsection.\arabic{subsubsection}\hskip -0.0em%
}
\long\def\theequation{%
    \ifnum\c@section>\z@\thesection.\fi\@arabic\c@equation
}

%%%%%%% Overriding lists
\newcommand{\mbullet}{\raise.07em\hbox{\scalebox{.7}{$\bullet$}}}

\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 .1ex plus 0.3ex minus 0.2ex\leftmarginii 10\p@
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \list{\mbullet}%
    {\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{\textbullet}
\def\labelitemii{--}
\def\labelenumi{\theenumi)}
\def\labelenumii{\theenumii)}
\def\theenumi{\arabic{enumi}}
\def\theenumii{\alph{enumii}}
    
%%%%%%% Environment for theorems, lemmas, proofs, notes, etc.
\newcounter{propctr}
\setcounter{propctr}{-1}
\newenvironment{prop}[2][\@nil]{%
	\refstepcounter{propctr}%
    \vskip 2ex
    \def\tmp{#1}%
    \ifx\tmp\@nnil{\bf#2.}\else{\bf#2\space#1.}\fi}
    {\vskip 2ex}
\DeclareRobustCommand{\qed}{%
  \ifmmode
  	\else\leavevmode\unskip\penalty9999 \hbox{}\nobreak
  \fi\space\hbox{\qedsymbol}%
}

\if@biblatex
	\usepackage[
		backend=biber,
		sorting=none, 
		bibstyle=lncs, 
		citestyle=numeric-comp
	]{biblatex}
	\renewrobustcmd*{\bibinitdelim}{\addnbthinspace}
\else
	\RequirePackage{cite}
	\renewcommand\citemid{}
\fi

%%%%%%% The definition for the bibliography
\renewcommand\@biblabel[1]{#1.\hfill}
\renewenvironment{thebibliography}[1]{%
	\ifdefined\thethanks
		\if@english
		 	\section*{\s@en@acknowledgements}\par\thethanks
		\else
		 	\bigskip{\it\thethanks}
		\fi
	\fi
    \section*{\textbf{%
    	\if@english
    		\s@en@references\else
			\s@ru@references\space[\s@en@references]%
		\fi}}%
        \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
      \parskip 2pt
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist
     }
 
%%%%%%% Definitions of new and override some standard commands
\RequirePackage{bm}
\let\oldbm\bm\def\bm#1{\oldbm{\mathrm{#1}}}
\def\const{\mathrm{const}}
\def\Re{\mathop{\mathrm{Re}}\nolimits}
\def\Im{\mathop{\mathrm{Im}}\nolimits}
\def\ci{\mathop{\textrm{ci}}\nolimits}
\def\si{\mathop{\textrm{si}}\nolimits}
\def\grad{\mathop{\mathrm{grad}}\nolimits}
\def\rot{\mathop{\mathrm{rot}}\nolimits}
\def\graddiv{\mathop{\mathrm{graddiv}}\nolimits}
\def\div{\mathop{\mathrm{div}}\nolimits}
\def\sgn{\mathop{\mathrm{sgn}}\nolimits}
\def\sign{\mathop{\mathrm{sign}}\nolimits}
\def\ReGoth{%
    \ensuremath{\text{\usefont{OMS}{cmr}{m}{n}\symbol{"3C}}}}
\def\ImGoth{%
    \ensuremath{\text{\usefont{OMS}{cmr}{m}{n}\symbol{"3D}}}}
\def\No{\textnumero}
    
\let\vector\vec
\def\vec#1{\mathbf{#1}}
\newcommand*{\dm}[1]{#1\nobreak\discretionary{}
    {\hbox{$\mathsurround=0pt #1$}}{}
}
\renewcommand{\d}%
   {\@ifnextchar^{\DIfF}{\DIfF^{}}%
}
\def\DIfF^#1{%
   \mathop{\mathrm{\mathstrut d}}%
      \nolimits^{#1}\gobblespace
}
\def\gobblespace{%
   \futurelet\diffarg\opspace%
}
\def\opspace{%
   \let\DiffSpace\!%
   \ifx\diffarg(%
      \let\DiffSpace\relax
   \else
      \ifx\diffarg\[%
         \let\DiffSpace\relax
      \else
         \ifx\diffarg\{%
            \let\DiffSpace\relax
         \fi\fi\fi\DiffSpace%
}

%%%%%%% Required settings for tables
\if@defaultsize
\setlength{\extrarowheight}{-2pt}
\else\fi
\newcolumntype{Y}{>{%
	\small\centering\arraybackslash}X}
\newcolumntype{C}{>{%
	\small\arraybackslash}c}
\newcolumntype{L}{>{%
	\small\arraybackslash}l}
\newcolumntype{R}{>{%
	\small\arraybackslash}r}
\newcolumntype{P}{>{%
	\small\centering\arraybackslash}p}
\newcolumntype{Q}{>{%
	\small\raggedright\arraybackslash}p}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother
\endinput