# Print subversion repo number on each page

My documents live within a huge subversion repository.

When I print out a document, say, for proof reading or checking for typos, then I would like to have the repository version number printed on each page (top or bottom, doesn't matter). The motivation is that it would help me monitor which remarks on physical paper I have not already transmitted into the current version, or which of several print outs is to be regarded newest.

-
How do you obtain the number? One of the (more workflow oriented) problem would be, that in the usual workflow, you would write something and commit that to SVN (or as i do - git). But your approach would require to perform a new run of (pdf/Xe/Lua)LaTeX to include that number in the document, which would change the code in comparison to the commit. - Wouldn't it be enough to print \date (perhaps also time of compilation) in each - say - bottom left footer? –  Ronny Dec 17 '12 at 9:44
See Martin Scharrer's nice article on how to use svn-multi to do this. –  Andrew Swann Dec 17 '12 at 12:02

Because a larger LaTeX document is usually spread over multiple files (i.e. a main file and multiple sub-files) I wrote a package to collect all revision information for each one and provide the latest revision number and other details.

You need to enable keyword expansion using:

svn propset svn:keywords 'Id Author Date Rev URL' *.tex


or using your graphics interface liek e.g. TortoiseSVN, and place at least a \svnid{$Id$} at the begin of every .tex file. To get correct values you need to compile at least twice.

To place the SVN information into the header or footer you can use e.g. the fancyhdr package:

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[ol]{Rev: \svnrev\ (\svnfilerev)}
\fancyfoot[or]{\svnyear-\svnmonth-\svnday\ \svnhour:\svnminute} % Date
% If the information should be also placed
% on the chapter page use:
\fancypagestyl {plain}{%