comparison docs/_latex/my-doc-style.sty @ 251:733f1661fcb4

Implement TeX commands to allow to suppress the output of section numbers for some levels. Prepare for suppressing section numbering for changlog entries.
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 17 May 2026 11:38:47 +0200
parents d76f090d991f
children b607543d6a8d
comparison
equal deleted inserted replaced
250:5d3f7d80766f 251:733f1661fcb4
40 \ifx\mds@vcs@revision\@empty\relax\else\enspace(rev\ \mds@vcs@revision )\fi} 40 \ifx\mds@vcs@revision\@empty\relax\else\enspace(rev\ \mds@vcs@revision )\fi}
41 \fi% 41 \fi%
42 } 42 }
43 \fi 43 \fi
44 44
45 %
46 % Allow to suppress section numbering for some parts of the document
47 % (e.g. in changelog entries).
48 %
49 % Sphinx employs the "titlesec" package to style its chapter and section
50 % headings and uses its \titleformat command with a 0.5em separation
51 % (see \titleformat calls in sphinxlatexstyleheadings.sty).
52 % So make \the<section> output nothing (e.g. the section number)
53 % but just a compensation for this whitespace.
54 %
55 % Each suppress command suppresses its level and all levels below
56 % (compare with the \titleformat calls in sphinxlatexstyleheadings.sty).
57 %
58 % \EndSuppressNumbering ends exactly one preceding
59 % \SuppressSubsectionNumbering or \SuppressSubsubsectionNumbering.
60 %
61 \def\SuppressSectionNumbering{%
62 \begingroup
63 \renewcommand\thesection{\hspace{-0.5em}}
64 \renewcommand\thesubsection{\hspace{-0.5em}}
65 \renewcommand\thesubsubsection{\hspace{-0.5em}}
66 \renewcommand\theparagraph{\hspace{-0.5em}}
67 \renewcommand\thesubparagraph{\hspace{-0.5em}}
68 }
69 \def\SuppressSubsectionNumbering{%
70 \begingroup
71 \renewcommand\thesubsection{\hspace{-0.5em}}
72 \renewcommand\thesubsubsection{\hspace{-0.5em}}
73 \renewcommand\theparagraph{\hspace{-0.5em}}
74 \renewcommand\thesubparagraph{\hspace{-0.5em}}
75 }
76 \def\SuppressSubsubsectionNumbering{%
77 \begingroup
78 \renewcommand\thesubsubsection{\hspace{-0.5em}}
79 \renewcommand\theparagraph{\hspace{-0.5em}}
80 \renewcommand\thesubparagraph{\hspace{-0.5em}}
81 }
82 \def\EndSuppressNumbering{%
83 \endgroup
84 }
85
45 \endinput 86 \endinput