# svn-multi: committed PDF always has an offset in revision number?

I'm using the svn-multi package to keep track of different versions of my PhD thesis.

One problem (I did not find anything about it in the manual or in the web, but maybe I overlooked it): I have compiled my document and the PDF is marked with the number of the last revision "85". When I now do a commit (and I also commit the PDF to have it for future reference), in revision number 86 sits a PDF with number 85 printed on it.

I think that is an inherent problem, because the PDF has to be created before the commit is done, or is there anything that can be done to avoid that and have the committed PDF showing the rev number corresponding to its commit?

-
A late welcome to tex.sx! Note that it is unusual around here to sign your questions (as there is already a box with your username below it). –  Hendrik Vogt Mar 10 '11 at 16:27
@Hendrik: sorry, just a bad habit of mine ;-) I'll have to try to get used to the local netiquette... –  Martin Mar 10 '11 at 16:37
Not really an answer, so I'll leave it as a comment: just how desirable is it to have your PDFs under version control? I tend to v-c just the source files. –  Brent.Longborough May 28 '11 at 16:29
@Brent.Longborough: your right - I also considered only taking the source files. However, after some installations/updates of different LaTeX packages, TeXLive 20xx etc. it is good to have the original version of the pdf and not to compile again. (surely it would save much space not to save the pdfs. But the problem is: I use the version control also to keep track of version I gave someone for proof reading or comments. So the number on the printed copy always differs from the one in the repository....) –  Martin May 28 '11 at 19:59

I'm the author of svn-multi. As already mentioned that is an inherent problem.

One way to achieve this is to define an own macro which may or may not add one to the revision number. This works if the next revision number is really just one larger than the current one. If other people committed something to the repository in the meantime or you committed something outside the LaTeX document, then the difference will be bigger.

You can do it like this: \mysvnrev is either just \svnrev or adds 1 using \numexpr. Just comment the second line out during normal operation and enable it when you compile a PDF you like to commit.

\documentclass{article}
\usepackage{svn-multi}
\svnid{$Id: test.tex 85 2011-03-10 10:11:47Z martin$}

\newcommand*{\mysvnrev}{\svnrev}
\renewcommand*{\mysvnrev}{\the\numexpr\svnrev+1\relax}

\begin{document}

\svnrev

\end{document}

Or you could just say:

\edef\svnrev{\the\numexpr\svnrev+1\relax}

after your preamble to increase \svnrev by one.

-
@Hendrik: Thanks for your help! As I'm the only one to commit changes, the workaround should help. Or I'll just leave it as it is, knowing that in rev 56 I'll find the files with rev 55. –  Martin Mar 10 '11 at 16:44