annotate docs/_latex/my-doc-style.sty @ 252:b607543d6a8d

***** my-doc-style.sty v0.3
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 17 May 2026 11:39:31 +0200
parents 733f1661fcb4
children fac80ec8e752
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 -*-
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
2 %
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
3 % Some font hacks for my Sphinx PDF documents
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 \NeedsTeXFormat{LaTeX2e}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
6 \ProvidesPackage{my-doc-style}[%
252
b607543d6a8d ***** my-doc-style.sty v0.3
Franz Glasner <fzglas.hg@dom66.de>
parents: 251
diff changeset
7 2026/05/17 v0.3 (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
8 \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
9
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 % 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
11 % 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
12 \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
13
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 \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
15 \ProcessOptionsX\relax
213
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
16
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
17 %
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
18 % For the title page: "Last updated on ..."
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 \DeclareRobustCommand*\vcsrevision[1]{\gdef\mds@vcs@revision{#1}}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
21 \DeclareRobustCommand*\builddate[1]{\gdef\mds@builddate{#1}}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
22 \vcsrevision{}
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
23 \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
24 %
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
25 % 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
26 % 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
27 %
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 \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
29 \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
30 \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
31 % \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
32 \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
33 \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
34 \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
35 \else%
247
76996a1e4ca7 Use "rev " instead of "rv:" in the revision footer
Franz Glasner <fzglas.hg@dom66.de>
parents: 217
diff changeset
36 \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
37 \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
38 \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
39 \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
40 \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
41 \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
42 }
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
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
45 %
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
46 % 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
47 % (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
48 %
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 % 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
50 % 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
51 % (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
52 % 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
53 % 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
54 %
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 % 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
56 % (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
57 %
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 % \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
59 % \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
60 %
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 \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
62 \begingroup
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
63 \renewcommand\thesection{\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
64 \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
65 \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
66 \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
67 \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
68 }
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
69 \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
70 \begingroup
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 \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
72 \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
73 \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
74 \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
75 }
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 \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
77 \begingroup
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\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
79 \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
80 \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
81 }
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 \def\EndSuppressNumbering{%
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
83 \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
84 }
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
213
d470250f8451 Title/metadata of PDF documentation builds:
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
86 \endinput