annotate docs/_latex/my-doc-style.sty @ 280:1b0e58f60f73

Update to latest my-doc-XXX.sty for PDF builds
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 20 May 2026 12:54:06 +0200
parents 0114842950c4
children 0052d12ec437
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
1 % -*- coding: utf-8 -*-
280
1b0e58f60f73 Update to latest my-doc-XXX.sty for PDF builds
Franz Glasner <fzglas.hg@dom66.de>
parents: 256
diff changeset
2 % SPDX-FileCopyrightText: © 2026 Franz Glasner
1b0e58f60f73 Update to latest my-doc-XXX.sty for PDF builds
Franz Glasner <fzglas.hg@dom66.de>
parents: 256
diff changeset
3 % SPDX-License-Identifier: BSD-3-Clause
213
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
4 %
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
5 % Some font hacks for my Sphinx PDF documents
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
6 %
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
7 \NeedsTeXFormat{LaTeX2e}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
8 \ProvidesPackage{my-doc-style}[%
256
0114842950c4 ***** my-doc-style.sty v0.3.1
Franz Glasner <fzglas.hg@dom66.de>
parents: 255
diff changeset
9 2026/05/17 v0.3.1 (Franz Glasner) Some style customizations (title et al.)]
216
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
10 \RequirePackage{xkeyval}
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
11
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
12 % A key compatible with options processing but bool (because DeclareBoolOptionX)
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
13 % If given than the Sphinx standard titlepage is used without changes.
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
14 \define@boolkey{my-doc-style.sty}{stdtitle}[true]{}
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
15
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
16 \ExecuteOptionsX{stdtitle=false}
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
17 \ProcessOptionsX\relax
213
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
18
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
19 %
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
20 % For the title page: "Last updated on ..."
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
21 %
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
22 \DeclareRobustCommand*\vcsrevision[1]{\gdef\mds@vcs@revision{#1}}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
23 \DeclareRobustCommand*\builddate[1]{\gdef\mds@builddate{#1}}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
24 \vcsrevision{}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
25 \builddate{}
216
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
26 %
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
27 % If the option "stdtitle" was not enabled augment the titlepage with
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
28 % the documentation build date and the VCS revision id.
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
29 %
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
30 \csname ifKV@my-doc-style.sty@stdtitle\endcsname
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
31 \relax
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
32 \else
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
33 % \sphinxmaketitle calls the macro \@thanks: abuse this
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
34 \gdef\@thanks{%
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
35 \ifx\mds@builddate\@empty\relax%
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
36 \ifx\mds@vcs@revision\@empty\relax%
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
37 \else%
247
76996a1e4ca7 Use "rev " instead of "rv:" in the revision footer
Franz Glasner <fzglas.hg@dom66.de>
parents: 217
diff changeset
38 \hfill\normalsize\textsf{(rev\ \mds@vcs@revision )}%
216
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
39 \fi%
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
40 \else%
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
41 \hfill\normalsize\textsf{Last updated on \mds@builddate%
247
76996a1e4ca7 Use "rev " instead of "rv:" in the revision footer
Franz Glasner <fzglas.hg@dom66.de>
parents: 217
diff changeset
42 \ifx\mds@vcs@revision\@empty\relax\else\enspace(rev\ \mds@vcs@revision )\fi}
216
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
43 \fi%
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
44 }
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
45 \fi
8ef73270beae Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
Franz Glasner <fzglas.hg@dom66.de>
parents: 213
diff changeset
46
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
47 %
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
48 % Allow to suppress section numbering for some parts of the document
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
49 % (e.g. in changelog entries).
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
50 %
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
51 % Sphinx employs the "titlesec" package to style its chapter and section
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
52 % headings and uses its \titleformat command with a 0.5em separation
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
53 % (see \titleformat calls in sphinxlatexstyleheadings.sty).
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
54 % So make \the<section> output nothing (e.g. the section number)
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
55 % but just a compensation for this whitespace.
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
56 %
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
57 % Each suppress command suppresses its level and all levels below
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
58 % (compare with the \titleformat calls in sphinxlatexstyleheadings.sty).
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
59 %
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
60 % \EndSuppressNumbering ends exactly one preceding
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
61 % \SuppressSubsectionNumbering or \SuppressSubsubsectionNumbering.
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
62 %
255
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
63
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
64 %
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
65 % A counter to store the current (Sphinx-set) tocdepth.
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
66 % Needed because counters are global in LaTeX.
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
67 %
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
68 \newcounter{@mds@stored@tocdepth}
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
69
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
70 \def\SuppressSectionNumbering{%
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
71 \begingroup
255
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
72 \setcounter{@mds@stored@tocdepth}{\value{tocdepth}}
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
73 \addtocontents{toc}{\setcounter{tocdepth}{0}}% No \section in ToC
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
74 \renewcommand\thesection{\hspace{-0.5em}}
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
75 \renewcommand\thesubsection{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
76 \renewcommand\thesubsubsection{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
77 \renewcommand\theparagraph{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
78 \renewcommand\thesubparagraph{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
79 }
255
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
80
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
81 \def\SuppressSubsectionNumbering{%
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
82 \begingroup
255
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
83 \setcounter{@mds@stored@tocdepth}{\value{tocdepth}}
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
84 \addtocontents{toc}{\setcounter{tocdepth}{1}}% Allow \section in ToC
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
85 \renewcommand\thesubsection{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
86 \renewcommand\thesubsubsection{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
87 \renewcommand\theparagraph{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
88 \renewcommand\thesubparagraph{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
89 }
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
90 \def\SuppressSubsubsectionNumbering{%
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
91 \begingroup
255
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
92 \setcounter{@mds@stored@tocdepth}{\value{tocdepth}}
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
93 \addtocontents{toc}{\setcounter{tocdepth}{2}}% Allow \subsection in ToC
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
94 \renewcommand\thesubsubsection{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
95 \renewcommand\theparagraph{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
96 \renewcommand\thesubparagraph{\hspace{-0.5em}}
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
97 }
255
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
98
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
99 \def\EndSuppressNumbering{%
255
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
100 % Reset the tocdepth to the previous value
fac80ec8e752 FIX: Need to manipulate tocdepth to also suppress ToC entries for sections without numbers
Franz Glasner <fzglas.hg@dom66.de>
parents: 252
diff changeset
101 \addtocontents{toc}{\setcounter{tocdepth}{\the@mds@stored@tocdepth}}% Default
251
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
102 \endgroup
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
103 }
733f1661fcb4 Implement TeX commands to allow to suppress the output of section numbers for some levels.
Franz Glasner <fzglas.hg@dom66.de>
parents: 248
diff changeset
104
213
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
105 \endinput