aboutsummaryrefslogtreecommitdiff
path: root/gost/gost-7-32-headings.sty
blob: d0bb40eaba9d13431765ef542dfa21d66acab1ea (plain)
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
\ProvidesPackage{gost-7-32-headings}[2022/01/28 GOST 7.32-2017]

\RequirePackage{titlesec}
\RequirePackage{titling}
\RequirePackage{setspace}

\RequirePackage{gost-7-32-counters}

%
% Set custom formatting to well-known LaTeX commands: section, subsection and subsubsection
%
\titleformat{\section}[block]{\newpage\cleardoublepage\large\setstretch{1}\bfseries}{\thesection}{0.5em}{}
\titlespacing{\section}{0cm}{0cm}{0.5cm}

\titleformat{\subsection}[block]{\normalsize\bfseries}{\thesubsection}{0.5em}{}
\titlespacing{\subsection}{0cm}{0.5cm}{0.5cm}

\titleformat{\subsubsection}[runin]{\normalsize\bfseries}{\thesubsubsection}{0.5em}{}[\newline\indent]
\titlespacing{\subsubsection}{1.25cm}{0.5em}{0cm}

%
% Make special headings, that have their own formatting rules:
% - centered
% - all-caps
% - bold
%
% Only three of them must appear in TOC: introduction, conclusion and references
%
\newcommand{\introduction}{
    \addcontentsline{toc}{section}{ВВЕДЕНИЕ}
    \begin{center}
        \bfseries\large
        ВВЕДЕНИЕ
    \end{center}
}

\newcommand{\conclusion}{
    \addcontentsline{toc}{section}{ЗАКЛЮЧЕНИЕ}
    \begin{center}
        \bfseries\large
        ЗАКЛЮЧЕНИЕ
    \end{center}
}

\newcommand{\references}{
    \addcontentsline{toc}{section}{СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ}
    \begin{center}
        \bfseries\large
        СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ
    \end{center}
}

\newcommand{\essay}{
    \begin{center}
        \bfseries\large
        РЕФЕРАТ
    \end{center}
}

\newcommand{\definitions}{
    \begin{center}
        \bfseries\large
        ОПРЕДЕЛЕНИЯ
    \end{center}
}

\newcommand{\abbreviations}{
    \begin{center}
        \bfseries\large
        ОБОЗНАЧЕНИЯ И СОКРАЩЕНИЯ
    \end{center}
}

\newcommand{\defsabbrs}{
    \begin{center}
        \bfseries\large
        ОПРЕДЕЛЕНИЯ, ОБОЗНАЧЕНИЯ И СОКРАЩЕНИЯ
    \end{center}
}

%
% Appendices headings. Appendices have autoincrementing number, 
% that is represented with russian letter.
% This heading must appear in TOC
%
\newcounter{appendixcnt}
\setcounter{appendixcnt}{1}

\renewcommand{\appendix}[1]{
    \addcontentsline{toc}{section}{ПРИЛОЖЕНИЕ \AlphRus{appendixcnt}. #1}
    \begin{center}
        \bfseries\large
        ПРИЛОЖЕНИЕ \AlphRus{appendixcnt}
        
        #1
    \end{center}
    \stepcounter{appendixcnt}
}