I am using bazaar as a version control system for my research. I have many latex documents. I want to display the version number in all the .dvi files under bazaar.
Asked
Active
Viewed 435 times
4
-
1You should probably change the title to something like: "How to display bazaar version number in a latex document?" which would be clearer and more likely to get a prompt answer. – Tikhon Jelvis Jul 29 '11 at 17:46
3 Answers
4
The easiest way to accomplish this will be to use make
or a similar build manager to generate your .dvi files.
Your Makefile should include a new target called version-number
:
version-number:
bzr revno > VERSION.tex
and your .dvi targets should depend on version-number
:
my-project.dvi: my-project.tex [OTHER STUFF] version-number
In your .tex files, at an appropriate place (in the header/footer, title block, PDF metainfo, etc) you would include the version number stored in VERSION.tex:
\input{VERSION}
When you set this up you should bzr ignore VERSION.tex
so that it won't store its own version number, of course.
This is all based on a similar technique used for git
in the Common Lisp Quick Reference project.

andrewtinka
- 593
- 4
- 10