%%%%%% RECOMMENDED BOOK TEMPLATE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{book}
%%
\usepackage{hangcaption}
\usepackage{demopack}
%\renewcommand{\@biblabel}[1]{[#1]\hfill}
\usepackage{indentfirst}
%%
%\usepackage{a4wide} % analog of fullpage.sty                       %%
\usepackage{a4}     % standard page margins                        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyheadings}                                          %%
\pagestyle{fancyplain}                                              %%
%запоминает название главы:                                         %%
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\:#1}{}}       %%
%запоминает номер раздела и его название:                           %%
\renewcommand{\sectionmark}[1]{\markright{\thesection.\:#1}}        %%
\lhead[\fancyplain{}{}]%продолжение команды                         %%
      {\fancyplain{}{\bfseries\rightmark}}                          %%
\rhead[\fancyplain{}{\bfseries\leftmark}]%продолжение команды       %%
      {\fancyplain{}{\bfseries\thepage}}                            %%
\lfoot[\fancyplain{}{\bfseries\thepage}]%продолжение команды        %%
      {\fancyplain{}{}}                                             %%
\rfoot[\fancyplain{}{}]%продолжение команды                         %%
      {\fancyplain{}{\bfseries\thepage}}                            %%
\cfoot{}                                                            %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{makeidx}     % allows index generation                  %%
\usepackage{graphicx}    % standard LaTeX graphics tool             %%
\usepackage{multicol}    % used for the two-column index            %%
\usepackage[mathscr]{eucal}                                         %%
\usepackage{epsfig}                                                 %%
\usepackage{amssymb}                                                %%
\usepackage{amsmath}                                                %%
%\usepackage{mathrsfs}  %каллиграфический (как рукописный) алфавит  %%
\usepackage{texdraw}                                                %%
\usepackage{rotating}                                               %%
\usepackage{amsfonts}                                               %%
\usepackage{latexsym}                                               %%
%%%%%%%%%%%%%%%%%packages added for semushin3.tex%%%%%%%%%%%%%%%%%%%%%
\usepackage{subfigure} % was: subfignarms.sty                       %%
\usepackage{psfig}                                                  %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T2A]{fontenc}         %%%%%Cyrillic fonts               %%
\usepackage[cp1251]{inputenc}     %%%%%for MS Windows coding        %%
\usepackage[russian]{babel}       %%%%%Russain grammar rules        %%
%%%%%%%%%%%%%%%%%%%%%NEW COMMANDS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Local command definitions added by Semoushin%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\indexentry}[2]{\item #1 #2}%%%для генерации предметного%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%указателя книги%%
\newcommand{\Rset}{{\mathbb{R}}}                                    %%
\newcommand{\Zset}{{\mathbb{Z}}}                                    %%
\newcommand{\Nset}{{\mathbb{N}}}                                    %%
\newcommand{\Eset}{{\mathbb{E}}}                                    %%
\newcommand{\half}{\frac{\scriptstyle 1}{\scriptstyle 2}}           %%
\newcommand{\Hyp}{{\mathbb{\bf H}}}                                 %%
\newcommand{\keyw}[1]{{\bf #1}}%keywords to write program codes     %%
\newcommand{\wt}{\widetilde}                                        %%
\newcommand{\wh}{\widehat}                                          %%
\newcommand{\ds}{\displaystyle}                                     %%
\newcommand{\E}[1]{\mathop{{\rm \bf E}\left\{#1\right\}}\nolimits}  %%
\newcommand{\rank}{\mathop{\rm rank}\nolimits}                      %%
\newcommand{\tr}[1]{\mathop{{\rm tr}\{#1\}}\nolimits}               %%
\newcommand{\ud}{\mathrm{d}}                                        %%
\newcommand{\Nu}{{\rm N}}                                           %%
\newcommand{\Eta}{{\rm H}}                                          %%
\newcommand{\grad}{\mathop{\rm grad}\nolimits}                      %%
\newcommand{\diag}{\mathop{\rm diag \ }\nolimits}                   %%
%\newcommand{\diag}[2]{\mathop{\rm diag}[#1, \; #2]}                %%
\newcommand{\triang}{\mathop{\rm triang \ }\nolimits}               %%
\renewcommand{\mod}[1]{\mbox{ (mod #1)}}                            %%
\renewcommand{\arg}{\mathop{\rm arg \ }}                            %%
\newcommand{\col}[1]{\mathop{\rm col}[#1]}                          %%
%\DeclareMathOperator{\col}{col}                                    %%
\newcommand{\hm}[1]{#1\nobreak\discretionary{}{\hbox{\ensuremath{#1}%%
}}{}}%%продолжение команды дублирования знаков при переносе формулы%%%
%%%%%%%%%%%%%%%%%% Gothic fonts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Local definitions added by Semoushin                              %%
%12pt                                                               %%
\font\got=eufm10  % Text                                            %%
\font\gots=eufm7  % Script                                          %%
\font\gotss=eufm5 % Subscript                                       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%% Gothic letters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Local definitions added by Semoushin%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\g}[1]{\mbox{\got #1}}     % Text                       %%
\newcommand{\gs}[1]{\mbox{\gots #1}}   % Script                     %%
\newcommand{\gss}[1]{\mbox{\gotss #1}} % Subscript                  %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%новая команда типа \subparagraph. Пишите, e.g., так: \pr{Proof}    %%
\newcommand{\pr}[1]{\subparagraph{\it #1}}                          %%
%новая команда quod erat demonstrandum (что и требовалось доказать) %%
\newcommand{\qed}[1]{\hbox to \textwidth{\hfil  #1}}                %%
\newcommand{\QED}[1]{\quad{\hfill #1}}                              %%
%новая команда для центрирования любого текста. Пишите так: Текст}%%%%
\newcommand{\h}[1]{\vspace{2pt}\begin{center}\Large \bf %%%%%%%%%%%%%%
#1\end{center}}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\hs}[1]{\vspace{2pt}\begin{center}\large \bf %%%%%%%%%%%%%
#1\end{center}}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%новая команда вместо \paragraph. Пишите так: \p{Текст}             %%
\newcommand{\p}[1]{\paragraph{\bf #1}}                              %%
%новая команда вместо \subparagraph. Пишите так: \s{Текст}          %%
\newcommand{\s}[1]{\subparagraph{\bf #1}}                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\ulsu}{{\huge \bf У}\nolinebreak\hspace{-1.1em}         %%
\raisebox{-1ex}{{\huge \bf л}}\nolinebreak\hspace{-0.66em}          %%
\raisebox{1ex}{{\huge \bf Г}}\nolinebreak\hspace{-0.9em}            %%
{\huge \bf У}}%эмблема "УлГУ"                                       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%Ввели счетчик определений, чтобы ставился номер определения:     %%
\newcounter{defi}%[chapter]                                         %%
\newcommand{\dfn}{\par\addtocounter{defi}{1}%                       %%
\par{\vspace{6pt}\bf Определение\, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\arabic{chapter}.\arabic{defi}.\quad}}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Ввели команду \z чтобы писалось жирным шрифтом слово Задача           %%
%Ввели счетчик задач, чтобы ставился номер задачи:                     %%
\newcounter{zad}%[chapter]                                             %%
\newcommand{\z}{\par\addtocounter{zad}{1}%            перенос команды  %%
\par{\vspace{6pt}\it Задача \arabic{chapter}.\arabic{zad}.  }}         %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%завели новый счетчик для примеров и установили формат записи для них  %%
\newcounter{exampl}[chapter]                                           %%
\newcommand{\exampel}% продолжение команды                             %%
{\par\smallskip\noindent\refstepcounter{exampl}{\bf Пример%    %%%%%%%%%%
% продолжение команды%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\, \thechapter.\arabic{exampl}.}\; \ }                                 %%
\renewcommand{\theexampl}{\thechapter.\arabic{exampl}}                 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Чтобы главы могли %начинаться не только на нечетной странице:         %%
%\renewcommand{\cleardoublepage}{\clearpage}                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%завели новый счетчик для задач и установили формат записи для задач   %%
\newcounter{zadacha}[section]%                                         %%
\newcommand{\zadacha}% продолжение команды                             %%
{\refstepcounter{zadacha}{\bf Задача \thechapter.\arabic{zadacha}.}\ } %%
\renewcommand{\thezadacha}% продолжение команды                        %%
{\thechapter.\arabic{zadacha}}                                         %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%завели новый счетчик для упражнений и установили формат записи        %%
\newcounter{upraz}[section]%                                           %%
\newcommand{\upraz}%% продолжение команды                              %%
{\refstepcounter{upraz}{\bf Упражнение \thechapter.\arabic{upraz}.}\ } %%
\renewcommand{\theupraz}{\thechapter.\arabic{upraz}}%                  %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Local ENVIRONMENTS added by Semoushin%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%новое окружение для заключения текста в рамку шириной, задаваемой в%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%аргументе   %%
%пишите так: \begin{myframe}{6cm} Текст Текст Текст \end{myframe}   %%
\newenvironment{myframe}[1]{\begin{tabular}{|p{#1}|}\hline}%%%%%%%%%%%
{\\\hline\end{tabular}}                                             %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%RUSSIAN ENVIRONMENTS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                   %%
\newtheorem{rusremarka}{Замечание}[chapter]                         %%
\newtheorem{rustheo}{Теорема}[chapter]                              %%
\newtheorem{ruscoro}{Следствие}[chapter]                            %%
\newtheorem{rusalg}{Алгоритм}[chapter]                              %%
\newtheorem{rusdefn}{Определение}[chapter]                          %%
\newtheorem{ruslem}{Лемма}[chapter]                                 %%
%                                                                   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ENGLISH ENVIRONMENTS added by Semoushin%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                   %%
\newtheorem{remarka}{Remark}%[section]                              %%
\newtheorem{theo}{Theorem}%[section]                                %%
\newtheorem{coro}{Corollary}%[section]                              %%
\newtheorem{alg}{Algorithm}%[section]                               %%
\newtheorem{defn}{Definition}%[section]                             %%
\newtheorem{lem}{Lemma}%[section]                                   %%
%                                                                   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%hyphenations%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\hyphenation{mechan-isms Sect-ion const-ant correspond-ingly        %%
monitor-ing heuri-stically imple-menting}                           %%
%%добавляйте выше через пробел СЛОВА с рекомендуемыми переносами    %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeindex             % used for the subject index                 %%
                       % please use the style svind.ist with        %%
                       % your makeindex program                     %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%added by semoushin%%%%%%%%%%%%%%%%%%%%%%%%%ДОБАВИЛ СЕМУШИН%%%
\multlinegap=2cm  %отступ от полей первой и последней формулы       %%
%%                для многострочных формул в окружении multline     %%
\mathsurround=2pt %  дополнительный пробел вокруг формул в тексте   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%\renewcommand{\@biblabel}[1]{#1.\hfill}
%%
\begin{document}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\renewcommand{\bibname}{Библиографический список}
%переопределили команду таблиц для того, чтобы подчинение (т.е. нумерация)
%было таким, каким хочет его сделать автор (Семушин И.В.)
\renewcommand{\thetable}%
{\thesection.\arabic{table}}
%переопределили команду фигур аналогично предыдущему
\renewcommand{\thefigure}%
{\thesection.\arabic{figure}}

%\renewcommand{\@biblabel}[1]{#1.\hfill}
%%
\frontmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%если вставите сюда \include{titlepage} и др., то здесь будет идти  %%
%отдельная нумерация страниц римскими цифрами                       %%
\include{cover}%это команда вставить обложку cover.tex              %%
\mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\include{titlepage}%команда вставить титульный лист titlepage.tex)%%%%
\include{regdata}%команда вставить лист выходных сведений regdata.tex%
%\include{pref}%вставить листы предисловия (имя его файла pref.tex) %%
\setcounter{page}{3}%установить начальное значение счетчика страниц %%
\tableofcontents %вставить оглавление (файл создается автоматически)%%
%%%\include{pref} %вставить листы предисловия (имя файла pref.tex)     %%
%%%\include{chapter1} %вставить главу книги (имя файла chapter1.tex)   %%
\include{chapter2} %вставить главу книги (имя файла chapter2.tex)   %%
%%%\include{chapter3} %вставить главу книги (имя файла chapter3.tex)   %%
%%%\include{chapter4} %вставить главу книги (имя файла chapter4.tex)   %%
%%%\include{chapter5} %вставить главу книги (имя файла chapter5.tex)   %%
%%%\include{chapter6} %вставить главу книги (имя файла chapter6.tex)   %%
%\include{chapter7} %вставить главу книги (имя файла chapter7.tex)   %%
%\include{chapter8} %вставить главу книги (имя файла chapter8.tex)   %%
%\include{chapter9} %вставить главу книги (имя файла chapter9.tex)   %%
%\include{chapter10}%вставить главу книги (имя файла chapter10.tex)  %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\appendix%это команда о том, что дальше пойдет приложение к книге  %%
%\include{appendix}%команда вставить приложение к книге appendix.tex%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\backmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%\include{referenc}%вставить список литератеры к книге referenc.tex  %%
%\printindex%это команда вставить предметный указатель к книге      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{theindex} %%три команды, чтобы печатался предметный указатель%
%\input{book-index.tex} %%они сейчас (временно) закрыты             %%
%\end{theindex}                                                     %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%\include{outdata}%вставить выходные данные книги outdata.tex        %%
\end{document}                                                      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
