-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpreamble.sty
131 lines (112 loc) · 3.67 KB
/
preamble.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
% Кодировка и язык
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english,russian]{babel}
% Шрифт
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Times New Roman}
\setmonofont{FreeMono}
% Поля
\usepackage[left=30mm,right=10mm,top=20mm,bottom=20mm]{geometry}
% Полуторный межстрочный интервал
\renewcommand{\baselinestretch}{1.4}
% Абзацный отступ 1.25см
\usepackage{indentfirst}
\setlength\parindent{12.5mm}
% Для использования \dotuline и \uline
\usepackage[dot]{dashundergaps}
\usepackage{ulem}
% Гиперссылки
\usepackage[colorlinks=false,unicode=true]{hyperref}
% Картинки
\usepackage{graphicx}
\graphicspath{ {./graphics/} }
% Таблицы
\usepackage{multirow}
\usepackage{longtable}
% Листинги
\usepackage{listings}
\usepackage{xcolor}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
% Подписи к картинкам, таблицам и листингам
\usepackage{caption}
\captionsetup[figure]{name={Рисунок},labelsep=endash}
\captionsetup[table]{name={Таблица},labelsep=endash,justification=raggedright,singlelinecheck=false}
\captionsetup[lstlisting]{labelsep=endash}
% Математика
\usepackage{amsthm,amssymb,amsmath}
% Перечисления
\usepackage{enumitem}
\renewcommand{\@listI}
{
\leftmargin=25pt
\rightmargin=0pt
\labelsep=5pt
\labelwidth=20pt
\itemindent=0pt
\listparindent=0pt
\topsep=0pt plus 2pt minus 4pt
\partopsep=0pt plus 1pt minus 1pt
\parsep=0pt plus 1pt
\itemsep=\parsep
}
% Переносы
\sloppy
\hyphenpenalty=1000
\clubpenalty=10000
\widowpenalty=10000
% Поиск по pdf
\usepackage{cmap}
% Сравнение длин строк
\usepackage{ifthen}
\usepackage{xstring}
% Подсчет количества иллюстраций, таблиц и т.д.
\usepackage[figure,table]{totalcount}
\usepackage{totcount}
\regtotcounter{page}
\newtotcounter{citenum}
\def\oldcite{}
\let\oldcite=\bibcite
\def\bibcite{\stepcounter{citenum}\oldcite}
\newtotcounter{appendixnum}
% Содержание
\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\normalfont\bfseries\MakeUppercase}
\renewcommand{\cftbeforetoctitleskip}{-1em}
\renewcommand{\cftaftertoctitleskip}{1pt}
% Главы, разделы, подразделы
\usepackage[explicit]{titlesec}
\titleformat{\chapter}{\centering\normalfont\bfseries}{\thechapter}{10pt}{\MakeUppercase{#1}}
\titleformat{\section}{\normalfont\bfseries}{\thesection}{10pt}{#1}
\titleformat{\subsection}{\normalfont}{\thesubsection}{10pt}{#1}
\titlespacing*{\chapter}{0pt}{-12pt}{11pt}
% TODO: Посмотреть в ГОСТе точную величину интервалов
\titlespacing*{\section}{\parindent}{15pt}{10pt}
\titlespacing*{\subsection}{\parindent}{15pt}{10pt}
% Библиография
\makeatletter
\renewcommand{\@biblabel}[1]{#1.} % Заменяем библиографию с квадратных скобок на точку
\makeatother