\documentclass[a4paper,12pt]{article}
\usepackage{russ}
\global\setlength\paperheight  {297truemm}%
\global\setlength\paperwidth   {210truemm}%
\global\setlength\pdfpageheight{297truemm}%
\global\setlength\pdfpagewidth {210truemm}%
\global\setlength\textheight   {260truemm}%
\global\setlength\textwidth    {180truemm}%
\global\setlength\hoffset      {-1truein}%
\global\setlength\voffset      {-1truein}%
\global\setlength\pdfhorigin   {1truein}%
\global\setlength\pdfvorigin   {1truein}%
\global\setlength\oddsidemargin{15truemm}%
\global\setlength\topmargin    {5truemm}%
\global\setlength\leftskip     {0truemm}%
\global\setlength\rightskip    {0truemm}%



\begin{document}

\bigskip
\centerline{\Large{Пакет \texttt{russ.sty}}}
\bigskip
\centerline{\сегодня}
\bigskip

\begin{abstract}
Пакет \texttt{russ.sty} позволяет включить все возможности \LaTeX'а при работе с русским языком: команды с русскими буквами, русские буквы в формулах и PDF, русские типографские традиции, переносы, без использования babel.
\end{abstract}

\tableofcontents

\section{Использование}

Пользоваться пакетом очень просто.
Вместо
\begin{verbatim}  
\usepackage{cmap}
\usepackage[T2A]{fontenc}
\usepackage[cp1251]{inputenc}
\usepackage[russian]{babel}
\end{verbatim}
пишем просто 
\begin{verbatim}
\usepackage{russ}
\end{verbatim}



\section{Что это даёт?}


%\renewcommand{\labelenumi}{\ralph{\theenumi})}
%\renewcommand{\theenumi}{\Roman{enumi}}
\begin{rlist}
\item включает русские переносы;
\item устанавливает catcode'ы русских букв в “letter”, таким образом их можно использовать в командах (\verb"\newcommand{\команда}");
\item устанавливает шрифты для русских букв в математических формулах, таким образом можно писать \verb"$V_{машины}$";
\item переводит стандартные слова (Глава, Оглавление и т.д.);
\item настраивает \LaTeX по русские типографские традиции (всевозможные точки или скобки после номеров, центровки, отбивки и т.д.);
\item добавляет команды \verb"\ralph" и \verb"\Ralph" для русской нумерации а), б) ... (\verb"\ralph{счётчик}");
\item добавляет unicode-глифы русских букв и математических символов в pdf, благодаря чему работает copy-paste с текстом в PDF;
\item добавляет команды для оформления кавычек, \лк\те\пк, \лк\итд\пк, дефисов и тире в соответствии с русскими типографскими традициями;
\item добавляет $\tg$ для \verb"\tg", и другие тригонометрические функции.
\end{rlist}


\section{Список команд}


\begin{tabular}{|l|l|l|}
  \hline
  Команда &  Пример & Код \\
  \hline
  \verb"\ralph", \verb"\Ralph"&\ralph{page}, \ralph{section} & \verb"\ralph{page}, \ralph{section}" \\
  \verb"\ralphn", \verb"\Ralphn"&\ralphn{4}, \ralphn{8} & \verb"\ralphn{4}, \ralphn{8}" \\
  \verb"\Ralph", \verb"\Ralph"&\Ralph{page}, \Ralph{section} & \verb"\Ralph{page}, \Ralph{section}" \\
  \verb"\Ralphn", \verb"\Ralphn"&\Ralphn{4}, \Ralphn{8} & \verb"\Ralphn{4}, \Ralphn{8}" \\
  \verb"\Ralph", \verb"\Ralph"&\Ralph{page}, \Ralph{section} & \verb"\Ralph{page}, \Ralph{section}" \\
  \verb"\ipunct", \verb"\ipunct"&\ipunct{page}, \ipunct{section} & \verb"\ipunct{page}, \ipunct{section}" \\
  \verb"\ipunctn", \verb"\ipunctn"&\ipunctn{4}, \ipunctn{8} & \verb"\ipunctn{4}, \ipunctn{8}" \\
  \verb"\сегодня"&\сегодня& \verb"\сегодня" \\
  \verb"\Те", \verb"\те"&\Те с пробелами, \те гуд.& \verb"\Те с пробелами, \те гуд." \\
  \verb"\Тк", \verb"\тк"&\Тк с пробелами, \тк гуд.& \verb"\Тк с пробелами, \тк гуд." \\
  \verb"\итд", \verb"\итп"&Не рвёт по середине, \итд \итп& \verb"Не рвёт по середине, \итд \итп" \\
  \verb"\лк", \verb"\пк"&\лк Ясно\пк и \лк просто\пк.& \verb"\лк Ясно\пк и \лк просто\пк." \\

  \verb""&& \verb"" \\
  \verb"", \verb""&& \verb"" \\
  \hline
