aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-05-23 13:22:18 +0200
committerlonkaars <loek@pipeframe.xyz>2023-05-23 13:22:18 +0200
commit3b184a992b5da004027f6c26d750fbc848af4cca (patch)
tree4674a5a51d35c266962a7e93f0fe3ccf82fbdedc
parent2d4bf042a5e878e3eb0b3d4f8e8941644d8e6f21 (diff)
add version control table to title page
-rw-r--r--doc/.gitignore1
-rw-r--r--doc/base.tex7
-rw-r--r--doc/makefile5
-rwxr-xr-xdoc/versiontable.awk15
4 files changed, 23 insertions, 5 deletions
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}"
+}