%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Параметры текста %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mathsurround 2pt                             

%\flushbottom
%\topskip=10pt
%\baselineskip=14pt

% Левое поле - 3см, правое - 1см              
\textwidth=170mm                                   
\oddsidemargin=0mm                            
\addtolength{\oddsidemargin}{-1in}            
\addtolength{\oddsidemargin}{30mm}         %  old=24  будет 30mm
% Высота текста примерно = 24.5см 
%\textheight=696pt                         
\textheight=24cm
\topmargin=0mm
\addtolength{\topmargin}{-1in}              
\addtolength{\topmargin}{10mm}             %    будет ок. 25mm

\sloppy                                       
\setlength{\parindent}{1.00cm}                
\renewcommand{\baselinestretch}{1.6}       
\pagestyle{myheadings}                     

\hoffset=-5mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Графика %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\unitlength 1mm
\linethickness{0.4pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Готика %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Готические шрифты 
%12pt (для другого кегля изменить)                
\font\got=eufm10   at 12pt             % Основной текст   
\font\gots=eufm7                       % Индекс           
\font\gotss=eufm5                      % Подиндекс        

% Готические буквы 
\newcommand{\g}[1]{\mbox{\got #1}}     % Основной текст 
\newcommand{\gs}[1]{\mbox{\gots #1}}   % Индекс         
\newcommand{\gss}[1]{\mbox{\gotss #1}} % Подиндекс      
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%% Операции, функции, значки и т.п. %%%%%%%%%%%%%%%%%%%%%%%%
%Все операторы и функции некурсивные (как в TeX'е)
\newcommand{\E}[1]{\mathop{{\rm E}\{#1\}}\nolimits} % мат. ожидание
\newcommand{\Sp}[1]{\mathop{{\rm Sp}\{#1\}}\nolimits} % след матрицы
\newcommand{\Tr}[1]{\mathop{{\rm Tr}\{#1\}}\nolimits} % след матрицы
\newcommand{\rank}{\mathop{\rm rank}\nolimits} % ранг матрицы
\newcommand{\Diag}{\mathop{\rm Diag}\nolimits} % диагональная матрица

\newcommand{\Ran}{\mathop{\rm Ran}\nolimits}     % область значений
\newcommand{\Dom}{\mathop{\rm Dom}\nolimits}     % область определения
\newcommand{\Ker}{\mathop{\rm Ker}\nolimits}     % ядро
\newcommand{\Img}{\mathop{\rm Im}\nolimits}      % мнимая часть
\newcommand{\Real}{\mathop{\rm Re}\nolimits}     % вещественная часть
\newcommand{\Span}{\mathop{\rm span}\nolimits}
\newcommand{\sgn}{\mathop{\rm sgn}\nolimits}
\newcommand{\inflim}{\mathop{\underline{\lim}}\limits} % нижний предел
\newcommand{\suplim}{\mathop{\overline{\lim}}\limits}  % верхний предел 
\newcommand{\dirint}{\mathop{\int\!\!\oplus}}          % прямой интеграл
\newcommand{\varinjlim}{\lim\limits_{\longrightarrow}}
\newcommand{\varprojlim}{\lim\limits_{\longleftarrow}}
\newcommand{\aim}{\mathop{\rm aim}\limits} % цель

\newcommand{\tina}{\mathrel{\mathop{\to}\limits_{< \!\!\!)}}} % стремится в угле
\newcommand{\dirsum}{\mathrel{\dot+}}         % прямая сумма лин. подпространств 
\newcommand{\eqdef}{\stackrel{\rm def}{=}}  % равно по определению
\newcommand{\eqround}{\stackrel{\rm r}{=}}  % округленно равно 
\newcommand{\degr}[1]{\mathord{\stackrel{\rm o}{#1}}} % кружок сверху
\newcommand{\qed}{\rule{0.8em}{0.8em}}    % конец доказательства

\newcommand{\Abs}[1]{\left|#1\right|}    % Растяжимый модуль
\newcommand{\Norm}[1]{\left\|#1\right\|} % Растяжимая норма

\newcommand{\cHz}{{\cal H}_0}
\newcommand{\cHo}{{\cal H}_1}
\newcommand{\cHi}{{\cal H}_i}

%Заглавные греческие буквы 
\newcommand{\Nu}{{\rm N}}
\newcommand{\Eta}{{\rm H}}

%Множества чисел
\newcommand{\NS}{{\bf N}} % множество натуральных чисел
\newcommand{\RS}{{\bf R}} % множество вещественных чисел
\newcommand{\CS}{{\bf C}} % множество комплексных чисел
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Сокращения %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\wt}{\widetilde}              % большая тильда
\newcommand{\wh}{\widehat}                % большая крышка 
\newcommand{\wb}{\overline}               % большая черта 
\newcommand{\ds}{\displaystyle}

\newcommand{\Int}[2]{\ds\int\limits_{#1}^{#2}}
\newcommand{\Frac}[2]{\ds\frac{\strut #1}{\strut #2}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Окружения %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% подправленное окружение \newtheorem
\def\@xnthm#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname
{\@definecounter{#1}\@addtoreset{#1}{#3}%
\expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand
  \arabic{#3}\@thmcountersep\@thmcounter{#1}}% !!!!! исправлено
\global\@namedef{#1}{\@thm{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
 


% Определение \newremark (аналогично \newtheorem, но некурсивный текст)
\def\newremark#1{\@ifnextchar[{\@ormk{#1}}{\@nrmk{#1}}}
 
\def\@nrmk#1#2{%
\@ifnextchar[{\@xnrmk{#1}{#2}}{\@ynrmk{#1}{#2}}}
 
\def\@xnrmk#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname
{\@definecounter{#1}\@addtoreset{#1}{#3}%
\expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand
  \arabic{#3}\@rmkcountersep\@rmkcounter{#1}}% !!!!  исправлено
\global\@namedef{#1}{\@rmk{#1}{#2}}\global\@namedef{end#1}{\@endremark}}}
 
\def\@ynrmk#1#2{\expandafter\@ifdefinable\csname #1\endcsname
{\@definecounter{#1}%
\expandafter\xdef\csname the#1\endcsname{\@rmkcounter{#1}}%
\global\@namedef{#1}{\@rmk{#1}{#2}}\global\@namedef{end#1}{\@endremark}}}

\def\@ormk#1[#2]#3{%
  \@ifundefined{c@#2}{\@latexerr{No remark environment `#2' defined}\@eha}%
  {\expandafter\@ifdefinable\csname #1\endcsname
  {\global\@namedef{the#1}{\@nameuse{the#2}}%
\global\@namedef{#1}{\@rmk{#2}{#3}}%
\global\@namedef{end#1}{\@endremark}}}}
 
\def\@rmk#1#2{\refstepcounter
    {#1}\@ifnextchar[{\@yrmk{#1}{#2}}{\@xrmk{#1}{#2}}}
 
\def\@xrmk#1#2{\@beginremark{#2}{\csname the#1\endcsname}\ignorespaces}
\def\@yrmk#1#2[#3]{\@opargbeginremark{#2}{\csname
       the#1\endcsname}{#3}\ignorespaces}
 
\def\@rmkcounter#1{\noexpand\arabic{#1}}
\def\@rmkcountersep{.}

\def\afterrmkseparator{.}

\def\@beginremark#1#2{\trivlist \item[\hskip \labelsep{\bf 
#1\ #2\unskip\afterrmkseparator}]\rm}
\def\@opargbeginremark#1#2#3{\trivlist 
\item[\hskip \labelsep{\bf #1\ #2\ (#3)\afterrmkseparator}]\rm}
\def\@endremark{\endtrivlist}



% Окружения (с новой нумерацией в каждой главе)
\newtheorem{theorem}{Теорема}[section]
\newtheorem{lemma}{Лемма}[section]
\newtheorem{proposition}{Предложение}[section]
\newtheorem{corollary}{Следствие}[section]

\newremark{remark}{Замечание}
\newtheorem{definition}{Определение}[section]

\newenvironment{proof}{\noindent{\bf Доказательство.}}
{\newline\hbox to \textwidth{\hfil\qed}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Колонтитулы %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\@evenhead}{\hfil--\ \thepage \ --\hfil}
\renewcommand{\@oddhead}{\hfil--\ \thepage \ --\hfil}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%% Разделы, счетчики %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\thesection}{Глава~\arabic{section}}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\thesubsubsection}{%
\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}

\def\l@section#1#2{\addpenalty{\@secpenalty}% good place for page break
   \addvspace{1.0em plus\p@}%
   \@tempdima 2cm
   \begingroup
     \parindent \z@ \rightskip \@pnumwidth
     \parfillskip -\@pnumwidth
     \bf
     \leavevmode
      \advance\leftskip\@tempdima
      \hskip -\leftskip
     #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
   \endgroup}



%Взято из russcorr.sty 
\def\section{\@startsection {section}{1}{\z@}{3.5ex plus1ex minus
.2ex}{2.3ex plus.2ex}{\reset@font\Large\bf}}

\def\subsection{\@startsection{subsection}{2}{\z@}{3.25ex plus1ex minus
.2ex}{1.5ex plus.2ex}{\reset@font\large\bf}}

\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{3.25ex plus 1ex minus
.2ex}{1.5ex plus.2ex}{\reset@font\large}}


% Двойная нумерация формул и рисунков
\@addtoreset{equation}{section}
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}

\@addtoreset{figure}{section}
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}

\@addtoreset{table}{section}
\renewcommand{\thetable}{\arabic{section}.\arabic{table}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Списки %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\leftmargin\leftmargini
\labelsep .5em
\labelwidth\leftmargini\advance\labelwidth-\labelsep

\def\@listI{\leftmargin\leftmargini \parsep 5\p@ plus2.5\p@ minus\p@
\topsep 10\p@ plus4\p@ minus6\p@
\itemsep=0pt}

\let\@listi\@listI
\@listi

\def\@listii{\leftmargin\leftmarginii
   \labelwidth\leftmarginii\advance\labelwidth-\labelsep
   \topsep 5\p@ plus2.5\p@ minus\p@
   \parsep 2.5\p@ plus\p@ minus\p@
   \itemsep=0pt}

\def\@listiii{\leftmargin\leftmarginiii
    \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
    \topsep 2.5\p@ plus\p@ minus\p@
    \parsep \z@ \partopsep \p@ plus\z@ minus\p@
    \itemsep=0pt}

\def\@listiv{\leftmargin\leftmarginiv
     \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}

\def\@listv{\leftmargin\leftmarginv
     \labelwidth\leftmarginv\advance\labelwidth-\labelsep}

\def\@listvi{\leftmargin\leftmarginvi
     \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Библиография %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\bi}[4]{\bibitem{#1} #2\quad #3 #4}
\newcommand{\bib}[3]{\bibitem{#1} #2 #3}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