\end{tabular}


\section{PDF}

Попробуйте copy-paste для следующих строчек:

$$\hbox{Просто русский текст для копирования}$$

$$\sin(\alpha \pm \beta) = \sin\alpha \cos\beta \pm \sin\beta \cos\alpha.$$

$$F_{арх} = \rho_{жидк} \cdot g \cdot V_{тела} $$

Замечательно, не правда ли?


\newpage
\section{Исходный код}
\begin{verbatim}
% ===============================================================
% The package aims to facilitate Russian typesetting (based on input
% using MicroSoft Code Page 1251).
% If you are going to use another encoding just type
% \usepackage[ENCODING]{inputenc}
% Russian hyphenation is selected, and various mathematical commands
% are set up in Russian style.
% Furthermore all Cyrillic letters’ catcodes are set to “letter”,
% so that commands with Cyrillic letters in their names may be defined.
% Also Cyrillic letters are declared as math symbol, so you can
% use it in formulas.
% glyphtounicode.tex included, so there is no problem with
% Cyrillics in PDF (copy-paste)
% ===============================================================
% License: LaTeX Project Public License
% This software is copyright but you are granted a license which
% gives you, the "user" of the software, legal permission to copy,
% distribute, and/or modify the software. However, if you modify the
% software and then distribute it (even just locally) you must change
% the name of the software, or use other technical means to avoid confusion.
% ===============================================================
% based on russlh.sty, mathlh.sty, russcorr.sty and glyphtounicode.tex
% ===============================================================

\ProvidesPackage{russ}[2012/01/26  Russian language]
\RequirePackage[cp1251]{inputenc}
\RequirePackage{xspace}



% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================
% russlh    Начало: нужен для включения русского языка
% ===============================================================
\language\l@russian
\lefthyphenmin=2
\righthyphenmin=2

\input {t2aenc.def}
\renewcommand{\encodingdefault}{T2A}
\fontencoding{T2A}\normalsize

% From ltfinal.dtx
\def\reserved@a#1#2{%
   \@tempcnta#1\relax
   \@tempcntb#2\relax
   \reserved@b
}
\def\reserved@b{%
   \ifnum\@tempcnta>\@tempcntb\else
      \reserved@c\@tempcnta
      \advance\@tempcnta\@ne
      \expandafter\reserved@b
   \fi
}
\def\reserved@c#1{\catcode#1=11\relax}
% End from ltfinal.dtx
\reserved@a{192}{223} % А-Я
\reserved@a{224}{255} % а-я
\catcode156=11 % Ё
\catcode188=11 % ё

\providecommand{\glqq}{\quotedblbase}
\providecommand{\grqq}{\textquotedblleft}
\providecommand{\flqq}{\guillemotleft}
\providecommand{\frqq}{\guillemotright}
\providecommand{\No}{\textnumero}

% ===============================================================
% russlh        Конец
% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================












% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================
% mathlh.sty   Начало    Позволяет писать русские команды
% ===============================================================
%% \DeclareSymbolFont{roperators}      {T2A}{\rmdefault} {m}{n}
%% \SetSymbolFont    {roperators}{bold}{T2A}{\rmdefault} {b}{n}

\DeclareSymbolFont{rletters}        {T2A}{\rmdefault}{m}{it}
\SetSymbolFont    {rletters}{bold}  {T2A}{\rmdefault}{b}{it}

\expandafter\def\csname T2A-cmd\endcsname#1{%
    \ifx\protect\@typeset@protect\else\noexpand#1\expandafter\@gobble\fi%
    }
