aboutsummaryrefslogtreecommitdiff
path: root/doc/gost/gost-7-32-headings.sty
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 05:23:31 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-08 05:24:55 +0000
commit3f36aca66e1ac6c872300059e8db691a473614d4 (patch)
tree48c65f463c487d281c7c4091c7ba01dd4a2ff8f1 /doc/gost/gost-7-32-headings.sty
downloadlab-02-3f36aca66e1ac6c872300059e8db691a473614d4.tar.gz
publishHEADmaster
Diffstat (limited to 'doc/gost/gost-7-32-headings.sty')
-rw-r--r--doc/gost/gost-7-32-headings.sty114
1 files changed, 114 insertions, 0 deletions
diff --git a/doc/gost/gost-7-32-headings.sty b/doc/gost/gost-7-32-headings.sty
new file mode 100644
index 0000000..cb2a7f0
--- /dev/null
+++ b/doc/gost/gost-7-32-headings.sty
@@ -0,0 +1,114 @@
1\ProvidesPackage{gost-7-32-headings}[2022/01/28 GOST 7.32-2017]
2
3\RequirePackage{titlesec}
4\RequirePackage{titling}
5\RequirePackage{setspace}
6
7\RequirePackage{gost-7-32-counters}
8
9\setcounter{secnumdepth}{5}
10
11%
12% Set custom formatting to well-known LaTeX commands: section, subsection and subsubsection
13%
14\titleformat{\section}[block]{\centering\Large\setstretch{1}\bfseries}{\thesection}{0.5em}{}
15\titlespacing*{\section}{0cm}{0cm}{0.5cm}
16\newcommand{\sectionbreak}{\clearpage}
17
18\titleformat{\subsection}[block]{\Large\bfseries}{\thesubsection}{0.5em}{}
19\titlespacing{\subsection}{0cm}{0.5cm}{0.25cm}
20
21\titleformat{\subsubsection}[block]{\normalsize\bfseries}{\thesubsubsection}{0.5em}{}
22\titlespacing{\subsubsection}{0cm}{0.5em}{0.25cm}
23
24\titleformat{\paragraph}[block]{\normalsize\bfseries}{\theparagraph}{0.5em}{}
25\titlespacing*{\paragraph}{0cm}{0.5em}{0.25cm}
26
27\titleformat{\subparagraph}[block]{\normalsize\bfseries}{\thesubparagraph}{0.5em}{}
28\titlespacing{\subparagraph}{0cm}{0.5em}{0.25cm}
29
30\makeatletter
31\let\oldsection\section
32\newcommand{\@sectionnostar}[1]{\oldsection*{#1}\addcontentsline{toc}{section}{#1}}
33\newcommand{\@sectionstar}[1]{\oldsection{#1}}
34\renewcommand{\section}{\sectionbreak\@ifstar{\@sectionnostar}{\@sectionstar}}
35\makeatother
36
37%
38% Make special headings, that have their own formatting rules:
39% - centered
40% - all-caps
41% - bold
42%
43% Only three of them must appear in TOC: introduction, conclusion and references
44%
45\newcommand{\introduction}{
46 \addcontentsline{toc}{section}{ВВЕДЕНИЕ}
47 \begin{center}
48 \bfseries\large
49 ВВЕДЕНИЕ
50 \end{center}
51}
52
53\newcommand{\conclusion}{
54 \addcontentsline{toc}{section}{ЗАКЛЮЧЕНИЕ}
55 \begin{center}
56 \bfseries\large
57 ЗАКЛЮЧЕНИЕ
58 \end{center}
59}
60
61\newcommand{\references}{
62 \addcontentsline{toc}{section}{СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ}
63 \begin{center}
64 \bfseries\large
65 СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ
66 \end{center}
67}
68
69\newcommand{\essay}{
70 \begin{center}
71 \bfseries\large
72 РЕФЕРАТ
73 \end{center}
74}
75
76\newcommand{\definitions}{
77 \begin{center}
78 \bfseries\large
79 ОПРЕДЕЛЕНИЯ
80 \end{center}
81}
82
83\newcommand{\abbreviations}{
84 \begin{center}
85 \bfseries\large
86 ОБОЗНАЧЕНИЯ И СОКРАЩЕНИЯ
87 \end{center}
88}
89
90\newcommand{\defsabbrs}{
91 \begin{center}
92 \bfseries\large
93 ОПРЕДЕЛЕНИЯ, ОБОЗНАЧЕНИЯ И СОКРАЩЕНИЯ
94 \end{center}
95}
96
97%
98% Appendices headings. Appendices have autoincrementing number,
99% that is represented with russian letter.
100% This heading must appear in TOC
101%
102\newcounter{appendixcnt}
103\setcounter{appendixcnt}{1}
104
105\renewcommand{\appendix}[1]{
106 \addcontentsline{toc}{section}{ПРИЛОЖЕНИЕ \AlphRus{appendixcnt}. #1}
107 \begin{center}
108 \bfseries\large
109 ПРИЛОЖЕНИЕ \AlphRus{appendixcnt}
110
111 #1
112 \end{center}
113 \stepcounter{appendixcnt}
114}