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:
parent
93b40491bf
commit
35a9318e09
1 changed files with 15 additions and 1 deletions
|
@ -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%
|
||||
|
|
Loading…
Reference in a new issue