-
Notifications
You must be signed in to change notification settings - Fork 0
/
diploma.cls
224 lines (174 loc) · 6.36 KB
/
diploma.cls
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
% Sets minimal LaTeX version
\NeedsTeXFormat{LaTeX2e}
% Class name
\ProvidesClass{diploma}
% Calls extarticle class and pass all customArticle class options
\LoadClassWithOptions{report}
% Set fonts (XeLaTeX required)
% Allows to load fonts
\RequirePackage{fontspec}
% \setmainfont{Helvetica}
% Sans-serif math font
% \RequirePackage{arevmath}
% Use TeX ligatures, like ``something''
\defaultfontfeatures{Mapping=tex-text}
% The package supports the Text Companion fonts, which provide many text symbols
% (such as baht, bullet, copyright, musicalnote, onequarter, section, and yen),
% in the TS1 encoding.
\RequirePackage{textcomp}
% Provides generic commands \degree, \celsius, \perthousand, \micro and \ohm
% which work both in text and maths mode.
\RequirePackage{gensymb}
% Handle Russian language properly
% \newfontfamily{\cyrillicfont}{Helvetica}
% \newfontfamily{\cyrillicfonttt}{Courier New}
\newfontfamily{\cyrillicfont}{Times New Roman}
\newfontfamily{\cyrillicfonttt}{Courier New}
% Customizes lists
\RequirePackage{enumitem}
% Sets cyrillic list labels. Usage example: \begin{enumerate}[label=\asbuk*)]
\AddEnumerateCounter{\Asbuk}{\@Asbuk}{\CYRM}
\AddEnumerateCounter{\asbuk}{\@asbuk}{\cyrm}
% Support for Russian language
\RequirePackage{polyglossia}
\setdefaultlanguage[spelling=modern]{russian}
% Sorry, non-Russian speakers :-)
\setotherlanguage{english}
% Allows babel-like shorthands, like Einstein"=Podolsky"=Rosen
\setkeys{russian}{babelshorthands=true}
% Sets a bit different spacing, required by Russian typography
\frenchspacing
% Math setup
% Generic math packages
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{mathtools}
% Allows display breaks inside formulae
\allowdisplaybreaks
% Controls numeration of equations, figures, etc
\RequirePackage{chngcntr}
% Prints nice brackets
\newcommand{\brround}[1]{\left( #1 \right)}
\newcommand{\brsquare}[1]{\left[ #1 \right]}
% Easy partial derivatives
% Partial derivative with constant #3
\newcommand{\partfrac}[3]{
\brround{ \frac{\partial #1}{\partial #2} }_{#3}
}
% Partial derivative of a custom power
\newcommand{\pwrpartfrac}[4]{
\brround{ \frac{\partial^{#4} #1}{\partial #2^{#4}} }_{#3}
}
% Partial derivative of variation
\newcommand{\dpartfrac}[3]{
\brround{ \frac{\delta #1}{\partial #2} }_{#3}
}
% Use fancy vector signs
\RequirePackage{esvect}
% Scalar and vector products
\newcommand{\scprod}[2]{\brround{ \vv{#1} \cdot \vv{#2}}}
\newcommand{\vecprod}[2]{\brsquare{ \vv{#1} \times \vv{#2}}}
% Why big Epsilon isn't implemented in standart?
\newcommand{\Epsilon}[0]{\mathcal{E}}
% Use nice surface integral signs like \oiint
\RequirePackage{esint}
% Tables config
% Custom tables handling
\RequirePackage{booktabs}
% Set longtable environment, which allows display break in tables
\RequirePackage{longtable}
% Set a new column type, which implements vertical centering and breaks
\RequirePackage{array}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
% Allow multicolumns and multirows
\RequirePackage{multicol}
\RequirePackage{multirow}
% Multirow with horizontal centering
\newcommand{\cmultirow}[3]{
{\multirow{#1}{#2}{\centering #3}}
}
% Graphics packages
% For including various image formats
\RequirePackage{graphicx}
% Improves the interface for defining floating objects such as figures and tables.
\RequirePackage{float}
% Allows figures or tables to have text wrapped around them.
\RequirePackage{wrapfig}
% Modifies the margins and rotates the page contents but not the page number.
\RequirePackage{lscape}
% Multifigures
\RequirePackage{subcaption}
% Chemistry packages
\RequirePackage{chemfig}
% http://tex.stackexchange.com/questions/96633/how-to-draw-parentheses-inside-chemfig
\newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}
\def\makebraces(#1,#2)#3#4#5{%
\edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%
\edef\delimvshift{\the\dimexpr(#1-#2)/2}%
\chemmove{
\node[at=(#4),yshift=(\delimvshift)]
{$
\left\delimleft
\vrule height\delimhalfdim depth\delimhalfdim width0pt
\right.
$};
\node[at=(#5),yshift=(\delimvshift)]
{$
\left.
\vrule height\delimhalfdim depth\delimhalfdim width0pt
\right\delimright_{\rlap{#3}}
$};
}
}
% General packages
\RequirePackage[unicode]{hyperref}
% Text formatting
% Allow LaTeX to stretch lines
\sloppy
% Set vertical spacing between paragraphs
\RequirePackage{parskip}
% Custom options, feel free to change!
% Rows shall be higher, useful for formulae inside tables
\renewcommand{\arraystretch}{1.5}
% Sometimes you just need custom margins
\RequirePackage[a4paper, left = 30mm, right = 20mm, top = 20mm, bottom = 20mm]{geometry}
% Useful commands
\newcommand{\msu}{Московский государственный университет имени М.\,В.~Ломоносова}
% Strange lab config
\RequirePackage{floatflt}
\RequirePackage{wrapfig}
\RequirePackage{multicol}
\RequirePackage{amssymb,amsfonts,amsmath,amsthm,mathtext,cite,float}
\RequirePackage{graphicx}
\RequirePackage{booktabs}
\RequirePackage{amsbsy}
\RequirePackage{array}
% \RequirePackage{paralist}
\RequirePackage{verbatim}
% \RequirePackage{subfig}
\RequirePackage{color}
\RequirePackage{colortbl}
\sloppy
\RequirePackage[onehalfspacing]{setspace}
\RequirePackage{cmap}
\RequirePackage{indentfirst}
\RequirePackage[labelsep=period]{caption}
\RequirePackage{fancyhdr}
\RequirePackage{mathtools}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}
\RequirePackage{sectsty}
\RequirePackage[nottoc,notlof,notlot]{tocbibind}
\RequirePackage{floatflt}
\hyphenpenalty=10000% что-то про отмену переносов
\RequirePackage[titles,subfigure]{tocloft}
\RequirePackage{titlesec}
\titleformat{\chapter}{\normalfont\Huge}{\thechapter}{1em}{}
\titleformat{\section}{\normalfont\LARGE}{\thesection}{0.5em}{}
\titlespacing*{\chapter}{0pt}{0pt}{40pt}
% \sectionfont{\normalfont\fontsize{16}{19}\bfseries}
% \subsectionfont{\normalfont\fontfamily{phv}\fontsize{14}{17}\bfseries}
% \subsubsectionfont{\normalfont\fontfamily{phv}\fontsize{14}{17}\selectfont}