add 'git' option to include the git version

This uses the gitinfo2 package. To make this package option work
properly, you have to set up the git hooks available at https://ftp.fau.de/ctan/macros/latex/contrib/gitinfo2/post-xxx-sample.txt
This commit is contained in:
Maximilian Keßler 2021-09-07 21:45:21 +02:00
parent 93b40491bf
commit 35a9318e09

View file

@ -10,6 +10,9 @@
\DeclareOption{show version}{\showversiontrue}
\DeclareOption{hideversion}{\showversionfalse}
\newif\ifgitversion\gitversionfalse
\DeclareOption{git}{\gitversiontrue}
\ProcessOptions\relax
@ -38,6 +41,14 @@
%%%%Load base class article
\LoadClass{article}
\ifshowversion
\ifgitversion
\RequirePackage[dirty={ (local changes have been made!)}]{gitinfo2}
\fi
\fi
%%%%Title
%Define layout of title using course, lecturer, assistant and author, and optionally the current time
\RequirePackage{xparse}
@ -73,7 +84,10 @@
\vskip 3em%
\begin{tabular}[t]{c}%
{\small Version} \\
\today\,\currenttime
\ifgitversion
git: \gitFirstTagDescribe\\
\fi
\ifenglish compiled\else kompiliert\fi~: \today\,\currenttime \\
\end{tabular}\par
\fi
\vskip 4em%