-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProcISPRAS.cls
356 lines (310 loc) · 9.87 KB
/
ProcISPRAS.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
\ProvidesClass{ProcISPRAS}[2018/07/15 V0.1 by Kirill Batuzov]
\NeedsTeXFormat{LaTeX2e}
\def\ProcISPRASversionmajor{0}
\def\ProcISPRASversionminor{1}
\LoadClass[twoside,10pt]{article}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\RequirePackage{ifxetex}
\ifxetex
\RequirePackage{fontspec}
% Set up fonts
\setmainfont{tempora}
\defaultfontfeatures[zcoL]{
Extension = .otf,
UprightFont = zco-Light,
BoldFont = zco-Bold,
ItalicFont = zco-Oblique,
BoldItalicFont = zco-BoldOblique
}
\setmonofont{zcoL}
\setsansfont{zhv}
\else
\RequirePackage{cmap}
\RequirePackage[T2A]{fontenc}
\RequirePackage[utf8]{inputenc}
% Set up fonts
%\RequirePackage{paratype} % Arial-like sans serif font
%\RequirePackage{DejaVuSansMono} % Free widespread monospace font with cyrillic support
\RequirePackage{nimbussans} % Helvetica clone
\RequirePackage[bold,light]{nimbusmono} % Courier clone
\RequirePackage{tempora} % "Times" font
\fi
\RequirePackage[english,russian]{babel}
\let\scshape\relax
\DeclareRobustCommand\scshape{%
\not@math@alphabet\scshape\relax
\fontfamily{cmr}%
\fontshape\scdefault\selectfont}
% Set list parameters
\RequirePackage{enumitem}
\setlist[itemize]{itemsep=0.1cm,parsep=0cm,partopsep=0cm,topsep=0.1cm}
\setlist[enumerate]{itemsep=0.1cm,parsep=0cm,partopsep=0cm,topsep=0.1cm}
% Parameters to us in head/foot
\newcommand{\titleheadru}[1]{\newcommand{\thetitleheadru}{#1}}
\newcommand{\titleheaden}[1]{\newcommand{\thetitleheaden}{#1}}
\newcommand{\volhead}[1]{\newcommand{\thevolhead}{#1}}
\newcommand{\issuehead}[1]{\newcommand{\theissuehead}{#1}}
\newcommand{\pageshead}[1]{\newcommand{\thepageshead}{#1}}
\newcommand{\yearhead}[1]{\newcommand{\theyearhead}{#1}}
%
\newcounter{authorscount}
\newcounter{affilscount}
\newcommand{\authorlist}{}
\newcommand{\authorlistru}{}
\newcommand{\authorlisten}{}
\newcommand{\authorlistheadru}{}
\newcommand{\authorlistheaden}{}
\newcommand{\affillisten}{}
\newcommand{\affillistru}{}
\newcommand{\authorsep}{\\}
\newcommand{\authorheadsep}{, }
\newcommand{\affilsep}{\\}
\newcommand{\authorname}[2]{
\g@addto@macro\authorlisten{#1}
\g@addto@macro\authorlistru{#2}
\g@addto@macro\authorlistheaden{#1}
\g@addto@macro\authorlistheadru{#2}
\g@addto@macro\authorlist{#1}%
}
\newcommand{\orcid}[1]{
\g@addto@macro\authorlist{, ORCID: #1}
\g@addto@macro\authorlisten{, ORCID: #1}
\g@addto@macro\authorlistru{, ORCID: #1}
}
\newcommand{\inst}[1]{
\g@addto@macro\authorlist{$^{#1}$}
\g@addto@macro\authorlisten{$^{#1}$}
\g@addto@macro\authorlistru{$^{#1}$}
}
\newcommand{\email}[1]{
\g@addto@macro\authorlist{ <#1>}
\g@addto@macro\authorlisten{ <#1>}
\g@addto@macro\authorlistru{ <#1>}
}
\newcommand{\newauthor}{
\stepcounter{authorscount}
\ifnum \c@authorscount>1
\g@addto@macro\authorlistru{\authorsep}
\g@addto@macro\authorlisten{\authorsep}
\g@addto@macro\authorlistheadru{\authorheadsep}
\g@addto@macro\authorlistheaden{\authorheadsep}
\g@addto@macro\authorlist{\authorsep}
\fi
}
\newcommand{\affil}[3][]{
\stepcounter{affilscount}
\ifnum \c@affilscount>1%
\g@addto@macro\affillisten{\affilsep}
\g@addto@macro\affillistru{\affilsep}
\fi
\edef\affilindex{#1}
\ifx\affilindex\empty
\g@addto@macro\affillisten{$^{\theaffilscount}$}
\g@addto@macro\affillistru{$^{\theaffilscount}$}
\else
\g@addto@macro\affillisten{$^{#1}$}
\g@addto@macro\affillistru{$^{#1}$}
\fi
\g@addto@macro\affillisten{#2}
\g@addto@macro\affillistru{#3}
}
\newcommand{\doi}[1]{\def\doi{#1}}
\newcommand{\@doi}{{\small \textbf{DOI: \doi}}}
% Setup header and footer
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE]{\scriptsize \authorlistheadru{} \@titleru{}. Труды ИСП РАН, \theyearhead{}, том~\thevolhead{} вып.~\theissuehead{}, с.~\thepageshead{}}
\fancyhead[LO]{\scriptsize \authorlistheaden{} \@titleen{}. Trudy ISP RAN/Proc. ISP RAS, \theyearhead{}, vol.~\thevolhead{}, issue~\theissuehead{}, pp.~\thepageshead{}}
\fancyfoot[RO,LE]{\thepage}
\renewcommand{\headrulewidth}{.1pt}
\renewcommand{\footrulewidth}{0pt}
% Update abstract to match formatting
\renewcommand{\abstract}[2]{
\newcommand{\abstracten}{{\small \textbf{Abstract.} #1}}
\newcommand{\abstractru}{{\small \textbf{Аннотация.} #2}}
}
% Acknowledgments
\newcommand{\acknowledgments}[2]{
\newcommand{\acknowledgmentsen}{{\vskip 6pt \small \textbf{Acknowledgments:} #1}}
\newcommand{\acknowledgmentsru}{{\vskip 6pt \small \textbf{Благодарности:} #2}}
}
% Commands to format keywords and DOI
\newcommand{\keywords}[2]{
\newcommand{\keywordsen}{{\vskip 6pt \small \textbf{Keywords:} #1}}
\newcommand{\keywordsru}{{\vskip 6pt \small \textbf{Ключевые слова:} #2}}
}
\newcommand{\tociteen}{
{\vskip 6pt \small \textbf{For citation:} \authorlistheaden{} \@titleen{}. Trudy ISP RAN/Proc. ISP RAS, \theyearhead{}, vol.~\thevolhead{}, issue~\theissuehead{}, pp.~\thepageshead{}. \doi{}}}
\newcommand{\tociteru}{
{\vskip 6pt \small \textbf{Для цитирования:} \authorlistheadru{} \@titleru{}. Труды ИСП РАН, \theyearhead{}, том~\thevolhead{} вып.~\theissuehead{}, с.~\thepageshead{}. \doi{}}}
\def\cmp@figurename{figure}
\def\cmp@tablename{table}
\def\cmp@lstname{listing}
\def\cmp@algname{algorithm}
\def\encapname{%
\ifx\@captype\cmp@figurename%
Fig.
\else%
\ifx\@captype\cmp@tablename%
Table
\else%
\ifx\@captype\cmp@lstname%
Listing
\else%
\ifx\@captype\cmp@algname%
Algorithm
\else%
Unknown
\fi
\fi
\fi
\fi
}
\def\rucapname{%
\ifx\@captype\cmp@figurename%
Рис.
\else%
\ifx\@captype\cmp@tablename%
Табл.
\else%
\ifx\@captype\cmp@lstname%
Листинг
\else%
\ifx\@captype\cmp@algname%
Алгоритм
\else%
Неизв.
\fi
\fi
\fi
\fi
}
\newlength\midcaptionskip
\setlength\abovecaptionskip{0.2cm}
\setlength\midcaptionskip{0pt}
\setlength\belowcaptionskip{0.2cm}
\newcommand{\captionisp}[2]{\refstepcounter\@captype%
% Table caption should be aligned to the left.
\ifx\@captype\cmp@tablename%
\begin{flushleft}%
\else%
\begin{center}%
\fi
\vskip\abovecaptionskip\small\textit{\rucapname{}\arabic{\@captype}. #1}\par%
\vskip\midcaptionskip\small\textit{\encapname{}\arabic{\@captype}. #2}\par%
\vskip\belowcaptionskip%
\ifx\@captype\cmp@tablename%
\end{flushleft}%
\else%
\end{center}%
\fi
\ifx\@captype\cmp@algname
\kern2pt\hrule\kern2pt
\fi
}
% No paragraph indent.
\setlength{\parindent}{0pt}
% Section titles
% ispSubHeader - 2 level
%\renewcommand\section{\@startsection {section}{1}{\z@}{-3.5ex \@plus -1ex \@minus -.2ex}{2.3ex \@plus.2ex}{\sffamily\bfseries\itshape\sectsize\selectfont}}
\renewcommand\section{\@startsection {section}{1}{\z@}{-12pt}{3pt}{\sffamily\bfseries\itshape\sectsize\selectfont}}
% ispSubHeader - 3 level
\renewcommand\subsection{\@startsection {subsection}{1}{\z@}{-12pt}{3pt}{\sffamily\bfseries\sectsize\selectfont}}
\def\cmp@section{1}
\def\cmp@subsection{2}
\def\cmp@subsubsection{3}
\renewcommand*{\@seccntformat}[1]{%
\if 1\csname cmp@#1\endcsname%
\csname the#1\endcsname.\quad% Need dot after section number
\else%
\csname the#1\endcsname\quad% No dot after subsection number
\fi%
}
% From size11.clo
\newcommand\sectsize{%
\@setfontsize\sectsize\@xipt{13.6}%
\abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
\belowdisplayskip \abovedisplayskip
% \let\@listi\@listI
}
\renewcommand{\title}[2]{
\newcommand{\@titleen}{#1}
\newcommand{\@titleru}{#2}
}
\def\@maketitleru{%
%\null
%\vskip 48pt%
\begin{center}%
{\sffamily\bfseries\fontsize{16pt}{16pt}\selectfont \@titleru \par}%
\vskip 24pt%
\itshape\normalsize
\authorlistru\leavevmode\\\affillistru
\end{center}%
\abstractru
\keywordsru
\tociteru
\ifcsname acknowledgmentsru\endcsname%
\acknowledgmentsru
\fi%
}
\newcommand{\maketitleru}{\@maketitleru}
\def\@maketitleen{%
%\null
%\vskip 48pt%
\begin{center}%
{\sffamily\bfseries\fontsize{16pt}{16pt}\selectfont \@titleen \par}%
\vskip 24pt%
\itshape\normalsize
\authorlisten\leavevmode\\\affillisten
\end{center}%
\abstracten
\keywordsen
\tociteen
\ifcsname acknowledgmentsen\endcsname%
\acknowledgmentsen
\fi%
}
\newcommand{\maketitleen}{\@maketitleen}
\RequirePackage{csquotes}
\RequirePackage[backend=biber,
bibencoding=utf8,
style=trad-abbrv,
citestyle=numeric-comp,
sortcites=true,
autolang=other,
sorting=none,
doi=true,
isbn=false]{biblatex}
\appto{\bibsetup}{\raggedright}
%\renewcommand*{\@biblabel}[1]{[#1].\hfill}
%\let\oldthebibliography\thebibliography
%\let\endoldthebibliography\endthebibliography
%\renewenvironment{thebibliography}[1]{
% \begin{oldthebibliography}{#1}
% \setlength{\itemsep}{0em \@plus 0.3ex}
% \setlength{\parskip}{0em \@plus 0.3ex}
%}
%{
% \end{oldthebibliography}
%}
\setlength{\itemsep}{0em \@plus 0.3ex}
\setlength{\parskip}{1.5pt} %\@plus 0.3ex}
\RequirePackage{float}
\newfloat{listing}{thp}{lol}
\floatname{listing}{Listing}
\RequirePackage{algorithm}
\emergencystretch 3em
\RequirePackage[unicode, hidelinks]{hyperref}
\hypersetup{colorlinks=false}
\def\@makedoi{%
\vspace*{23 pt}
\@doi
\vskip 18pt%
}
\newcommand{\makedoi}{\@makedoi}
\setlength{\textfloatsep}{6pt}
\setlength{\intextsep}{6pt}