chiark / gitweb /
revid - include
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Mar 2012 11:27:23 +0000 (11:27 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Mar 2012 11:27:23 +0000 (11:27 +0000)
.gitignore
Makefile
article.tex

index 310442b..1d15410 100644 (file)
@@ -5,3 +5,5 @@
 *.pdf
 *.ps
 *~
+revid.inc
+*.new
index 8bd84b3..0f2016e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,13 @@ SRCS := $(wildcard *.tex)
 
 default: final.pdf
 
-once:
+once:          revid.inc
                pdflatex -halt-on-error article.tex </dev/null
 
+revid.inc:     .git-revid $(SRCS) Makefile
+               ./$< >$@.new
+               cmp $@.new $@ || mv -f $@.new $@
+
 final.pdf: $(SRCS)
                $(MAKE) once
                $(MAKE) once
index 1302cad..228532c 100644 (file)
@@ -11,6 +11,8 @@
 \usepackage{fancyhdr}
 \pagestyle{fancy}
 \lhead[\rightmark]{}
+\lfoot[\thepage]{\input{revid.inc}}
+\rfoot[\input{revid.inc}]{\thepage}
 
 \let\stdsection\section
 \renewcommand\section{\newpage\stdsection}