From cb070b2d3f2b6e241e3be1b7e0eeb90fc755255f Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Thu, 12 Nov 2026 01:28:13 +0300 Subject: publish --- doc/diploma/gost/gost-7-32-bibliography.sty | 57 +++++++++++++++ doc/diploma/gost/gost-7-32-captions.sty | 33 +++++++++ doc/diploma/gost/gost-7-32-counters.sty | 43 ++++++++++++ doc/diploma/gost/gost-7-32-headings.sty | 105 ++++++++++++++++++++++++++++ doc/diploma/gost/gost-7-32-lists.sty | 23 ++++++ doc/diploma/gost/gost-7-32-tables.sty | 31 ++++++++ doc/diploma/gost/gost-7-32-toc.sty | 54 ++++++++++++++ doc/diploma/gost/gost-7-32.cls | 62 ++++++++++++++++ 8 files changed, 408 insertions(+) create mode 100644 doc/diploma/gost/gost-7-32-bibliography.sty create mode 100644 doc/diploma/gost/gost-7-32-captions.sty create mode 100644 doc/diploma/gost/gost-7-32-counters.sty create mode 100644 doc/diploma/gost/gost-7-32-headings.sty create mode 100644 doc/diploma/gost/gost-7-32-lists.sty create mode 100644 doc/diploma/gost/gost-7-32-tables.sty create mode 100644 doc/diploma/gost/gost-7-32-toc.sty create mode 100644 doc/diploma/gost/gost-7-32.cls (limited to 'doc/diploma/gost') diff --git a/doc/diploma/gost/gost-7-32-bibliography.sty b/doc/diploma/gost/gost-7-32-bibliography.sty new file mode 100644 index 0000000..dca60fa --- /dev/null +++ b/doc/diploma/gost/gost-7-32-bibliography.sty @@ -0,0 +1,57 @@ +\ProvidesPackage{gost-7-32-bibliography}[2022/01/28 GOST 7.32-2017] + +\def\UrlBreaks{\do\/\do-} +\RequirePackage{url} + +\newdimen\bibindent +\renewenvironment{thebibliography}[1]{ + \chapter*{\bibname}\addcontentsline{toc}{chapter}{\bibname}% + \list{\@biblabel{\@arabic\c@enumiv}}% + {\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \@openbib@code + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv}}% + \sloppy\clubpenalty4000\widowpenalty4000% + \sfcode`\.\@m +}{ + \setcounter{totalbib}{\c@enumiv}% + \def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% + \endlist +} +\renewcommand\@biblabel{}% +\setlength\bibindent{1.5em} + +% Точки после номеров в библиографии. Несовместимо с natbib! -- Коротков И. +%\makeatletter +\renewcommand*{\@biblabel}[1]{\hfill#1.} + + +% +% Remove References header completely +% Stolen from original article.cls +% +\makeatletter +\renewenvironment{thebibliography}[1]{% +% \usection{\refname}% +% \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}% + \list{\@biblabel{\@arabic\c@enumiv}}% + {\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \@openbib@code + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv}}% + \sloppy + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000% + \sfcode`\.\@m} + {\def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% + \endlist} +\makeatother diff --git a/doc/diploma/gost/gost-7-32-captions.sty b/doc/diploma/gost/gost-7-32-captions.sty new file mode 100644 index 0000000..b086953 --- /dev/null +++ b/doc/diploma/gost/gost-7-32-captions.sty @@ -0,0 +1,33 @@ +\ProvidesPackage{gost-7-32-captions}[2022/01/28 GOST 7.32-2017] + +\RequirePackage{caption} +\RequirePackage{subcaption} +\RequirePackage{capt-of} + +% +% Table caption aligned to the left with dash as a separator +% +\captionsetup[table]{labelsep=endash, skip=0.5em, justification=raggedright, singlelinecheck=off} + +% +% Dash as separator in figure caption and centering +% +\captionsetup[figure]{labelsep=endash, justification=centering} + +% +% Listing caption +% +\captionsetup[listing]{labelsep=endash, skip=0.5em, singlelinecheck=off, position=above} + +\addto\captionsrussian{\renewcommand{\figurename}{Рис.}} +\addto\captionsrussian{\renewcommand{\lstlistingname}{Рис.}} +%% \addto\captionsrussian{\captionsetup[listing]{name=Рис.}} + +%% NOTE(cmmm): breaks 'figure' counter +%% \makeatletter +%% \AtBeginDocument{% +%% \let\c@figure\c@listing +%% \let\thefigure\thelisting +%% \let\ftype@listing\ftype@figure +%% } +%% \makeatother diff --git a/doc/diploma/gost/gost-7-32-counters.sty b/doc/diploma/gost/gost-7-32-counters.sty new file mode 100644 index 0000000..07c88af --- /dev/null +++ b/doc/diploma/gost/gost-7-32-counters.sty @@ -0,0 +1,43 @@ +\ProvidesPackage{gost-7-32-counters}[2022/01/29 GOST 7.32-2017] + +% +% Values for capital russian letters counter +% +\makeatletter +\newcommand\AlphRus[1]{% + \expandafter \@AlphRus \csname c@#1\endcsname +} + +\newcommand\@AlphRus[1]{% + \ifcase #1% + \or А\or Б\or В\or Г\or Д\or Е\or Ж\or И\or К\or + Л\or М\or Н\or П\or Р\or С\or Т\or У\or Ф\or + Х\or Ц\or Ш\or Щ\or Э\or Ю\or Я% + \else \@ctrerr +\fi +} +\makeatother + +% +% Values for lowercase russian letters counter +% +\makeatletter +\newcommand\alphRus[1]{% + \expandafter \@alphRus \csname c@#1\endcsname +} + +\newcommand\@alphRus[1]{% + \ifcase #1% + \or а\or б\or в\or г\or д\or е\or ж\or и\or к\or + л\or м\or н\or п\or р\or с\or т\or у\or ф\or + х\or ц\or ш\or щ\or э\or ю\or я% + \else \@ctrerr +\fi +} +\makeatother + +% Increment figure counter when using lstlisting +\makeatletter +\let\c@lstlisting\c@figure +\let\ftype@listings\ftype@figure +\makeatother 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 @@ +\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\raggedright}{\thesubsection}{0.5em}{} +\titlespacing{\subsection}{0cm}{0.5cm}{0.5cm} + +\titleformat{\subsubsection}[block]{\normalsize\bfseries\raggedright}{\thesubsubsection}{0.5em}{} +\titlespacing{\subsubsection}{0.0cm}{0.5cm}{0.5cm} + +\makeatletter +\let\oldsection\section +\newcommand{\@sectionnostar}[1]{\phantomsection\oldsection*{#1}} +\newcommand{\@sectionstar}[1]{\oldsection{#1}} +\renewcommand{\section}{\sectionbreak\@ifstar{\@sectionnostar}{\@sectionstar}} + +\let\oldsubsection\subsection +\newcommand{\@subsectionnostar}[1]{\phantomsubsection\oldsubsection*{#1}} +\newcommand{\@subsectionstar}[1]{\oldsubsection{#1}} +\renewcommand{\subsection}{\@ifstar{\@subsectionnostar}{\@subsectionstar}} +\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} + \stepcounter{appendixcnt} +} diff --git a/doc/diploma/gost/gost-7-32-lists.sty b/doc/diploma/gost/gost-7-32-lists.sty new file mode 100644 index 0000000..3b2a47e --- /dev/null +++ b/doc/diploma/gost/gost-7-32-lists.sty @@ -0,0 +1,23 @@ +\ProvidesPackage{gost-7-32-lists}[2022/01/28 GOST 7.32-2017] + +\RequirePackage[inline]{enumitem} +\RequirePackage{gost-7-32-counters} + +\AddEnumerateCounter*{\alphRus}{\c@alphRus}{1} + +%% \setlist{nosep, labelindent=\parindent} +\setlist{nosep} + +\setlist[itemize, 1]{label=\textendash} +\setlist[itemize, 2]{label=\textbullet} +\setlist[itemize, 3]{label=\textbullet} + +\setlist[enumerate, 2]{label=\alphRus*)} + +\newlist{displayitem}{itemize*}{1} +\setlist[displayitem]{ + before={\unskip:\newline\vspace*{\itemsep}\hspace*{\dimexpr\labelindent+\leftmargin-\labelsep-\labelwidth\relax}}, + itemjoin={;\newline\vspace*{\itemsep}\hspace*{\dimexpr\labelindent+\leftmargin-\labelsep-\labelwidth\relax}}, + label={\textendash}, + after={\unskip.\endgraf\noindent}, +} diff --git a/doc/diploma/gost/gost-7-32-tables.sty b/doc/diploma/gost/gost-7-32-tables.sty new file mode 100644 index 0000000..c3954c3 --- /dev/null +++ b/doc/diploma/gost/gost-7-32-tables.sty @@ -0,0 +1,31 @@ +\ProvidesPackage{gost-7-32-tables}[2022/01/28 GOST 7.32-2017] + +\RequirePackage{booktabs} +\RequirePackage{xltabular} +\renewcommand\tabularxcolumn[1]{m{#1}} % for vertical centering text + +% +% Center-aligned column with automatic width +% +\newcolumntype{C}{>{\centering\arraybackslash}X} + +% +% Right-aligned column with automatic width +% +\newcolumntype{R}{>{\raggedleft\arraybackslash}X} + +% +% Table with designations +% +\newenvironment{designations}{ + \noindent + \tabularx{\textwidth}{@{} + >{\raggedright \arraybackslash \hsize=0.25\hsize}X + >{\centering \arraybackslash \hsize=0.05\hsize}X + >{\arraybackslash \hsize=0.70\hsize}X + } +}{ + \endtabularx +} + +\newcommand{\designation}[2]{#1 &---& #2. \\} diff --git a/doc/diploma/gost/gost-7-32-toc.sty b/doc/diploma/gost/gost-7-32-toc.sty new file mode 100644 index 0000000..0f03386 --- /dev/null +++ b/doc/diploma/gost/gost-7-32-toc.sty @@ -0,0 +1,54 @@ +\ProvidesPackage{gost-7-32-toc}[2022/01/28 GOST 7.32-2017] + +\RequirePackage{tocloft} +\RequirePackage[ + bookmarks=true, + colorlinks=true, + unicode=true, + urlcolor=black, + linkcolor=black, + anchorcolor=black, + citecolor=black, + menucolor=black, + filecolor=black, + hidelinks +]{hyperref} + +\RequirePackage{etoolbox} + +\addto\captionsrussian{% + \renewcommand{\contentsname}{СОДЕРЖАНИЕ}% +} + +% Intercept \section* to inject a hyperref anchor right at its location +\makeatletter +\pretocmd{\@ssect}{\phantomsection}{}{} +\makeatother + +% +% Set custom font styles +% +\renewcommand{\cftsecfont}{\normalfont} +\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} +\renewcommand{\cftsecpagefont}{\normalsize} +\renewcommand{\cftaftertoctitle}{\hfill\hfill} +\renewcommand{\cfttoctitlefont}{\hfill\normalfont\large\bfseries} +\titleformat{\tableofcontents}[block]{\centering\large\bfseries}{\thesection}{0.5em}{} +\titlespacing{\tableofcontents}{0cm}{0cm}{1cm} + +% \renewcommand{\cftsecpresnum}{Глава } +% \renewcommand{\cftsecaftersnum}{.} +% \renewcommand{\cftsubsecaftersnum}{.} +% \renewcommand{\cftsubsubsecaftersnum}{.} +% +% Set indents and line spacing +% +\cftsetindents{sec}{0pt}{3em} +\cftsetindents{subsec}{0pt}{3em} +\cftsetindents{subsubsec}{0pt}{3em} +% \setlength{\cftsecindent}{0pt} +% \setlength{\cftsubsecindent}{0pt} +% \setlength{\cftsubsubsecindent}{0pt} +\setlength{\cftbeforesecskip}{0cm} +\setlength{\cftbeforesubsecskip}{0cm} +\setlength{\cftbeforesubsubsecskip}{0cm} diff --git a/doc/diploma/gost/gost-7-32.cls b/doc/diploma/gost/gost-7-32.cls new file mode 100644 index 0000000..912e5c6 --- /dev/null +++ b/doc/diploma/gost/gost-7-32.cls @@ -0,0 +1,62 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{gost-7-32}[2022/01/28 GOST 7.32-2017] + +% +% Supported font sizes: 12pt, 14pt +% +\DeclareOption{12pt}{\PassOptionsToClass{\CurrentOption}{extarticle}} +\DeclareOption{14pt}{\PassOptionsToClass{\CurrentOption}{extarticle}} + +\ProcessOptions\relax + +% +% Set A4 paper format +% +\LoadClass[a4paper]{extarticle} + +% +% Use 1.5 line spacing +% +\RequirePackage{setspace} +\onehalfspacing +% \singlespacing % or \setstretch{1} for 1 line spacing + +% +% First paragraph indentation +% +\RequirePackage{indentfirst} +\setlength{\parindent}{12.5mm} + +% +% Page margin +% +\RequirePackage[ + left=3cm, + right=1cm, + top=2cm, + bottom=2cm, + footskip=1cm, +]{geometry} + +% +% Use TMR-like font +% +\RequirePackage{fontspec} +\RequirePackage{xunicode} +\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase,Mapping=tex-text} +\setmainfont{Times New Roman} + +% +% Use russian language +% +\RequirePackage[main=russian, english]{babel} + +% +% gost-7-32 packages +% +\RequirePackage{gost-7-32-headings} +\RequirePackage{gost-7-32-toc} +\RequirePackage{gost-7-32-lists} +\RequirePackage{gost-7-32-bibliography} +\RequirePackage{gost-7-32-captions} +\RequirePackage{gost-7-32-tables} -- cgit v1.3.1