Technobabble
Grokking Technology

Document Version Numbering in Latex

How useful would it be to include a document version that can increment itself every-time the document file is updated into a subversion repository. Being able to show a revision number on selected pages of Latex documents must prevent the confusion that arises during project documentation as both project and documentation evolve. It is easy enough for the document author to track revisions (embedded in comments) but being able to actually print out a dynamic revision is much more difficult.

Example of a document with version number

The idea for this came from an article by Lex Spoon who provided the basic Latex technique for providing a variable that could be rendered and a perl script. Here I will outline a similar solution using python, extending the concept somewhat.

Lex Spoon provides a perl script which automates this for you, possibly integrating with your build process; my python script (which uses pysvn) has more mundane ambitions and is available on the AFC Commercial OSS download site. To get this working:

You could even move the files into a more global location for the project and run sversion in that folder.


Page created on Sat 30 Jan 2021 by Andy Ferguson