-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.tex
165 lines (107 loc) · 4.6 KB
/
styles.tex
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
% !TEX encoding = UTF8
% !TEX spellcheck = en_US
%%% Figures %%%
\graphicspath{{images/}{../}{../../}} % Пути к изображениям
%%% Page layout %%%
\geometry{a4paper,top=2cm,bottom=2cm,left=2.5cm,right=1cm} %,showframe,nofoot,nomarginpar
\setlength{\topskip}{0pt}
%\setlength{\footskip}{12.3pt} % to prevent warning
%%% Line spacing %%%
%\DoubleSpacing*
%\OnehalfSpacing*
%\setSpacing{1.42} % like MS Word, may be include with previous line
%%% Align and hyphenation %%%
\tolerance 1414
\hbadness 1414
\emergencystretch 1.5em % in case of problems the first parameter for tuning
\hfuzz 0.3pt
\vfuzz \hfuzz
%\raggedbottom
%\sloppy
\clubpenalty=10000
\widowpenalty=10000
\begin{russian}
\hyphenation{не-пе-ре-се-каю-щих-ся}
\end{russian}
\setlength{\epigraphwidth}{0.3\textwidth}
\renewcommand{\epigraphsize}{\normalsize}
\epigraphrule = 0pt
\newfontfamily\epigraphfont[Scale=MatchLowercase]{TeX Gyre Chorus}
%%% Outline %%%
\renewcommand{\cftchapterdotsep}{\cftdotsep}
%\setrmarg{2.55em plus1fil}
\renewcommand{\cftchapterpagefont}{\normalfont}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftchapterdotsep}}
%\renewcommand{\cftchapterfont}{}
\renewcommand\cftchapteraftersnum{.\space}
\renewcommand\cftsectionaftersnum{.\space}
\renewcommand\cftsubsectionaftersnum{.\space}
\renewcommand\cftsubsubsectionaftersnum{.\space}
\AtBeginDocument{% % without this polyglossia make it
\setsecnumformat{\csname the#1\endcsname.\space}
}
\renewcommand*{\cftappendixname}{\appendixname\space}
%%% Headlines %%%
\newcommand*{\headlinefont}{\normalfont\itshape\footnotesize\rmfamily}
\newcommand*{\footer}[1]{%
\begin{tikzpicture}[baseline=\baselineskip,font=\headlinefont]
\node[text=gray] {#1};
\end{tikzpicture}%
}
\newcommand*{\footerleft}{\hspace{-1.5cm}\footer{\paperDepartmentShort{}, \paperOrganizationShort --- \paperTitle}}
\newcommand*{\footerright}{\footer{\paperAuthor, \paperYear}}
\makeoddhead{ruled}{\headlinefont \leftmark}{}{\headlinefont \rightmark}
\makeoddfoot{ruled}{\footerleft}{\thepage}{\footerright}
\makeoddfoot{plain}{\footerleft}{\thepage}{\footerright}
\pagestyle{ruled}
%%% Headings %%%
\chapterstyle{hangnum}
\settocdepth{subsection}
\newcommand*\AbstractChapter[1]{%
\chapter*{#1}
\addcontentsline{toc}{chapter}{\numberline\ #1}
}
\newcommand*\AbstractSection[1]{%
\section*{#1}
\addcontentsline{toc}{section}{\numberline\ #1}
}
\newcommand*\WhatToReadSection{\AbstractSection{Что читать}}
\newcommand*\ExercisesSection{\AbstractSection{Упражнения}}
\newcommand*\TaskSection{\AbstractSection{Задание}}
%%% Counters %%%
\counterwithout{equation}{chapter}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
%%% Proper appendix numbering %%%
\makeatletter
\def\russian@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 Я\else\xpg@ill@value{#1}{russian@Alph}\fi}
\def\russian@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 я\else\xpg@ill@value{#1}{russian@alph}\fi}
\makeatother
%%% Misc %%%
\newcommand*{\latexurl}{https://www.latex-project.org}
\newcommand*{\yadiskurl}{https://yadi.sk/d/XiUj9ZsNf3xHJ}
\newcommand*{\mingwurl}{https://sourceforge.net/projects/mingw-w64/files/Toolchains\%20targetting\%20Win64/Personal\%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z}
\newcommand*{\qtcreatorurl}{https://download.qt.io/official_releases/qtcreator/4.13/4.13.0/qt-creator-opensource-windows-x86_64-4.13.0.exe}
\newcommand*{\giturl}{https://git-scm.com/download/win}
\newcommand*{\smartgiturl}{https://www.syntevo.com/smartgit/download}
\newcommand*{\typingtutorurl}{https://sense-lang.org/typing/tutor/keyboarding.php}
\newcommand*{\pythonurl}{https://www.python.org}
\newcommand*{\matplotliburl}{https://matplotlib.org}
\newcommand*{\yadisk}[1]{\name{\href{\yadiskurl}{яндекс-диск}/#1}}
\newcommand*{\GraphViz}{\href{http://www.graphviz.org}{\name{GraphViz}}}
\newcommand*{\GCC}{\textsf{\scshape gcc}}
\newcommand*{\GDB}{\textsf{\scshape gdb}}
\newcommand*{\git}{\texttt{\small Git}}
\newcommand*{\hard}{\makebox[0pt]{\hspace{-1.5\labelsep}\ensuremath{\mathsurround=0pt ^{\star}}}}
\newcommand*{\HardChapter}[1]{\chapter{\(^★\)#1}}
\newcommand*{\HardSection}[1]{\section{\(^★\)#1}}
\newcommand*{\HardSubsection}[1]{\subsection{\(^★\)#1}}
\newcommand*{\textbookref}[1]{\textit{#1}}