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