\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]{\centering\large\setstretch{1}\bfseries}{\thesection}{0.5em}{} \titlespacing*{\section}{0cm}{0cm}{0.5cm} \newcommand{\sectionbreak}{\clearpage} \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} \makeatletter \let\oldsection\section \newcommand{\@sectionnostar}[1]{\phantomsection\oldsection*{#1}\addcontentsline{toc}{section}{#1}} \newcommand{\@sectionstar}[1]{\oldsection{#1}} \renewcommand{\section}{\sectionbreak\@ifstar{\@sectionnostar}{\@sectionstar}} \makeatother % % 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} }