nm-coursework/config.tex
2023-10-17 23:47:58 +03:00

258 lines
6.3 KiB
TeX
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\documentclass[oneside,final,14pt]{extreport}
\usepackage[utf8]{inputenc}
\usepackage[T2A,T1]{fontenc}
\usepackage[russian]{babel}
\usepackage{threeparttable}
\usepackage[labelsep=endash,tableposition=top,labelfont=md,textfont=md]{caption}
\usepackage{indentfirst}
\usepackage{float}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{array}
\usepackage{graphicx}
\usepackage[compact]{titlesec}
\usepackage{titletoc}
\usepackage{xinttools}
\usepackage{ragged2e}
\usepackage{listingsutf8}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{xstring}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage[strict=true]{csquotes}
\usepackage[abspath]{currfile}
\usepackage[hidelinks,linktoc=all]{hyperref}
% ОТЛАДОЧНЫЕ ФУНКЦИИ --------------------
% \usepackage{showframe}
% ПОЛЯ ----------------------------------
\usepackage{geometry}
\geometry{
a4paper,
% total={170mm,257mm},
left=30mm,
top=15mm,
right=15mm,
bottom=20mm
}
% ОФОРМЛЕНИЕ СОДЕРЖАНИЯ -----------------
\addto\captionsrussian{
\renewcommand{\contentsname}%
{\normalsize \MakeUppercase{Содержание}}%
}
\dottedcontents{chapter}[0cm]{}{1em}{2mm}
\titlecontents{chapter}
[0em]
{}
{\thecontentslabel. }
{}
{\titlerule*[2mm]{.}\contentspage}
\titlecontents{section}
[1.5em] % 1.5em (chapter) + 2.3em
{}
{\thecontentslabel. }
{\hspace*{-2.3em}}
{\titlerule*[2mm]{.}\contentspage}
\titlecontents{subsection}
[3.5em] % 1.5em (chapter) + 2.3em
{}
{\thecontentslabel. }
{\hspace*{-2.3em}}
{\titlerule*[2mm]{.}\contentspage}
% ОФОРМЛЕНИЕ ЗАГОЛОВКОВ -----------------
% В т.ч. и содержания
\titleformat{\paragraph}[runin]
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph} {\parindent}{3.25ex plus 1ex minus .2ex}{1em}
\titleformat{\chapter}[display]{\normalfont\large\bfseries}{}{0cm}{\large\centering}
\titleformat{\section}
{\normalfont\large\bfseries}{\thesection}{5mm}{}
\makeatletter
% NormalTeXSyntaxON
\def\@makechapterhead#1{%
\vspace*{0\p@}%
{\parindent \z@ \raggedright \normalfont \setstretch{1.2}
\interlinepenalty\@M
\large \bfseries \space \thechapter. #1\par\nobreak
}}
% NormalTeXSyntaxOFF
\titlespacing{\chapter}{0pt}{-5mm}{0cm}
% ОФОРМЛЕНИЕ СПИСКОВ --------------------
\setlist{noitemsep,align=left,left=\parindent,topsep=0pt}
\setlist[itemize]{label=--}
% ОФОРМЛЕНИЕ ЛИСТИНГОВ КОДА -----------------
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{
frame=tb,
language=C++,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3,
escapechar={|},
emptylines=0,
extendedchars=true,
literate={а}{{\cyra}}1
{б}{{\cyrb}}1
{в}{{\cyrv}}1
{г}{{\cyrg}}1
{д}{{\cyrd}}1
{е}{{\cyre}}1
{ё}{\"{\cyre}}1
{ж}{{\cyrzh}}1
{з}{{\cyrz}}1
{и}{{\cyri}}1
{й}{{\cyrishrt}}1
{к}{{\cyrk}}1
{л}{{\cyrl}}1
{м}{{\cyrm}}1
{н}{{\cyrn}}1
{о}{{\cyro}}1
{п}{{\cyrp}}1
{р}{{\cyrr}}1
{с}{{\cyrs}}1
{т}{{\cyrt}}1
{у}{{\cyru}}1
{ф}{{\cyrf}}1
{х}{{\cyrh}}1
{ц}{{\cyrc}}1
{ч}{{\cyrch}}1
{ш}{{\cyrsh}}1
{щ}{{\cyrshch}}1
{ъ}{{\cyrhrdsn}}1
{ы}{{\cyrery}}1
{ь}{{\cyrsftsn}}1
{э}{{\cyrerev}}1
{ю}{{\cyryu}}1
{я}{{\cyrya}}1
{А}{{\CYRA}}1
{Б}{{\CYRB}}1
{В}{{\CYRV}}1
{Г}{{\CYRG}}1
{Д}{{\CYR96}}1
{Е}{{\CYRE}}1
{Ё}{{\"{\CYRE}}}1
{Ж}{{\CYRZH}}1
{З}{{\CYRZ}}1
{И}{{\CYRI}}1
{Й}{{\CYRISHRT}}1
{К}{{\CYRK}}1
{Л}{{\CYRL}}1
{М}{{\CYRM}}1
{Н}{{\CYRN}}1
{О}{{\CYRO}}1
{П}{{\CYRP}}1
{Р}{{\CYRR}}1
{С}{{\CYRS}}1
{Т}{{\CYRT}}1
{У}{{\CYRU}}1
{Ф}{{\CYRF}}1
{Х}{{\CYRH}}1
{Ц}{{\CYRC}}1
{Ч}{{\CYRCH}}1
{Ш}{{\CYRSH}}1
{Щ}{{\CYRSHCH}}1
{Ъ}{{\CYRHRDSN}}1
{Ы}{{\CYRERY}}1
{Ь}{{\CYRSFTSN}}1
{Э}{{\CYREREV}}1
{Ю}{{\CYRYU}}1
{Я}{{\CYRYA}}1
}
\newcommand\inputcode[3][]{
{\bfseries #1\filename{#2}}:
\lstinputlisting[%
#3,
]{#2}%
}
% ОФОРМЛЕНИЕ НУМЕРАЦИИ СПИСКОВ ----------------------------------
% Команды ниже переназначают алфавит используемый при нумерации с английского на русский
\makeatletter
\renewcommand*{\@alph}[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 ы\or э\or у \or я
\else\@ctrerr\fi
}
\renewcommand*{\@Alph}[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 Ы\or Э\or У\or Я
\else\@ctrerr\fi
}
\makeatother
\makeatletter
\renewcommand\@biblabel[1]{#1.}
\makeatother
% file path
\newcommand{\runtimeFsep}{/}
\newcommand{\updateRuntimeFsep}{\IfSubStr{\currfileabsdir}{/}{}{\renewcommand{\runtimeFsep}{\backslash}}}
\updateRuntimeFsep
\makeatletter
\DeclareRobustCommand{\filename}[2][]{%
\begingroup
% \lstname seems to change hyphens into \textendash
\def\textendash{-}%
\filename@parse{#2}%
\IfSubStr{\filename@base}{\runtimeFsep}{\filename@parse{\filename@base}}{}%
\edef\filename@base{\detokenize\expandafter{\filename@base}}%
#1{\filename@base.\filename@ext}%
\endgroup
}
\makeatother
% \section*{#1}%
% \addcontentsline{toc}{chapter}{#1}
\newcommand\tcchapter[1]{%
\chapter{#1}%
}
\newcommand\tcsection[1]{%
\section{#1}%
}
\onehalfspacing
% \contentsmargin{2.55em}
\addto\captionsrussian{\renewcommand{\figurename}{Рисунок }}
% URL ---------------
\urlstyle{same}
% ОФОРМЛЕНИЕ ТЕКСТА
\renewcommand{\baselinestretch}{1.5}
\MakeOuterQuote{"}
\newenvironment{nospaceflalign*}
{\setlength{\abovedisplayskip}{0pt}\setlength{\belowdisplayskip}{0pt}%
\csname flalign*\endcsname}
{\csname endflalign*\endcsname\ignorespacesafterend}