From 3b184a992b5da004027f6c26d750fbc848af4cca Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 23 May 2023 13:22:18 +0200 Subject: add version control table to title page --- doc/.gitignore | 1 + doc/base.tex | 7 +++---- doc/makefile | 5 ++++- doc/versiontable.awk | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 doc/versiontable.awk (limited to 'doc') diff --git a/doc/.gitignore b/doc/.gitignore index e5139ef..8e7ebcc 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -17,3 +17,4 @@ # ignore output files *.pdf +versionctl.tex diff --git a/doc/base.tex b/doc/base.tex index c3f36eb..74bb57a 100644 --- a/doc/base.tex +++ b/doc/base.tex @@ -21,15 +21,12 @@ \addbibresource{refs.bib} \usepackage{fancyvrb} \usepackage[nottoc]{tocbibind} +\usepackage[en-US]{datetime2} \input{pandoc.tex} \setmainfont{TeX Gyre Schola} \setmathfont{TeX Gyre Schola Math} -\sisetup{ - group-separator = {.}, - output-decimal-marker = {,} -} \bigskipamount=7mm \medskipamount=4mm @@ -60,6 +57,8 @@ \begin{titlepage} \maketitle \thispagestyle{empty} +\vfill +\input{versionctl.tex} \end{titlepage} \tableofcontents diff --git a/doc/makefile b/doc/makefile index 3446eeb..ebf02f3 100644 --- a/doc/makefile +++ b/doc/makefile @@ -8,13 +8,16 @@ dui.pdf: ../assets/LSD_straightLines_Pic_1.png dui.pdf: ../assets/hough_straightLines_Pic_0.png dui.pdf: ../assets/hough_straightLines_Pic_1.png +versionctl.tex: + git tag -l 'doc-*' --format='%(refname:short) %(objectname:short=7) %(contents:subject) %(*authordate:format:%s)' | ./versiontable.awk -F' ' > $@ + %.png: %.bmp convert $< $@ %.pdf: %.svg rsvg-convert -f pdf -o $@ $< -%.pdf: %.tex base.tex %.md.tex +%.pdf: %.tex base.tex %.md.tex versionctl.tex latexmk $< -shell-escape -halt-on-error -lualatex -f -g %.md.tex: %.md diff --git a/doc/versiontable.awk b/doc/versiontable.awk new file mode 100755 index 0000000..96108fd --- /dev/null +++ b/doc/versiontable.awk @@ -0,0 +1,15 @@ +#!/bin/awk -f +BEGIN { + print "\\noindent\\begin{tabularx}{\\linewidth}{llXr}" + print "\\toprule" + print "Version & Commit & Notes & Date\\\\" + print "\\midrule" +} +{ + sub("doc-", "", $1) + print $1" & \\texttt{"$2"} & "$3" & \\DTMdisplaydate"strftime("{%Y}{%m}{%d}{-1}", $4)"\\\\" +} +END { + print "\\bottomrule" + print "\\end{tabularx}" +} -- cgit v1.2.3