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