Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff docs/_latex/my-doc-style.sty @ 216:8ef73270beae
Make my-doc-style.sty more flexible by providing the "stdtitle" option to switch off the customized titlepage content
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 15 May 2026 14:34:11 +0200 |
| parents | d470250f8451 |
| children | 3777eb7dbf4a |
line wrap: on
line diff
--- 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
