2011-07-07 22:42:09
1. Just a add the following lines to your Makefile

HGID:=$(shell hg parents -R .. --template "Mercurial revision {rev} - date: {date|isodate}") hgid.tex:dummy [ -f$@ ] || touch $@ echo '\\renewcommand{\hgid}{$(HGID)}' > \$@
dummy: ;

2. and this lines to your main tex file

\newcommand{\hgid}{null}
\input{hgid}


now one can use the command \hgid to get the version everywhere.

3. for instance

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{}
\chead{{\sc This a DRAFT, please do not distribute.}}
\cfoot{\HRule \\ \hgid}