# HG changeset patch # User Franz Glasner # Date 1778848451 -7200 # Node ID 8ef73270beaeca8738da6280927d3c9a6411f068 # Parent 0d6eb420971437678f4c0a886b156549fd4d2c53 Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content diff -r 0d6eb4209714 -r 8ef73270beae docs/_latex/my-doc-style.sty --- a/docs/_latex/my-doc-style.sty Fri May 15 10:35:32 2026 +0200 +++ b/docs/_latex/my-doc-style.sty Fri May 15 14:34:11 2026 +0200 @@ -5,6 +5,14 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{my-doc-style}[% 2026/05/14 v0.1 (Franz Glasner) Some style customizations] +\RequirePackage{xkeyval} + +% A key compatible with options processing but bool (because DeclareBoolOptionX) +% If given than the Sphinx standard titlepage is used without changes. +\define@boolkey{my-doc-style.sty}{stdtitle}[true]{} + +\ExecuteOptionsX{stdtitle=false} +\ProcessOptionsX\relax % % For the title page: "Last updated on ..." @@ -13,12 +21,25 @@ \DeclareRobustCommand*\builddate[1]{\gdef\mds@builddate{#1}} \vcsrevision{} \builddate{} -% \sphinxmaketitle references \@thanks: abuse this -\gdef\@thanks{% - \ifx\mds@builddate\@empty\relax% - \else% - \hfill\normalsize\textsf{Last updated on \mds@builddate% - \ifx\mds@vcs@revision\@empty\relax\else\enspace(rv:\mds@vcs@revision )\fi} - \fi -} +% +% If the option "stdtitle" was not enabled augment the titlepage with +% the documentation build date and the VCS revision id. +% +\csname ifKV@my-doc-style.sty@stdtitle\endcsname + \relax +\else + % \sphinxmaketitle calls the macro \@thanks: abuse this + \gdef\@thanks{% + \ifx\mds@builddate\@empty\relax% + \ifx\mds@vcs@revision\@empty\relax% + \else% + \hfill\normalsize\textsf{(rv:\mds@vcs@revision )}% + \fi% + \else% + \hfill\normalsize\textsf{Last updated on \mds@builddate% + \ifx\mds@vcs@revision\@empty\relax\else\enspace(rv:\mds@vcs@revision )\fi} + \fi% + } +\fi + \endinput diff -r 0d6eb4209714 -r 8ef73270beae docs/conf.py --- a/docs/conf.py Fri May 15 10:35:32 2026 +0200 +++ b/docs/conf.py Fri May 15 14:34:11 2026 +0200 @@ -152,10 +152,9 @@ # "fontpkg": r"\usepackage[charter]{my-doc-fonts}", "releasename": "Version", "fncychap": r"\usepackage[Sonny]{fncychap}", - "preamble": r""" -\usepackage{my-doc-style} -\builddate{%s}\vcsrevision{%s} -""" % (current_date, release_rev), + "preamble": r"\usepackage[stdtitle=false]{my-doc-style}", + "maketitle": r"\builddate{%s}\vcsrevision{%s}\sphinxmaketitle" \ + % (current_date, release_rev), } latex_theme = "manual" latex_show_urls = "footnote"