33

Whenever I write a collaborative document, it undergoes a lot of draft changes. Apart from maintaining the change history in svn, how can I maintain the change history in the tex document itself? I also want it to reflect on the generated pdf.

iceman
  • 1,213
  • Since you keeping the change history in svn, I would simply define a command version is that what you are looking for or are you looking for something to diff? – yannisl Dec 05 '10 at 16:30
  • 1
    Probably you will need changebar.sty to mark the revision. – Display Name Dec 05 '10 at 16:37
  • 1
    http://www.ctan.org/tex-archive/support/latexdiff/ – Seamus Dec 05 '10 at 18:15
  • 1
    Any thing with the revision-control tag should be useful, such as the following questions: http://tex.stackexchange.com/questions/161/latex-packages-for-use-with-revision-control http://tex.stackexchange.com/questions/1325/using-latexdiff-with-git – Niall Murphy Dec 05 '10 at 18:24
  • What exactly do you want? A list of changes somewhere in the document (eg in the appendix)? Highlighting changes directly in the document where they occur? If so, how many revision? Or do you only want to print a version number? – Caramdir Dec 05 '10 at 18:46
  • @Caramdir : A list of changes somewhere in the document like an appendix..this is in the generated pdf. – iceman Dec 05 '10 at 20:07
  • @Caramdir : actually, its better if we avoid os specific scripts.I prefer everything to be in the tex file as tex is pretty much a programming language rather than anything else – iceman Dec 08 '10 at 10:39

3 Answers3

38

If you want a revision history table showing the following four items, you should look at the vhistory package.

  • Version
  • Date
  • Authors
  • Summary of the changes

If you're wanting the exact revision history from SVN, this might not be the package for you, as this revision history table is created in the LaTeX document. I find this advantageous since I want a more succinct revision history table than every little check-in to git.

Example vhistory code

\usepackage{vhistory}
\begin{document}
% Start of the revision history table
\begin{versionhistory}
  \vhEntry{1.0}{22.01.04}{JPW|KW}{created}
  \vhEntry{1.1}{23.01.04}{DP|JPW}{correction}
  \vhEntry{1.2}{03.02.04}{DP|JPW}{revised after review}
\end{versionhistory}

Use the tablegrid option if you want to "display a grid in the table representing the revision history."

Example vhistory output

enter image description here

6

I have previously used the svninfo Herbert already mentioned.

But I recently found the vc bundle. It has the advantage/difference of not only tracking the included .tex files but any file in the directory. You will get the global revision, including images or .bib files as well. Apart from svn it supports bzr and git.

On the other hand, it is an external shell-script and not a LaTeX package. Also you will only get the global revision number, not a more fine-grained result depending on current file etc. as svninfo provides.

Supplement: Since it does not use svn properties and special lines in the TeX file, it is completely independent from the svninfo approach and you can even combine both variants.

4

I Use package rcs and put

\usepackage{rcs}

in the preamble. Then, lines such as:

\RCS $Id:$
\RCS $Source:$
\pagestyle{myheadings}
\markright{\RCSId}

put version information in the formated document.

I notice that there is also a package rcsinfo with a similar purpose, but have not used it.

Hendrik Vogt
  • 37,935
F. Tusell
  • 753