changeset 785:42f7caa89253

Update to recent my-doc-style.sty
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 17 May 2026 11:42:40 +0200
parents 16f040434598
children 5f0ee44825b1
files docs/_latex/my-doc-style.sty
diffstat 1 files changed, 42 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/docs/_latex/my-doc-style.sty	Sat May 16 22:27:13 2026 +0200
+++ b/docs/_latex/my-doc-style.sty	Sun May 17 11:42:40 2026 +0200
@@ -4,7 +4,7 @@
 %
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{my-doc-style}[%
-  2026/05/16 v0.2.1 (Franz Glasner) Some style customizations (title et al.)]
+  2026/05/17 v0.3 (Franz Glasner) Some style customizations (title et al.)]
 \RequirePackage{xkeyval}
 
 % A key compatible with options processing but bool (because DeclareBoolOptionX)
@@ -42,4 +42,45 @@
   }
 \fi
 
+%
+% Allow to suppress section numbering for some parts of the document
+% (e.g. in changelog entries).
+%
+% Sphinx employs the "titlesec" package to style its chapter and section
+% headings and uses its \titleformat command with a 0.5em separation
+% (see \titleformat calls in sphinxlatexstyleheadings.sty).
+% So make \the<section> output nothing (e.g. the section number)
+% but just a compensation for this whitespace.
+%
+% Each suppress command suppresses its level and all levels below
+% (compare with the \titleformat calls in sphinxlatexstyleheadings.sty).
+%
+% \EndSuppressNumbering ends exactly one preceding
+% \SuppressSubsectionNumbering or \SuppressSubsubsectionNumbering.
+%
+\def\SuppressSectionNumbering{%
+  \begingroup
+  \renewcommand\thesection{\hspace{-0.5em}}  
+  \renewcommand\thesubsection{\hspace{-0.5em}}
+  \renewcommand\thesubsubsection{\hspace{-0.5em}}
+  \renewcommand\theparagraph{\hspace{-0.5em}}
+  \renewcommand\thesubparagraph{\hspace{-0.5em}}
+}
+\def\SuppressSubsectionNumbering{%
+  \begingroup
+  \renewcommand\thesubsection{\hspace{-0.5em}}
+  \renewcommand\thesubsubsection{\hspace{-0.5em}}
+  \renewcommand\theparagraph{\hspace{-0.5em}}
+  \renewcommand\thesubparagraph{\hspace{-0.5em}}
+}
+\def\SuppressSubsubsectionNumbering{%
+  \begingroup
+  \renewcommand\thesubsubsection{\hspace{-0.5em}}
+  \renewcommand\theparagraph{\hspace{-0.5em}}
+  \renewcommand\thesubparagraph{\hspace{-0.5em}}
+}
+\def\EndSuppressNumbering{%
+  \endgroup
+}
+
 \endinput