# HG changeset patch # User Franz Glasner # Date 1779010727 -7200 # Node ID 733f1661fcb4d0e82ae203a4da7fe8068ffd2e43 # Parent 5d3f7d80766f1d05aedee50fa9765cd7dc561ca6 Implement TeX commands to allow to suppress the output of section numbers for some levels. Prepare for suppressing section numbering for changlog entries. diff -r 5d3f7d80766f -r 733f1661fcb4 docs/_latex/my-doc-style.sty --- a/docs/_latex/my-doc-style.sty Sat May 16 22:28:55 2026 +0200 +++ b/docs/_latex/my-doc-style.sty Sun May 17 11:38:47 2026 +0200 @@ -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
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