diff options
Diffstat (limited to 'doc/diploma/gost/gost-7-32-headings.sty')
| -rw-r--r-- | doc/diploma/gost/gost-7-32-headings.sty | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/doc/diploma/gost/gost-7-32-headings.sty b/doc/diploma/gost/gost-7-32-headings.sty new file mode 100644 index 0000000..e30e054 --- /dev/null +++ b/doc/diploma/gost/gost-7-32-headings.sty | |||
| @@ -0,0 +1,105 @@ | |||
| 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\raggedright}{\thesubsection}{0.5em}{} | ||
| 17 | \titlespacing{\subsection}{0cm}{0.5cm}{0.5cm} | ||
| 18 | |||
| 19 | \titleformat{\subsubsection}[block]{\normalsize\bfseries\raggedright}{\thesubsubsection}{0.5em}{} | ||
| 20 | \titlespacing{\subsubsection}{0.0cm}{0.5cm}{0.5cm} | ||
| 21 | |||
| 22 | \makeatletter | ||
| 23 | \let\oldsection\section | ||
| 24 | \newcommand{\@sectionnostar}[1]{\phantomsection\oldsection*{#1}} | ||
| 25 | \newcommand{\@sectionstar}[1]{\oldsection{#1}} | ||
| 26 | \renewcommand{\section}{\sectionbreak\@ifstar{\@sectionnostar}{\@sectionstar}} | ||
| 27 | |||
| 28 | \let\oldsubsection\subsection | ||
| 29 | \newcommand{\@subsectionnostar}[1]{\phantomsubsection\oldsubsection*{#1}} | ||
| 30 | \newcommand{\@subsectionstar}[1]{\oldsubsection{#1}} | ||
| 31 | \renewcommand{\subsection}{\@ifstar{\@subsectionnostar}{\@subsectionstar}} | ||
| 32 | \makeatother | ||
| 33 | |||
| 34 | % | ||
| 35 | % Make special headings, that have their own formatting rules: | ||
| 36 | % - centered | ||
| 37 | % - all-caps | ||
| 38 | % - bold | ||
| 39 | % | ||
| 40 | % Only three of them must appear in TOC: introduction, conclusion and references | ||
| 41 | % | ||
| 42 | \newcommand{\introduction}{ | ||
| 43 | \addcontentsline{toc}{section}{ВВЕДЕНИЕ} | ||
| 44 | \begin{center} | ||
| 45 | \bfseries\large | ||
| 46 | ВВЕДЕНИЕ | ||
| 47 | \end{center} | ||
| 48 | } | ||
| 49 | |||
| 50 | \newcommand{\conclusion}{ | ||
| 51 | \addcontentsline{toc}{section}{ЗАКЛЮЧЕНИЕ} | ||
| 52 | \begin{center} | ||
| 53 | \bfseries\large | ||
| 54 | ЗАКЛЮЧЕНИЕ | ||
| 55 | \end{center} | ||
| 56 | } | ||
| 57 | |||
| 58 | \newcommand{\references}{ | ||
| 59 | \addcontentsline{toc}{section}{СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ} | ||
| 60 | \begin{center} | ||
| 61 | \bfseries\large | ||
| 62 | СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ | ||
| 63 | \end{center} | ||
| 64 | } | ||
| 65 | |||
| 66 | \newcommand{\essay}{ | ||
| 67 | \begin{center} | ||
| 68 | \bfseries\large | ||
| 69 | РЕФЕРАТ | ||
| 70 | \end{center} | ||
| 71 | } | ||
| 72 | |||
| 73 | \newcommand{\definitions}{ | ||
| 74 | \begin{center} | ||
| 75 | \bfseries\large | ||
| 76 | ОПРЕДЕЛЕНИЯ | ||
| 77 | \end{center} | ||
| 78 | } | ||
| 79 | |||
| 80 | \newcommand{\abbreviations}{ | ||
| 81 | \begin{center} | ||
| 82 | \bfseries\large | ||
| 83 | ОБОЗНАЧЕНИЯ И СОКРАЩЕНИЯ | ||
| 84 | \end{center} | ||
| 85 | } | ||
| 86 | |||
| 87 | \newcommand{\defsabbrs}{ | ||
| 88 | \begin{center} | ||
| 89 | \bfseries\large | ||
| 90 | ОПРЕДЕЛЕНИЯ, ОБОЗНАЧЕНИЯ И СОКРАЩЕНИЯ | ||
| 91 | \end{center} | ||
| 92 | } | ||
| 93 | |||
| 94 | % | ||
| 95 | % Appendices headings. Appendices have autoincrementing number, | ||
| 96 | % that is represented with russian letter. | ||
| 97 | % This heading must appear in TOC | ||
| 98 | % | ||
| 99 | \newcounter{appendixcnt} | ||
| 100 | \setcounter{appendixcnt}{1} | ||
| 101 | |||
| 102 | \renewcommand{\appendix}[1]{ | ||
| 103 | \addcontentsline{toc}{section}{ПРИЛОЖЕНИЕ \AlphRus{appendixcnt}. #1} | ||
| 104 | \stepcounter{appendixcnt} | ||
| 105 | } | ||