\DeclareMathSymbol{^^c0}{\mathalpha}{rletters}{"C0} %% А
\DeclareMathSymbol{^^c1}{\mathalpha}{rletters}{"C1} %% Б
\DeclareMathSymbol{^^c2}{\mathalpha}{rletters}{"C2} %% В
\DeclareMathSymbol{^^c3}{\mathalpha}{rletters}{"C3} %% Г
\DeclareMathSymbol{^^c4}{\mathalpha}{rletters}{"C4} %% Д
\DeclareMathSymbol{^^c5}{\mathalpha}{rletters}{"C5} %% Е
\DeclareMathSymbol{^^c6}{\mathalpha}{rletters}{"C6} %% Ж
\DeclareMathSymbol{^^c7}{\mathalpha}{rletters}{"C7} %% З
\DeclareMathSymbol{^^c8}{\mathalpha}{rletters}{"C8} %% И
\DeclareMathSymbol{^^c9}{\mathalpha}{rletters}{"C9} %% Й
\DeclareMathSymbol{^^ca}{\mathalpha}{rletters}{"CA} %% К
\DeclareMathSymbol{^^cb}{\mathalpha}{rletters}{"CB} %% Л
\DeclareMathSymbol{^^cc}{\mathalpha}{rletters}{"CC} %% М
\DeclareMathSymbol{^^cd}{\mathalpha}{rletters}{"CD} %% Н
\DeclareMathSymbol{^^ce}{\mathalpha}{rletters}{"CE} %% О
\DeclareMathSymbol{^^cf}{\mathalpha}{rletters}{"CF} %% П
\DeclareMathSymbol{^^d0}{\mathalpha}{rletters}{"D0} %% Р
\DeclareMathSymbol{^^d1}{\mathalpha}{rletters}{"D1} %% С
\DeclareMathSymbol{^^d2}{\mathalpha}{rletters}{"D2} %% Т
\DeclareMathSymbol{^^d3}{\mathalpha}{rletters}{"D3} %% У
\DeclareMathSymbol{^^d4}{\mathalpha}{rletters}{"D4} %% Ф
\DeclareMathSymbol{^^d5}{\mathalpha}{rletters}{"D5} %% Х
\DeclareMathSymbol{^^d6}{\mathalpha}{rletters}{"D6} %% Ц
\DeclareMathSymbol{^^d7}{\mathalpha}{rletters}{"D7} %% Ч
\DeclareMathSymbol{^^d8}{\mathalpha}{rletters}{"D8} %% Ш
\DeclareMathSymbol{^^d9}{\mathalpha}{rletters}{"D9} %% Щ
\DeclareMathSymbol{^^da}{\mathalpha}{rletters}{"DA} %% Ъ
\DeclareMathSymbol{^^db}{\mathalpha}{rletters}{"DB} %% Ы
\DeclareMathSymbol{^^dc}{\mathalpha}{rletters}{"DC} %% Ь
\DeclareMathSymbol{^^dd}{\mathalpha}{rletters}{"DD} %% Э
\DeclareMathSymbol{^^de}{\mathalpha}{rletters}{"DE} %% Ю
\DeclareMathSymbol{^^df}{\mathalpha}{rletters}{"DF} %% Я

\DeclareMathSymbol{^^e0}{\mathalpha}{rletters}{"E0} %% а
\DeclareMathSymbol{^^e1}{\mathalpha}{rletters}{"E1} %% б
\DeclareMathSymbol{^^e2}{\mathalpha}{rletters}{"E2} %% в
\DeclareMathSymbol{^^e3}{\mathalpha}{rletters}{"E3} %% г
\DeclareMathSymbol{^^e4}{\mathalpha}{rletters}{"E4} %% д
\DeclareMathSymbol{^^e5}{\mathalpha}{rletters}{"E5} %% е
\DeclareMathSymbol{^^e6}{\mathalpha}{rletters}{"E6} %% ж
\DeclareMathSymbol{^^e7}{\mathalpha}{rletters}{"E7} %% з
\DeclareMathSymbol{^^e8}{\mathalpha}{rletters}{"E8} %% и
\DeclareMathSymbol{^^e9}{\mathalpha}{rletters}{"E9} %% й
\DeclareMathSymbol{^^ea}{\mathalpha}{rletters}{"EA} %% к
\DeclareMathSymbol{^^eb}{\mathalpha}{rletters}{"EB} %% л
\DeclareMathSymbol{^^ec}{\mathalpha}{rletters}{"EC} %% м
\DeclareMathSymbol{^^ed}{\mathalpha}{rletters}{"ED} %% н
\DeclareMathSymbol{^^ee}{\mathalpha}{rletters}{"EE} %% о
\DeclareMathSymbol{^^ef}{\mathalpha}{rletters}{"EF} %% п
\DeclareMathSymbol{^^f0}{\mathalpha}{rletters}{"F0} %% р
\DeclareMathSymbol{^^f1}{\mathalpha}{rletters}{"F1} %% с
\DeclareMathSymbol{^^f2}{\mathalpha}{rletters}{"F2} %% т
\DeclareMathSymbol{^^f3}{\mathalpha}{rletters}{"F3} %% у
\DeclareMathSymbol{^^f4}{\mathalpha}{rletters}{"F4} %% ф
\DeclareMathSymbol{^^f5}{\mathalpha}{rletters}{"F5} %% х
\DeclareMathSymbol{^^f6}{\mathalpha}{rletters}{"F6} %% ц
\DeclareMathSymbol{^^f7}{\mathalpha}{rletters}{"F7} %% ч
\DeclareMathSymbol{^^f8}{\mathalpha}{rletters}{"F8} %% ш
\DeclareMathSymbol{^^f9}{\mathalpha}{rletters}{"F9} %% щ
\DeclareMathSymbol{^^fa}{\mathalpha}{rletters}{"FA} %% ъ
\DeclareMathSymbol{^^fb}{\mathalpha}{rletters}{"FB} %% ы
\DeclareMathSymbol{^^fc}{\mathalpha}{rletters}{"FC} %% ь
\DeclareMathSymbol{^^fd}{\mathalpha}{rletters}{"FD} %% э
\DeclareMathSymbol{^^fe}{\mathalpha}{rletters}{"FE} %% ю
\DeclareMathSymbol{^^ff}{\mathalpha}{rletters}{"FF} %% я

\DeclareMathSymbol{^^9c}{\mathalpha}{rletters}{"9C} %% Ё
\DeclareMathSymbol{^^bc}{\mathalpha}{rletters}{"BC} %% ё

\SetMathAlphabet{\mathrm}{normal}{T2A}{\rmdefault}{m}{n}
\SetMathAlphabet{\mathrm}{bold}  {T2A}{\rmdefault}{b}{n}
\SetMathAlphabet{\mathit}{normal}{T2A}{\rmdefault}{m}{it}
\SetMathAlphabet{\mathit}{bold}  {T2A}{\rmdefault}{b}{it}
\SetMathAlphabet{\mathbf}{normal}{T2A}{\rmdefault}{b}{n}
\SetMathAlphabet{\mathbf}{bold}  {T2A}{\rmdefault}{b}{n}
% ===============================================================
% mathlh.sty   Конец
% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================









% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================
% russcorr      Начало         Приводим оформление к нашему стилю
% ===============================================================
%%% Style options
%%%
\newif\if@longtoc
\DeclareOption{longtoc}{\@longtoctrue}
\DeclareOption{shorttoc}{\@longtocfalse}
\newif\if@indentheadings
\DeclareOption{indentheadings}{\@indentheadingstrue}
\DeclareOption{noindentheadings}{\@indentheadingsfalse}
\newif\if@textyо
\DeclareOption{yo}{\@textyоtrue}
\DeclareOption{noyo}{\@textyоfalse}
\ExecuteOptions{shorttoc,noindentheadings,noyo}
\ProcessOptions


\message{^^J Correcting math definitions,}
\def\tg{\mathop{\operator@font tg}\nolimits}
\def\ctg{\mathop{\operator@font ctg}\nolimits}
\def\cosec{\mathop{\operator@font cosec}\nolimits}
\def\arctg{\mathop{\operator@font arctg}\nolimits}
\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
\def\sh{\mathop{\operator@font sh}\nolimits}
\def\ch{\mathop{\operator@font ch}\nolimits}
\def\th{\mathop{\operator@font th}\nolimits}
\def\cth{\mathop{\operator@font cth}\nolimits}

\DeclareSymbolFont{AMSa}{U}{msa}{m}{n}
\DeclareSymbolFont{AMSb}{U}{msb}{m}{n}
\DeclareMathSymbol{\varkappa}{\mathord}{AMSb}{"7B}
\DeclareMathSymbol{\leqslant}{\mathrel}{AMSa}{"36}
\DeclareMathSymbol{\geqslant}{\mathrel}{AMSa}{"3E}

\message{heading names,}
\def\contentsname{Оглавление}
\def\figurename{Рис.}
\def\partname{Часть}
\def\listfigurename{Список рисунков}
\def\listtablename{Список таблиц}
\def\refname{Литература}
\def\bibname{Литература}
\def\indexname{Предметный указатель}
\def\tablename{Таблица}
\def\abstractname{Аннотация}
\@ifundefined{chapter}{}{\def\chaptername{Глава}}
\def\proofname{Доказательство}
%%
\message{counters,}
\def\ralph#1{\ralphn{\@nameuse {c@#1}}}
\def\ralphn#1{%
\ifcase #1\or а\or б\or в\or г\or д\or е\or ж\or з\or и\else\@iralph{#1}\fi}
\def\@iralph#1{%
\ifcase #1\or\or\or\or\or\or\or\or\or\or к\or л\or м\or н\or о\or п%
\or р\or с\or т\or у\or ф\or х\or ц\or ч\or ш\or щ\or э\or ю\or я%
\else\@ctrerr \fi}
\def\Ralph#1{\Ralphn{\@nameuse {c@#1}}}
\def\Ralphn#1{%
\ifcase #1\or А\or Б\or В\or Г\or Д\or Е\or Ж\or З\or И\else\@iRalph{#1}\fi}
\def\@iRalph#1{\ifcase #1\or\or\or\or\or\or\or\or\or\or К\or Л\or М\or Н\or О\or П%
\or Р\or С\or Т\or У\or Ф\or Х\or Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я%
\else\@ctrerr \fi}
\newcommand*{\ipunct}[1]{\ipunctn{\@nameuse{c@#1}}}
\newcommand*{\ipunctn}[1]%
  {\ifcase #1\or (\textit{i\/})\or (\textit{ii\/})\or (\textit{iii\/})%
  \or (\textit{iv\/})\or (\textit{v\/})\or %
  (\textit{vi\/})\or (\textit{vii\/})\or (\textit{viii\/})\or (\textit{ix\/})%
  \or (\textit{x\/})\or (\textit{xi\/})\or (\textit{xii\/})\or %
  (\textit{xiii\/})\or (\textit{xiv\/})\or (\textit{xv\/})\or (\textit{xvi\/})%
  \or (\textit{xvii\/})\or (\textit{xviii\/})%
  \or (\textit{xix\/})\or (\textit{xx\/}) \else\@ctrerr \fi}



\message{lists,}
% Теперь "русифицируем" окружение enumerate:
\def\labelenumi{\theenumi.}
\def\theenumii{\ralph{enumii}}
\def\labelenumii{\theenumii.}
\def\p@enumii{\theenumi}
\def\labelenumiii{{\bf--}}
\let\theenumiii\relax
\def\p@enumiii{\theenumi\theenumii}
%
% И еще запретим вкладывать четыре enumerate друг в друга ...
%
\def\enumerate{\ifnum \@enumdepth >2% было 3, а не 2
\@toodeep\else
      \advance\@enumdepth \@ne
      \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
      {\csname label\@enumctr\endcsname}{\usecounter
        {\@enumctr}\def\makelabel##1{\hss\llap{##1}}}\fi}
%
% Теперь определим окружение rlist
% для создания списков, в которых
% \item'ы нумеруются русскими буквами
% (строчными для rlist, прописными для rlist[u])
%
\@definecounter{rlistctr}
\newif\if@rlistsnested\@rlistsnestedfalse
\def\rlist{\@ifnextchar[{\@rlist}{\@rlist[l]}}
\def\@rlist[#1]{\if u#1\def\@tempa{R}\else\def\@tempa{r}\fi
                \if@rlistsnested\@toodeep\else
                \@rlistsnestedtrue
                \edef\therlistctr{\expandafter\noexpand\csname
                                \@tempa alphn\endcsname\noexpand\c@rlistctr}%
                \list{\labelrlist}{\usecounter
                   {rlistctr}}\fi}
\let\endrlist\endlist
\def\labelrlist{\therlistctr)}


\message{headings,}
\def\@seccntformat#1{\csname pre#1\endcsname\csname the#1\endcsname
                \csname post#1\endcsname}
\let\@Tocseccntformat\@seccntformat
\def\@postskip@{\hskip.5em\relax}

\def\postsection{.\@postskip@}
\def\postsubsection{.\@postskip@}
\def\postsubsubsection{.\@postskip@}
\def\postparagraph{.\@postskip@}
\def\postsubparagraph{.\@postskip@}

\def\presection{}
\def\presubsection{}
\def\presubsubsection{}
\def\preparagraph{}
\def\presubparagraph{}
%%% Unfortunately, \@seccntformat is not reflected in toc.
%%% Hence, I had to hack up the definition of \@sect a little.
\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #6{%
        \@hangfrom{\hskip #3\relax\@svsec}%
          \interlinepenalty \@M #8\@@par}%
    \endgroup
    \csname #1mark\endcsname{#7}%
    \addcontentsline{toc}{#1}{%
      \ifnum #2>\c@secnumdepth \else
        \protect\numberline{\@Tocseccntformat{#1}}%
      \fi
      \if@longtoc#8\else#7\fi}%
  \else
    \def\@svsechd{%
      #6{\hskip #3\relax
      \@svsec #8}%
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
          \protect\numberline{\@Tocseccntformat{#1}}%
        \fi
        \if@longtoc#8\else#7\fi}}%
  \fi
  \@xsect{#5}}


\if@indentheadings
\def\section{\@startsection {section}{1}{\parindent}%
                                   {3.5ex \@plus 1ex \@minus .2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\reset@font\Large\bfseries}}
\def\subsection{\@startsection{subsection}{2}{\parindent}%
                                     {3.25ex\@plus 1ex \@minus .2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\reset@font\large\bfseries}}
\def\subsubsection{\@startsection{subsubsection}{3}{\parindent}%
                                     {3.25ex\@plus 1ex \@minus .2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\reset@font\normalsize\bfseries}}
\fi


\def\@mainmattertrue{\let\if@mainmatter\iftrue}
\def\@mainmatterfalse{\let\if@mainmatter\iffalse}
\@ifclassloaded{report}{\@mainmattertrue}{}

\@ifundefined{chapter}{}{%
\def\postchapter{.}
\def\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{plain}%
                    \global\@topnum\z@
                    \if@indentheadings\@afterindenttrue
                        \else\@afterindentfalse
                    \fi
                    \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter
                                         \postchapter}%
                        \if@longtoc#2\else#1\fi}%
                       \else
                         \addcontentsline{toc}{chapter}%
                       {\if@longtoc#2\else#1\fi}\fi
                    \else
                      \addcontentsline{toc}{chapter}{\if@longtoc#2\else#1\fi}
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
}% end of conditional
\@ifundefined{chapter}{}{%
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\reset@font \@tempdima\parindent \raggedright
%%%            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     \if@indentheadings\advance\leftskip\@tempdima\fi
%%%  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    \ifnum \c@secnumdepth >\m@ne
       \if@mainmatter
         \huge\bfseries \@chapapp{} \thechapter\postchapter
         \par\nobreak
         \vskip 20\p@
       \fi
       \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par
    \nobreak
    \vskip 40\p@
  }}%
\def\@schapter#1{\if@twocolumn
                   \@topnewpage[\@makeschapterhead{#1}]%
                 \else
                   \@makeschapterhead{#1}%
                   \@afterheading
                 \fi}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\reset@font \@tempdima\parindent \raggedright
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     \if@indentheadings\advance\leftskip\@tempdima\fi
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
    \nobreak
    \vskip 40\p@
  }}
}% end of conditional


\message{captions,}
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{#1. #2}%
  \ifdim \wd\@tempboxa >\hsize
    \unhbox\@tempboxa\par
  \else
    \global \@minipagefalse
    \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}

\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname
  ext@#1\endcsname}{#1}{\protect\numberline{\csname
  the#1\endcsname.}{\ignorespaces #2}}\begingroup
    \@parboxrestore
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}

\message{theorems,}
\def\afterthmseparator{.}
\expandafter\ifx\csname theoremstyle\endcsname\relax
  \def\@begintheorem#1#2{\trivlist
     \item[\hskip \labelsep{\bfseries #1\ #2\unskip\afterthmseparator
  }]\itshape}
  \def\@opargbegintheorem#1#2#3{\trivlist
        \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)\afterthmseparator
  }]\itshape}
\fi
\message{running heads,}
\def\@ArticleHeadingsCorr{%
  \if@twoside
   \def\ps@headings{\let\@mkboth\markboth
   \let\@oddfoot\@empty\let\@evenfoot\@empty
   \def\@evenhead{\thepage\hfil\slshape\leftmark}%
   \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \def\sectionmark####1{\markboth {\uppercase{\ifnum \c@secnumdepth >\z@
      \thesection\postsection \hskip 1em\relax \fi ####1}}{}}%
    \def\subsectionmark####1{\markright {\ifnum \c@secnumdepth >\@ne
            \thesubsection\postsubsection \hskip 1em\relax \fi ####1}}}
  \else
   \def\ps@headings{\let\@mkboth\markboth
    \let\@oddfoot\@empty
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \def\sectionmark####1{\markright {\uppercase{\ifnum \c@secnumdepth >\z@
      \thesection\postsection \hskip 1em\relax \fi ####1}}}}
  \fi
}
\def\@ReportHeadingsCorr{%
  \if@twoside
    \def\ps@headings{\let\@mkboth\markboth
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{\thepage\hfil\slshape\leftmark}%
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \def\chaptermark####1{\markboth{\uppercase{\ifnum\c@secnumdepth>\m@ne
         \@chapapp\ \thechapter.\fi ####1}}{}}%
    \def\sectionmark####1{\markright{\uppercase{\ifnum\c@secnumdepth>\z@
      \thesection. \fi ####1}}}}
  \else
    \def\ps@headings{\let\@mkboth\markboth
    \let\@oddfoot\@empty
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \def\chaptermark####1{\markright{\uppercase{\ifnum\c@secnumdepth>\m@ne
      \@chapapp\ \thechapter. \fi ####1}}}}
  \fi
}
\def\@BookHeadingsCorr{%
\def\ps@headings{\let\@mkboth\markboth
 \let\@oddfoot\@empty\let\@evenfoot\@empty
 \def\@evenhead{\thepage\hfil\slshape\leftmark}%
 \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
      \def\chaptermark####1{%
        \markboth {\uppercase{\ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
            \@chapapp\ \thechapter. \fi
            ####1}}{}}%
 \def\sectionmark####1{\markright {\uppercase{\ifnum \c@secnumdepth >\z@
   \thesection. \fi ####1}}}}
}
\@ifclassloaded{article}{\@ArticleHeadingsCorr}{}
\@ifclassloaded{report}{\@ReportHeadingsCorr}{}
\@ifclassloaded{book}{\@BookHeadingsCorr}{}
%% \if A\@mainstyle % стиль - article (вставлено ".\@aftersepkern" после номера)
%%   \@ArticleHeadingsCorr
%% \else\if R\@mainstyle % стиль=report. Два пробела после точки заменены на один.
%%   \@ReportHeadingsCorr
%% \else % стиль=book (два пробела после точки заменены на один)
%%   \@BookHeadingsCorr
%% \fi\fi
%

\message{appendix,}
%% \if A\@mainstyle
\@ifclassloaded{article}{%
  \def\appendix{\par
    \setcounter{section}{0}%
    \setcounter{subsection}{0}%
    \let\sectionname\appendixname
    \def\thesection{\@Ralph\c@section}}
}{%
\def\appendix{\par
   \setcounter{chapter}{0}%
   \setcounter{section}{0}%
   \def\@chapapp{\appendixname}%
   \def\thechapter{\@Ralph\c@chapter}}
}

\message{\string\cleardoublepage,}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
   {\null\ps@empty % добавил \ps@empty (и заодно заменил \hbox{} на \null )
\newpage}\if@twocolumn{\null\ps@empty\newpage}\fi\fi\fi} % ditto

\message{quotes,}
% !!!! Отсюда и до второго вхождения !!!! все сперто из german.sty
\def\@allowhyphens{\penalty\@M\hskip\z@skip}
\def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}\dimen\z@\ht\z@
     \advance\dimen\z@ -\ht\tw@
     \setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@ }
%    (this lowers the german left quotes to the same level as the comma.)
\def\@glqq{{\ifhmode \edef\@SF{\spacefactor\the\spacefactor}\else
     \let\@SF\empty \fi \leavevmode
     \set@low@box{''}\box\z@\kern-.04em\@allowhyphens\@SF\relax}}
\def\glqq{\protect\@glqq}
\def\@grqq{\ifhmode \edef\@SF{\spacefactor\the\spacefactor}\else
     \let\@SF\empty \fi \kern-.07em``\kern.07em\@SF\relax}
\def\grqq{\protect\@grqq}
\def\@glq{{\ifhmode \edef\@SF{\spacefactor\the\spacefactor}\else
     \let\@SF\empty \fi \leavevmode
     \set@low@box{'}\box\z@\kern-.04em\@allowhyphens\@SF\relax}}
\def\glq{\protect\@glq}
\def\@grq{\kern-.07em`\kern.07em}
\def\grq{\protect\@grq}
% !!!!

% \сегодня is the Russian counterpart of \today;
% we prefer to keep the original \today intact
\def\сегодня{\number\day\space
                \ifcase\month\or
                 января\or февраля\or марта\or апреля\or мая\or
                 июня\or июля\or августа\or сентября\or октября\or
                 ноября\or декабря\fi\space\number\year}


\frenchspacing
\righthyphenmin 2

\if@textyо
   \message{the letter `yo',}
   \def\@textyе{е}
   \def\@textyЕ{Е}
   \DeclareRobustCommand{\"}[1]{%
    {\edef\@tempa{#1}%
     \ifx\@tempa\@textyе \char 163\relax
       \else \ifx\@tempa\@textyЕ \char 176\relax
         \else \accent "7F #1\fi\fi
    }%
   }
\fi


%% What follows is intended to ensure compatibility with
%% an earlier version of Russification of LaTeX 2.09,
%% where a possibility to automatically count the total number of
%% pages in the document was supported.
\let\c@totalpages=\@tempcnta
\let\@@global\global

\message{... finished.}

\AtBeginDocument{\ifdim\hsize<\@cclv\p@\pretolerance\m@ne\fi}

% ===============================================================
% russcorr      Конец
% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================
















% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================
% russadd        Начало
% ===============================================================
% ------------------ команды типа \те (т.е.) --------------------

% Набирайте "т.е." командой \те . Остальное -- аналогично.
% Теперь можно не беспокоиться о пробелах после этих команд.
% Например, можно наравне с
%     ..., \те\ ...
%     ..., \те{} ...
% писать просто
%     ..., \те ...
%

\newcommand*{\те}{т.\,е.\xspace}
\newcommand*{\Те}{Т.\,е.\xspace}
\newcommand*{\тк}{т.\,к.\xspace}
\newcommand*{\Тк}{Т.\,к.\xspace}
\newcommand*{\итд}{и~т.\,д.\xspace}
\newcommand*{\итп}{и~т.\,п.\xspace}
\newcommand{\лк}{\guillemotleft\nobreak\ignorespaces}
\newcommand{\пк}{\guillemotright\xspace}

%

% ------------------ команды типа \т (тире) ---------------------
% Команда \клей позволяет приклеивать слова к формуле или ещё чему-нибудь.
% Например, "частицы\клей $+$\клей поле"
% Команды \д (\ч) и \Д (\ч) ставят дефисы (чёрточки), после которых
% разрывы строки запрещены и разрешены, соответственно.
% Итак,
%   \д ставит дефис, после которого разрыв строки ЗАПРЕЩЁН.
%         Напр., "$1$\д форма"
%   \Д ставит дефис, после которого разрыв строки РАЗРЕШЁН.
%         Напр., "Остроградского\ч Гаусса" (или тут нужно \Д ?)
% Для интересующихся: если написать "$1$-форма" или "Остроградского--Гаусса",
% то будет разрешено разрывать строчку после дефиса и запрещено переносить
% слова "форма", "Остроградского" и "Гаусса". По этой причине и появилась
% команда \клей.
%

\newcommand*{\клей}{\nobreak\hskip\z@skip}
\DeclareRobustCommand*{\д}{\клей\hbox{-}\клей}
\DeclareRobustCommand*{\Д}{\клей\hbox{-}\hskip\z@skip}
\DeclareRobustCommand*{\ч}{\,\textendash\,\клей}
\DeclareRobustCommand*{\ч}{\,\textendash\,\hskip\z@skip}
\DeclareRobustCommand*{\т}{~\textemdash{} }
\DeclareRobustCommand*{\Т}{~\textemdash{} }
% ===============================================================
% russadd        Конец
% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================




% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================
% glyphtounicode.tex   Начало    For cyrillics in PDF
% Taken from glyphtounicode.tex, sorted
% ===============================================================
\pdfgentounicode=1
\pdfglyphtounicode{controlSTX}{0001}
\pdfglyphtounicode{controlSOT}{0002}
\pdfglyphtounicode{controlETX}{0003}
\pdfglyphtounicode{controlEOT}{0004}
\pdfglyphtounicode{controlENQ}{0005}
\pdfglyphtounicode{controlACK}{0006}
\pdfglyphtounicode{controlBEL}{0007}
\pdfglyphtounicode{controlBS}{0008}
\pdfglyphtounicode{controlHT}{0009}
\pdfglyphtounicode{controlLF}{000A}
\pdfglyphtounicode{controlVT}{000B}
\pdfglyphtounicode{controlFF}{000C}
\pdfglyphtounicode{controlCR}{000D}
\pdfglyphtounicode{controlSO}{000E}
\pdfglyphtounicode{controlSI}{000F}
\pdfglyphtounicode{controlDLE}{0010}
\pdfglyphtounicode{controlDC1}{0011}
\pdfglyphtounicode{controlDC2}{0012}
\pdfglyphtounicode{controlDC3}{0013}
\pdfglyphtounicode{controlDC4}{0014}
\pdfglyphtounicode{controlNAK}{0015}
\pdfglyphtounicode{controlSYN}{0016}
\pdfglyphtounicode{controlETB}{0017}
\pdfglyphtounicode{controlCAN}{0018}
\pdfglyphtounicode{controlEM}{0019}
\pdfglyphtounicode{controlSUB}{001A}
\pdfglyphtounicode{controlESC}{001B}
\pdfglyphtounicode{controlFS}{001C}
\pdfglyphtounicode{controlGS}{001D}
\pdfglyphtounicode{controlRS}{001E}
\pdfglyphtounicode{controlUS}{001F}
\pdfglyphtounicode{space}{0020}
\pdfglyphtounicode{spacehackarabic}{0020}
\pdfglyphtounicode{exclam}{0021}
\pdfglyphtounicode{quotedbl}{0022}
\pdfglyphtounicode{numbersign}{0023}
\pdfglyphtounicode{dollar}{0024}
\pdfglyphtounicode{percent}{0025}
\pdfglyphtounicode{ampersand}{0026}
\pdfglyphtounicode{quotesingle}{0027}
\pdfglyphtounicode{parenleft}{0028}
\pdfglyphtounicode{parenright}{0029}
...
...
\pdfglyphtounicode{centmonospace}{FFE0}
\pdfglyphtounicode{sterlingmonospace}{FFE1}
\pdfglyphtounicode{macronmonospace}{FFE3}
\pdfglyphtounicode{yenmonospace}{FFE5}
\pdfglyphtounicode{wonmonospace}{FFE6}
\relax
% ===============================================================
% glyphtounicode        Конец
% ===============================================================
% ===============================================================
% ===============================================================
% ===============================================================
\end{verbatim}


\end{document}