\RequirePackage{epsfig,alltt,wrapfig,float,ulem,underscore,psboxit}

\tolerance=10000

%\RequirePackage[dvips]{color}

%\usepackage{pscyr}

%\usepackage[koi8-r]{inputenc} 
%\usepackage[russian]{babel} 

%\addtolength{\textwidth}{40mm}
%\addtolength{\oddsidemargin}{-30mm}

%\paperheight=210mm
%\paperwidth=148mm

\def\em{\it}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% LISTS: {ul} with extra \item[] in the beginning
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{ul}{\begin{list}{$\bullet$}{
\setlength{\topsep}{0pt}
\setlength{\parsep}{0pt}
\setlength{\leftmargin}{4em}
\setlength{\listparindent}{1em}
\setlength{\itemindent}{0em}}\renewcommand{\makelabel}[1]{\bf ##1}\ignorespaces\item[]}{\end{list}}


\newenvironment{ud}{\begin{list}{$\bullet$}{
\setlength{\topsep}{0pt}\setlength{\labelsep}{1em}
\setlength{\parsep}{0pt}
\setlength{\leftmargin}{2em}
\setlength{\labelwidth}{1em}
\setlength{\listparindent}{2em}
\setlength{\itemindent}{0em}} 
\renewcommand{\makelabel}[1]{\bf ##1}\ignorespaces }{\unskip\end{list}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% IMAGES %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\restylefloat{figure}

\def\emptybox{\setbox\tw@\null\box\tw@}

\def\image#1#2#3{\emptybox%  Helps to anchor the image properly
\parbox[#1]{#2}{\epsfig{file=#3,width=#2}}}

\def\wrappedimage#1#2#3{\par%
\begin{wrapfigure}{#1}{#2}%
\epsfig{file=#3,width=#2}%
\end{wrapfigure}\par%
}

\long\def\@makecaption#1#2{%
\sbox\@tempboxa{#2}
  \ifdim \wd\@tempboxa >\hsize
    #2   \par
  \else
    \begin{center}#2\end{center} \par 
  \fi
  \vskip\belowcaptionskip}

\def\caption#1{\@makecaption{}{#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% A HREF %%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\long\def\insidelink#1#2{\uline{#2}\footnote{\tiny http://imperium.lenin.ru/#1}}

%\long\def\locallink#1#2{\item[]{#2}\dotfill\ \pageref{#1}
%\\}
\long\def\locallink#1#2{{#2} (���.~\pageref{#1})}


%\long\def\link#1#2{{\color[rgb]{1,1,1}#2}}
\long\def\link#1#2{\uline{#2}\footnote{\tiny #1}}
\long\def\locallinkedimage#1#2{#2}
\long\def\insidelinkedimage#1#2{#2}
\long\def\linkedimage#1#2{#2}

\def\fontcolor#1{}

\let\htmlnewline=\\
\def\tdleft{\raggedright}
\def\tdright{\raggedleft}
\def\td{\let\\=\htmlnewline}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Chapter                         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



  \renewcommand{\chapter}{%
     \secdef\ChapterNumbered\ChapterStarred}
  \renewcommand{\chaptername}{}
  \renewcommand{\thechapter}{}

  \def\ChapterNumbered[#1]#2{%
      \addcontentsline{toc}{chapter}{#1}
      \refstepcounter{chapter}
      {\chaptermark{#2}
          { {{\bf\Huge \uppercase{#2}\par}}}
      }
      \vspace{\baselineskip}}

  \newcommand{\ChapterStarred}[1]{%
      \refstepcounter{chapter}
      \chaptermark{#1}%
      \vspace{\baselineskip}}

  \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
                             



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Section command defined there:  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \renewcommand{\section}{%
     \secdef\SectionNumbered\SectionStarred}
  \renewcommand{\thesection}{}

  \def\SectionNumbered[#1]#2{%
      \addcontentsline{toc}{section}{#1}\refstepcounter{section}
      {\newpage \sectionmark{#1}
          \centering \Huge\bf #2\par}\smallskip}

  \newcommand{\SectionStarred}[1]{%
      {\centering\Large\bf  #1}\sectionmark{#1}%
      \medskip}

  \renewcommand{\sectionmark}[1]{\markright{\uppercase{#1}}}

\@addtoreset{footnote}{chapter}








\long\def\headerone#1{\chapter{#1}}
\long\def\headertwo#1{\section{#1}}
\long\def\headerthree#1{\par\medskip{\centerline\bf\LARGE #1}\par\medskip}
\long\def\headerfour#1{{\begin{center}\large\bf #1\end{center}}\par\smallskip}
\long\def\headerfive#1{\par{\bf #1}\par}
\long\def\headersix#1{{\par\bf\small #1}\par}

\long\def\unknowntag#1{ UNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAGUNKNOWNTAG}

%\parindent=0pt

