
\usepackage{theorem,amsmath,amssymb,russcorr, fancyhdr, russcorr, russlh}

\def\arrow{{\:\longrightarrow\:}}
\newcommand{\restrict}[1]{{\left|_{{\phantom{|}\!\!}_{#1}}\right.}}
\newcommand{\cntrct}                % contraction with a vector field
{\hspace{2pt}\raisebox{1pt}{\text{$\lrcorner$}}\hspace{2pt}}

\renewcommand{\leq}{\leqslant}
\renewcommand{\geq}{\geqslant}
\renewcommand{\epsilon}{\varepsilon}


%\addtolength{\topmargin}{-5mm}
%\addtolength{\textheight}{40mm}
%\addtolength{\oddsidemargin}{-25mm}
%\addtolength{\textwidth}{45mm}

\setlength{\headheight}{15pt}
\pagestyle{fancy} 
\lhead{\tiny НМУ-ВШЭ, весна 2012, спецкурс} 
\lfoot{\tiny Комплексные поверхности } 
\cfoot{-- \thepage \ -- } \rfoot{\tiny Весна 
2012, листок \thesection,\ \ \sc\version}
\rhead{{\tiny  Миша Вербицкий}}


\def\1{\sqrt{-1}}
\def\6{\partial}
\def\rad{\operatorname{\sf rad}}
\def\Alt{\operatorname{\sf Alt}}
\def\Sym{\operatorname{\sf Sym}}
\def\Id{\operatorname{\sf Id}}
\def\rk{\operatorname{\sf rk}}
\def\Hom{\operatorname{Hom}}
\def\im{\operatorname{im}}
\def\Vol{\operatorname{Vol}}
\def\Lie{\operatorname{Lie}}
\def\Map{\operatorname{Map}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\Ob}{\operatorname{{{\cal O}b}}}
\newcommand{\Diff}{\operatorname{Diff}}
\newcommand{\Mat}{\operatorname{Mat}}
\newcommand{\Tot}{\operatorname{Tot}}
\newcommand{\diag}{\operatorname{\sf diag}}
\newcommand{\Char}{\operatorname{\sf char}}

\def\calo{{\mathcal O}}
\def\Z{{\mathbb Z}}
\def\R{{\mathbb R}}
\def\C{{\mathbb C}}
\def\Q{{\mathbb Q}}
\def\N{{\mathbb N}}




\makeatletter
\begingroup
\gdef\th@upshape{\normalfont
  \def\@begintheorem##1##2{%
        \item[\hskip\labelsep \theorem@headerfont ##1\ ##2.]
        \writevedomost{\string\mc{\thezadacha} \string & \string & \string 
        \\ \string \hline}
   }%
\def\@opargbegintheorem##1##2##3{%
   \item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3).]
   \writevedomost{\string\mc{\thezadacha ##3}  \string & \string \grd \string & \string\grp
   \string \\ \string \hline}
    }}
\endgroup

\theoremstyle{upshape}

\newtheorem{zadacha}{Задача}[section]

\begingroup
\gdef\th@generic{\normalfont
  \def\@begintheorem##1##2{%
        \item[\hskip\labelsep \theorem@headerfont ##1\ ##2.]
     }%
\def\@opargbegintheorem##1##2##3{%
   \item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3).]
    }}
\endgroup

\theoremstyle{generic}

\newtheorem{opredelenie}{Определение}[section]

\begingroup
\gdef\th@upshapenonumber{\normalfont
  \def\@begintheorem##1##2{%
        \item[\hskip\labelsep \theorem@headerfont ##1.]}%
\def\@opargbegintheorem##1##2##3{%
   \item[\hskip\labelsep \theorem@headerfont ##1\ (##3).]}}
\endgroup

\theoremstyle{upshapenonumber}

\newtheorem{ukazanie}{Указание}[section]
\newtheorem{zamechanie}{Замечание}[section]

\renewcommand{\labelenumi}{\ralph{enumi}.}
\newcommand{\subs}[1]{{\bigskip \bf\large {\centerline {#1}}\bigskip}}
\newcommand{\sttr}{{\bf(*)}}
\newcommand{\shrk}{{\bf(!)}}
\newcommand{\doublesttr}{{\bf(**)}}

\newcommand{\listok}[2]{%
\setcounter{page}{1}
\lhead{ \scriptsize #2 }
\section*{#2}
\refstepcounter{section}
\setcounter{section}{#1}
}
\renewcommand{\theequation}{\thesection.\arabic{equation}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VEDOMOST GENERATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newwrite\Vedomost
\immediate\openout\Vedomost = \jobname.vdm
\newcommand{\writevedomost}[1]{\immediate\write\Vedomost{ #1 }}

\newcommand{\NewVedomost}%
{\writevedomost{\string\end{tabular} \string & \string\vedomostsize %
\string\begin{tabular}[t]{|c|c|@{}c@{}|@{}c@{}|} %
\string\hline %
\string\mc{$N^0$}\string&\string\dtt\string&\string\pdp\string\\ \string\hline %
}}

\def\grd{\psboxit{box .7 setgray fill}{\phantom{\dtt}}\vphantom{666}}
\def\grp{\psboxit{box .7 setgray fill}{\phantom{\pdp}}\vphantom{666}}


\makeatother

\def\бф{\bf}
\def\ем{\em}
\def\ит{\it}
\def\задача{\begin{zadacha}}
\def\ез{\end{zadacha}}
\def\замечание{\begin{zamechanie}}
\def\еза{\end{zamechanie}}
\def\указание{\begin{ukazanie}}
\def\еу{\end{ukazanie}}
\def\eu{\end{ukazanie}}
\def\определение{\begin{opredelenie}}
\def\ео{\end{opredelenie}}
\def\eo{\end{opredelenie}}
\def\goth{\mathfrak}
\def\енум{\begin{enumerate}} 
\def\ее{\end{enumerate}}
\def\ee{\end{enumerate}}
\def\итем{\item %
    \writevedomost{\string & \ralph{enumi} \string &\string & \string \\ \string \hline } }

