add date and commit to title

This commit is contained in:
Valentin Boettcher 2021-04-19 19:57:15 +02:00
parent 31dfc9a301
commit 62a45fd64a
No known key found for this signature in database
GPG key ID: C22D4DE4D7B32D19

View file

@ -547,6 +547,17 @@
\DeclareFixedFont\trfont{OT1}{phv}{b}{sc}{11} \DeclareFixedFont\trfont{OT1}{phv}{b}{sc}{11}
% get commit and branch
\usepackage{xstring}
\usepackage{catchfile}
\CatchFileDef{\headfull}{.git/HEAD}{}
\StrGobbleRight{\headfull}{1}[\head]
\StrBehind[2]{\head}{/}[\branch]
\IfFileExists{.git/refs/heads/\branch}{%
\CatchFileDef{\commit}{.git/refs/heads/\branch}{}}{%
\newcommand{\commit}{\dots~(in \emph{packed-refs})}}
%first page %first page
\renewcommand\maketitle{ \renewcommand\maketitle{
%% First page %% First page
@ -604,6 +615,10 @@
\PackageWarningNoLine{\jname}{E-mails are missing.\MessageBreak Plese use \protect\emailAdd\space macro to provide e-mails.} \PackageWarningNoLine{\jname}{E-mails are missing.\MessageBreak Plese use \protect\emailAdd\space macro to provide e-mails.}
\fi \fi
\afterEmailSpace \afterEmailSpace
{\bfseries\raggedright\sffamily Version\par}
\@date\quad
\commit on \branch
\afterAuthorSpace
%Erratum or addendum %Erratum or addendum
\if!\@xtum!\else\noindent{\@xtum}\afterXtumSpace\fi \if!\@xtum!\else\noindent{\@xtum}\afterXtumSpace\fi
% Abstract % Abstract