% article.sty 16-Mar-88    modified for international usage
%
% Modified by J.Schrod (TeXsys).
% according to the suggestion of H.Partl (TU Wien) in german.sty
% to make caption names adaptable to other languages.
%
% Modified by A.Kosachev (PROGRAMMIROVANIE)
% according to the needs of our journal new addition vesion
%
% Modified by A.Aranson (NIIDAR)
% according to the needs of our journal new addition vesion
%
% Modified by A.Stolyarov (CMC MSU)
% fixed counters so that references to \He and \he sections work again

\typeout{Document Style `newprog1e' <15 Jan 11> for new version our journal,}
\typeout{made from `newprog1' <22 Apr 95> for new version our journal,}
\typeout{made from `article' international version <17 Oct 89>.}


\def\@ptsize{0} \@namedef{ds@11pt}{\def\@ptsize{1}}
\@namedef{ds@12pt}{\def\@ptsize{2}}
\def\ds@twoside{\@twosidetrue \@mparswitchtrue} \def\ds@draft{\overfullrule
5pt}
\@options
%\input art1\@ptsize.sty\relax
%\input art11prge.sty\relax

\def\labelenumi{\theenumi.}
\def\theenumi{\arabic{enumi}}
\def\labelenumii{(\theenumii)}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}
\def\labelenumiii{\theenumiii.}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}
\def\labelenumiv{\theenumiv.}
\def\theenumiv{\Alph{enumiv}}
\def\p@enumiv{\p@enumiii\theenumiii}

\def\labelitemi{$\bullet$}
\def\labelitemii{\bfseries --}
\def\labelitemiii{$\ast$}
\def\labelitemiv{$\cdot$}

\def\verse{\let\\=\@centercr
 \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent
 \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
\let\endverse\endlist
\def\quotation{\list{}{\listparindent 1.5em
 \itemindent\listparindent
 \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
\let\endquotation=\endlist
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

\def\descriptionlabel#1{\hspace\labelsep \bfseries #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
 \let\makelabel\descriptionlabel}}
\let\enddescription\endlist

\def\theequation{\arabic{equation}}


\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \else \newpage \fi \thispagestyle{empty}\c@page\z@}
\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}

\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt
\tabbingsep \labelsep

\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt
%\newcounter{part}
%\newcounter {section}
%\newcounter {subsection}[section]
%\newcounter {subsubsection}[subsection]
%\newcounter {paragraph}[subsubsection]
%\newcounter {subparagraph}[paragraph]

%   Previous State
%\def\thepart{\Roman{part}} \def\thesection {\arabic{section}}
%\def\thesubsection {\thesection.\arabic{subsection}}
%\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}

%    Modified state
% \def\thepart{\Roman{part}} \def\thesection {\arabic{section}}
% \def\thesubsection {\thesection \arabic{subsection}.}
% %\def\thesubsection {{\slshape \thesection} {\slshape \arabic{subsection}.}}
% \def\thesubsubsection {\thesubsection \arabic{subsubsection}.}
% \def\theparagraph {\thesubsubsection \arabic{paragraph.}}
% \def\thesubparagraph {\theparagraph \arabic{subparagraph}.}
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{3}

\def\contentsname{Contents} % <----------
\def\tableofcontents{\section*{\contentsname
\@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}
 \@starttoc{toc}}
\def\l@part#1#2{\addpenalty{\@secpenalty}
 \addvspace{2.25em plus 1pt} \begingroup
 \@tempdima 3em \parindent \z@ \rightskip \@pnumwidth \parfillskip
-\@pnumwidth
 {\large \bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
 \nobreak \endgroup}
\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
\@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth
 \parfillskip -\@pnumwidth
 \bfseries \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip #1\nobreak\hfil
\nobreak\hbox to\@pnumwidth{\hss #2}\par
 \endgroup}

\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\def\listfigurename{List of Figures} % <----------
\def\listoffigures{\section*{\listfigurename\@mkboth
{\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}\@starttoc{lof}}
\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\def\listtablename{List of Tables} % <----------
\def\listoftables{\section*{\listtablename\@mkboth
{\uppercase{\listtablename}}{\uppercase{\listtablename}}}\@starttoc{lot}}
\let\l@table\l@figure

\def\refname{References} % <----------
\def\thebibliography#1{\begin{center}
 {\cyr\CYRS\CYRP\CYRI\CYRS\CYRO\CYRK \ \CYRL\CYRI\CYRT\CYRE\CYRR\CYRA\CYRT\CYRU\CYRR\CYRERY}
\end{center}
 \list
 {\arabic{enumi}.}{\settowidth\labelwidth{#1.}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist

\newif\if@restonecol
\def\indexname{Index} % <----------
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
 \columnseprule \z@
 \columnsep 35pt\twocolumn[\section*{\indexname}]
 \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
 \thispagestyle{plain}\parindent\z@
 \parskip\z@ plus .3pt\relax\let\item\@idxitem}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
\def\footnoterule{\kern-3\p@
 \hrule width .4\columnwidth
 \kern 2.6\p@}

\long\def\@makefntext#1{\parindent 1em\noindent
 \hbox to 1.8em{\hss$^{\@thefnmark}$}#1}


%\setcounter{topnumber}{2}
%\def\topfraction{.7}
%\setcounter{bottomnumber}{1}
%\def\bottomfraction{.3}
%\setcounter{totalnumber}{3}
%\def\textfraction{.2}
%\def\floatpagefraction{.5}
%\setcounter{dbltopnumber}{2}
%\def\dbltopfraction{.7}
%\def\dblfloatpagefraction{.5}

\setcounter{topnumber}{10}
\def\topfraction{.95}
\setcounter{bottomnumber}{10}
\def\bottomfraction{.95}
\setcounter{totalnumber}{13}
\def\textfraction{.01}
\def\floatpagefraction{.01}
\setcounter{dbltopnumber}{4}
\def\dbltopfraction{.95}
\def\dblfloatpagefraction{.01}


\long\def\@makecaption#1#2{
 \vskip 10pt
 \setbox\@tempboxa\hbox{#1}
 \ifdim \wd\@tempboxa >\hsize #1\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil}
 \fi}


%\newcounter{figure}
\def\thefigure{\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\figurename{Figure} % <----------
\def\fnum@figure{\figurename{} \thefigure.}
%\def\figure{\@float{figure}}
\def\figure{\bfseries \@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
%\newcounter{table}
\def\thetable{\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\tablename{Table} % <----------
\def\fnum@table{\tablename{} \thetable.}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}

\def\udk#1{\def\@udk{#1}}
\def\dateinput#1{\def\@dateinput{#1}}
\def\rusabstr#1{\def\@rusabstr{{\small #1}}}

\def\rubrika#1{\def\@rubrika{#1}}
\newlength{\rulelength}

\renewcommand\maketitle{\par
 \begingroup
 \def\thefootnote{\fnsymbol{footnote}}
 \def\@makefnmark{\hbox
 to 0pt{$^{\@thefnmark}$\hss}}
 \if@twocolumn
 \twocolumn[\@maketitle]
 \else \newpage
 \global\@topnum\z@ \@maketitle \fi\thispagestyle{plain}\@thanks
 \endgroup
 \setcounter{footnote}{0}
 \let\maketitle\relax
 \let\@maketitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\gdef\@udk{}\gdef\@dateinput{}
 \gdef\@rusabstr{}
\let\thanks\relax}

\renewcommand\@maketitle{ %\newpage
 \null
%\noindent\rule{\textwidth}{0.2mm} \par \vskip -8pt
%\noindent\rule{\textwidth}{0.2mm} \par

%\hspace*{0.5cm}

%\noindent ~\hrulefill \mbox{\small\bfseries~\@rubrika ~} \hrulefill ~

\newlength{\rublength}
\settowidth{\rublength}{{\small\bfseries~\@rubrika ~}}
\setlength{\rulelength}{0.5\textwidth}
\addtolength{\rulelength}{-2mm}
\addtolength{\rulelength}{-0.5\rublength}

\noindent\rule[4pt]{\rulelength}{0.2mm}
         \hfill
         \mbox{\small\bfseries~\@rubrika~}
         \hfill
         \rule[4pt]{\rulelength}{0.2mm} \par \vskip -\baselineskip

\noindent\rule[-0.2pt]{\rulelength}{0.2mm}
         \hfill
          \rule[-0.2pt]{\rulelength}{0.2mm} \par


% \vskip 0.65em {\footnotesize\itshape{\cyr\CYRU\CYRD\CYRK}\@udk} \par
 \vskip 0.65em {\footnotesize\itshape{\cyr\CYRU\CYRD\CYRK\ }{\slshape \@udk}} \par
 \vskip -0.2mm \begin{center}
 {\Large\bfseries \@title \par} \vskip 0.5em {\large\bfseries \lineskip .5em
%\copyright \hspace*{0.2cm} \@curyear {\cyrg}.  \@author \par}
\copyright \hspace*{0.2cm} \@curyear$\:$ {\cyrg}. \mdseries \@author \par}
{\small{\cyr\CYRP\cyro\cyrs\cyrt\cyru\cyrp\cyri\cyrl\cyra\ \cyrv\ \cyrr\cyre\cyrd\cyra\cyrk\cyrc\cyri\cyryu\ }\@dateinput \par}
\end{center}
\vskip -0.2mm \begin{quote}
\@rusabstr
%\par
\end{quote} \par
\vskip 1.em}


\def\abstractname{~} % <----------
\def\abstract{\if@twocolumn
\section*{\abstractname}
\else \small
%%\begin{center}
%%{\bfseries \abstractname\vspace{-.5em}\vspace{0pt}} <---------
%%\end{center}
\quotation
\fi}
\def\endabstract{\if@twocolumn\else\endquotation\fi}
\mark{{}{}}

\if@twoside \def\ps@headings{\let\@mkboth\markboth
\def\@oddfoot{}\def\@evenfoot{}\def\@evenhead{\rmfamily \thepage\hfil \sl
\leftmark}\def\@oddhead{\hbox{}\slshape \rightmark \hfil
\rmfamily\thepage}\def\sectionmark##1{\markboth {\uppercase{\ifnum \c@secnumdepth
>\z@
 \thesection\hskip 1em\relax \fi ##1}}{}}\def\subsectionmark##1{\markright
{\ifnum \c@secnumdepth >\@ne
 \thesubsection\hskip 1em\relax \fi ##1}}}
\else \def\ps@headings{\let\@mkboth\markboth
\def\@oddfoot{}\def\@evenfoot{}\def\@oddhead{\hbox {}\slshape \rightmark \hfil
\rmfamily\thepage}\def\sectionmark##1{\markright {\uppercase{\ifnum \c@secnumdepth
>\z@
 \thesection\hskip 1em\relax \fi ##1}}}}
\fi
\def\ps@myheadings{\let\@mkboth\@gobbletwo
\def\@oddhead{\hbox{}\slshape\rightmark \hfil
\rmfamily\thepage}\def\@oddfoot{}\def\@evenhead{\rmfamily \thepage\hfil\slshape\leftmark\hbox
{}}\def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}}

\def\today{\ifcase\month\or
 January\or February\or March\or April\or May\or June\or
 July\or August\or September\or October\or November\or December\fi
 \space\number\day, \number\year}
\ps@plain \pagenumbering{arabic} \onecolumn \if@twoside\else\raggedbottom\fi


\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{0cm}
\setlength{\voffset}{-1.2cm}
\setlength{\hoffset}{-0.75cm}

\setlength{\topmargin}{0cm}
%\setlength{\topmargin}{-1.1cm}
\setlength{\headsep}{0.3cm}
%\setlength{\footskip}{0.8cm}
\setlength{\footskip}{1.25cm}

\setlength{\textfloatsep}{0.8cm}
\setlength{\intextsep}{0.3cm}

\setlength{\textwidth}{17.5cm}
%\setlength{\textheight}{24cm}
\setlength{\textheight}{23.55cm}

\twocolumn
\sloppy
\flushbottom

\parindent 1em
\leftmargini 2em
\leftmarginv .5em
\leftmarginvi .5em
%\oddsidemargin 30pt
%\evensidemargin 30pt
\marginparwidth 48pt 
\marginparsep 10pt 

%\input{russian.sty}

%\input{fancyhea.sty}
%\twoside
%\input{russianv.sty}

% NEW FROM ARTICLE TEX-FILE

\setlength{\columnsep}{0.5cm}
\pagestyle{fancyplain}

\def\journalnumber#1{\def\@journumb{#1}}
\def\curyear#1{\def\@curyear{#1}}
\def\authorlist#1{\def\@authorlist{#1}}
\def\titlehead#1{\def\@titlehead{#1}}

\def\headerdef{
\def\thisnumber{\hspace*{0.5cm}{{\footnotesize{\cyr\CYRP\CYRR\CYRO\CYRG\CYRR\CYRA\CYRM\CYRM\CYRI\CYRR\CYRO\CYRV\CYRA\CYRN\CYRI\CYRE}
\hspace*{0.3cm}  ${\mathrm N}^{\underline{\mathrm o}}$ \@journumb\hspace*{0.3cm}
\@curyear}\hspace*{0.5cm}}}
%\def\thisnumbertitle{{\footnotesize \itshape{\cyr\CYRP\CYRR\CYRO\CYRG\CYRR\CYRA\CYRM\CYRM\CYRI\CYRR\CYRO\CYRV\CYRA\CYRN\CYRI\CYRE}, \@curyear,
\def\thisnumbertitle{{\footnotesize \itshape{\cyr\CYRP\CYRR\CYRO\CYRG\CYRR\CYRA\CYRM\CYRM\CYRI\CYRR\CYRO\CYRV\CYRA\CYRN\CYRI\CYRE}},
{\footnotesize \slshape \@curyear},
%$N^o$ \@journumb, \hspace*{0.3cm} {\cyrs}. \thepage\ - \pageref{lastpage}}}
{\footnotesize $N^{\underline o}$ {\slshape \@journumb}}, %\hspace*{0.1cm}
{\footnotesize {\itshape {\cyrs}}. {\slshape \thepage}\ $\!\!$--{\slshape \pageref{lastpage}}}}
% Previous state:
% $N^o$ \@journumb }}

%       \lhead[\fancyplain{F1}{F2}]{\fancyplain{F3}{F4}}
%       specifies the LHEAD value in a two-sided document:
%       F1 on an even-numbered ``plain'' page
%       F2 on an even-numbered normal page
%       F3 on an odd-numbered ``plain'' page
%       F4 on an odd-numbered normal page.
\lhead[\fancyplain{\thisnumbertitle}{\small\thepage}]{\fancyplain{\thisnumbertitle}{}}
\rhead[\fancyplain{}{}]{\fancyplain{}{\small\thepage}}
\chead[\fancyplain{}{{\small\@authorlist}}]{\fancyplain{}{{\small\@titlehead}}}
%\lfoot[\fancyplain{}{}]{\fancyplain{}{\thisnumber}}
\lfoot[\fancyplain{}{}]{\fancyplain{}{\ifnum\thepage= 17 {\small\bf
2}\thisnumber\else {\ifnum\thepage=19\thisnumber\hspace{9.8cm}
${\small{\mathbf 2}^*}$\else {\ifnum\thepage=33 {\small\bfseries 3}
\thisnumber\else {\ifnum\thepage=35 \thisnumber\hspace{9.8cm}
${\small{\mathbf 3}^*}$\else {\ifnum\thepage=49 {\small\bfseries 4}
\thisnumber\else {\ifnum\thepage=51 \thisnumber\hspace{9.8cm}
${\small{\mathbf 4}^*}$\else {\ifnum\thepage=65 {\small\bfseries 5}
\thisnumber\else {\ifnum\thepage=67 \thisnumber \hspace{9.8cm} ${\small{\mathbf 5}^*}$
\else \thisnumber\fi}\fi}\fi}\fi}\fi}\fi}\fi}\fi}}
\rfoot[\fancyplain{}{\thisnumber}]{\fancyplain{}{}}
%\cfoot[\fancyplain{\small\thepage}{}]{\fancyplain{\small\thepage}{}}
\cfoot[\fancyplain{\small\thepage}{}]{\fancyplain{\ifnum\thepage=17
\hspace{-10.25cm}{\small\bfseries 2}\thisnumber\else \ifnum\thepage=19
%\hspace{8.65cm}{\small\thepage}\hspace{8.0cm} ${\small{\mathbf 2}^*}$\else
\hspace{8.65cm}{\small\thepage}\hspace{7.5cm} ${\small{\mathbf 2}^*}$\else
\ifnum\thepage=33 \hspace{-10.25cm}{\small\bfseries 3}\thisnumber\else
%\ifnum\thepage=35 \hspace{8.65cm}{\small\thepage}\hspace{8.0cm}
%${\small{\mathbf 3}^*}$\else \ifnum\thepage=49 \hspace{-10.25cm}{\small\bf
\ifnum\thepage=35 \hspace{8.5cm}{\small\thepage}\hspace{7.8cm}
${\small{\mathbf 3}^*}$\else
\ifnum\thepage=49 \hspace{-10.25cm}{\small\bfseries 4}\thisnumber\else
%\ifnum\thepage=51 \hspace{8.65cm}{\small\thepage}\hspace{8.0cm}
\ifnum\thepage=51 \hspace{8.5cm}{\small\thepage}\hspace{7.8cm} 
${\small{\mathbf 4}^*}$\else \ifnum\thepage=65 \hspace{-10.25cm}{\small\bf
5}\thisnumber\else \ifnum\thepage=67 \hspace*{7.75cm}{\small\thepage}
%\hspace{8.65cm}{\small\thepage}
\hspace*{7.0cm}${\small{\mathbf 5}^*}$
%\hspace{8.0cm}${\small{\mathbf 5}^*}$
\else \small\thepage\fi\fi\fi\fi\fi\fi\fi\fi}{}}
%\gdef\@journumb{}\gdef\@authorlist{}\gdef\@titlehead{}
}                                          % End header definition
%\setlength{\headrulewidth}{0pt}
\renewcommand{\headrulewidth}{0pt}

%\raggedbottom

\newcommand{\contitem}[3]{
    \noindent\begin{minipage}[b]{12.5cm}
      \begin{description}
        \item[ #1]  #2  \dotfill\
      \end{description}
    \end{minipage} \hfill   #3}

%\newcommand{\headrule}[2]{
%{\large\bfseries\noindent{\cyr\CYRP\ \CYRR\ \CYRO\ \CYRG\ \CYRR\ \CYRA\ \CYRM\ \CYRM\ \CYRI\ \CYRR\ \CYRO\ \CYRV\ \CYRA\ \CYRN\ \CYRI\ \CYRE} \hfill #1 . #2} \\
%\rule{\textwidth}{0.2mm} \vspace{2cm} \\}

%\newcommand{\arttitle}[4]{
%\noindent {\itshape УДК #1} \\
%\vspace{0.2cm}
%\begin{center}
%\copyright \hspace*{0.2cm} #2 г. {\large\bfseries #3} \\
%\vspace{0.5cm}
%{\large\bfseries #4}
%\end{center}}

%\def\he#1{\vskip.5cm\centerline{\bfseries #1}\vskip.3cm}
%\def\He#1{\begin{center}{\large\bfseries #1}\end{center}}

%%\def\he#1{\language=0\begin{center}{\slshape \subsection{#1}}\end{center}\language=1}
%\def\he#1{\language=0\begin{center}\subsection{#1}\end{center}\language=1}
\def\he#1{
%\addtocounter{subsection}{+1}
\refstepcounter{subsection}
\begin{center}
{\slshape \arabic{section}.\arabic{subsection}.}\hspace{1em}{\itshape #1}
\end{center}}
\def\He#1{
\refstepcounter{section}
\begin{center}
{\arabic{section}.}\hspace{1em}{#1}
\end{center}}

\unitlength=1cm

% Следующие два определения команд для вставки PCX картинок
%  example of using \insertfig
%  \insertfig{figr1.pcx}{V4.3}{H0}{Fig 1}{Задача ограничений в
%  геометрическом моделировании}
\def\insertplot#1#2#3{\par
 \hbox{%
  \hskip #3 true cm
   \vbox to #2 true cm{\par\noindent
    \special{em: graph #1}
    \vfil
   }%
  }\par\noindent
 }

\def\newfootnote#1
{\setlength{\parindent}{0em} \footnote{#1} \setlength{\parindent}{1em}}

\def\insertfig#1#2#3#4#5{\par
\begin{figure}[hbt]
\insertplot {#1}{#2}{#3}
\caption {#5 \label{#4}}
\end{figure}
\par
}
%-------------- Конец определений команд для вставки картинок
