\usepackage{amsmath,amssymb,amsthm,amsfonts}
%\usepackage[cp1251]{inputenc}
%\usepackage[russian, english]{babel}
\usepackage[T2A]{fontenc}
\usepackage[cp1251]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{graphicx}
\usepackage{cite}
\usepackage{color, soul}

\usepackage[left=20mm,right=20mm,top=30mm,bottom=30mm]{geometry}

\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=blue,
urlcolor=blue,
filecolor=blue,
pdfpagemode=UseNone,
pdfstartview=FitH,
pdfhighlight=/N,
hypertexnames=false
}

\newcommand*{\fullref}[2]{\hyperref[{#2}]{#1 \ref*{#2}}}


\usepackage{float}
\usepackage[font=small,labelsep=period, figurename={Рис.}]{caption}

\renewcommand{\thefigure}{\arabic{figure}}
%\addto\captionsrussian{\renewcommand{\figurename}{Рис.}}
\renewcommand{\p@figure}[1]{{Рис. #1}}



%\usepackage{indentfirst}
\renewcommand{\baselinestretch}{1.15}
\parindent=2.5em

\newif\if@revision
\@revisionfalse

\DeclareOption{revision}{\@revisiontrue}
\ProcessOptions

\if@revision
\RequirePackage{lineno}
\linenumbers
\fi


\makeatletter

% содержание пакета indentfirst
\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue

\def\year#1{\def\@year{#1}}
\def\volume#1{\def\@volume{#1}}
\def\issue#1{\def\@issue{#1}}
\def\firstpage#1{\def\@firstpage{#1} \setcounter{page}{#1}}


\year{2022}
\volume{1}
\issue{1}
\firstpage{1}

% Название статьи для верхнего заголовка
\def\shortTitle#1{\def\@shortTitle{#1}}
\shortTitle{Название статьи}

% Авторы статьи для верхнего заголовка
\def\authorList#1{\def\@authorList{#1}}
\authorList{Список авторов}

\def\copyrights#1{\def\@copyrights{#1}}
\copyrights{Список авторов}


%\def\frsthdr{MATH\,\&\,TCS, Т. \@volume, № \@issue\, (\@year), \@firstpage---\pageref*{LastPage}}
\def\frsthdr{МАТЕМАТИКА И ТЕОРЕТИЧЕСКИЕ КОМПЬЮТЕРНЫЕ НАУКИ, \@firstpage---\pageref*{LastPage}}


\def\footline{\ifnum\thepage=\@firstpage \footlineone\fi}
\def\footlineone{\noindent \footnotesize \sf \copyright\ \@copyrights \hspace{\fill}  \hbox{}}

\def\oddhedr{\ifnum\thepage=\@firstpage \firsthdr \else \odhdr \fi}
\def\firsthdr{\hspace{\fill} \sl \frsthdr \hspace{\fill}\hbox{}}
\def\odhdr{\hspace{\fill}\sl\rightmark \@shortTitle \hspace{\fill}
\rm \thepage}

\def\evnhedr{\ifnum\thepage=\@firstpage \firsthdr \else \evhdr \fi}
\def\evhdr{\noindent \rm \thepage\hspace*{\fill} \sl\leftmark
\@authorList \hspace*{\fill}\hbox{}}

\def\ps@newpstyle{\def\@oddhead{
\hspace{-0.65em}
\vbox{\oddhedr\vskip 1mm \hrule width
\textwidth}
}
%\def\@oddfoot{}
\def\@evenhead{
\hspace{-0.65em}
\vbox{\evnhedr\vskip 1mm \hrule width
\textwidth}
}\textsc{}
\def\@oddfoot{\footline}
\def\@evenfoot{\@oddfoot}
}

%\def\thefootnote{}
\raggedbottom


%RUSSIAN
\renewenvironment{abstract}
{\begin{list}{--}{%
\setlength{\leftmargin}{4em}%
\setlength{\rightmargin}{4em}%
}%
\small\item[] \textbf{Аннотация.}
}
{\end{list}}

\newenvironment{keywords}
{\begin{list}{--}{%
\setlength{\leftmargin}{4em}%
\setlength{\rightmargin}{4em}%
}%
\small\item[] \textbf{Ключевые слова:}
}
{\end{list}}

%ENGLISH
\newenvironment{abstractEng}
{\begin{list}{--}{%
\setlength{\leftmargin}{4em}%
\setlength{\rightmargin}{4em}%
}%
\small\item[] \textbf{Abstract.}
}
{\end{list}}

\newenvironment{keywordsEng}
{\begin{list}{--}{%
\setlength{\leftmargin}{4em}%
\setlength{\rightmargin}{4em}%
}%
\small\item[] \textbf{Keywords:}
}
{\end{list}}


\Russian
\sloppy
\rm

\def\thesection{\arabic{section}}


\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname. }

\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\large\bfseries}}

\addto\captionsenglish{\renewcommand{\refname}{References}}
\newcommand{\startenglishpage}{\clearpage \renewcommand{\refname}{References} \vspace{-1em}}


\newcommand{\emptyfootnote}{%
	\let\xxxx\thempfn
	\let\thempfn\relax% Remove footnote number printing mechanism
	\footnotetext[0]{%
		%\hrule%
		\vspace{-1em}%
		}
	\let\thempfn\xxxx%
}

\makeatother

\AtBeginDocument{
\pagestyle{newpstyle}
\emptyfootnote

\vspace{-2em}
}

\AtEndDocument{
\label{LastPage}
}