Latex Revision Conrol

So you are writing Latex documents and you want to manage or display what has changed between different versions of the document, most probably for one of your supervisors. Well there is an option to use changebars manually or through an automated changebar repository Perl script.

Latex Diff

On the ECS systems the following commands work:

  • man latexdiff
  • man latexrevise
  • man latexdiff-vc

Manual Changebars

If you want to add changebars on the side of your documents to show when changes have happened you can do the following manually to your Latex document. Be sure to include the changebar.sty: changebar.sty file in your directory.


document content here


Thesis Diff - Automated Changebars from Repository Revisions

So a number of people have worked out ways to integrate (svn, cvs, etc) with LaTeX stuff. See

DonaldGordon's "Thesis Diff" build provides one approach to this, and is attached here build.tar.gz: build.tar.gz

Thesis Diff contains several useful scripts:

  • flattentex takes a tex file with \include statements in it and presents to standard output that same file, with all the \includes replaced with the contents of the files they reference
  • flattenrev does the same thing, except when it finds a \chapter command in an included file it adds information to the chapter title about the revision number, and text to the start of the chapter about the last time that file was modified. The chapter title change means that the header in all the pages in that chapter will have the revision number in it.
  • latexdiff, not written by Donald, will take two tex files and produce a third, with some indication of where the text has changed. Use it to produce changebars with a command line like ./latexdiff -t CHANGEBAR old.tex new.tex
    • latexdiff does not know about \include, so you want to use flattentex on the files you give it
    • make sure you use the latexdiff file that is in this build package
  • thesisdiff, which probably needs some changes to work with your thesis and build process, takes an svn revision number as an argument and creates a PDF with changebars between that revision and the most recently committed revision.
  • thesisold just takes a revision number and builds that version of the thesis.
  • and the Makefile ties the build process together

Topic attachments
I Attachment Action Size Date Who Comment
build.tar.gzgz build.tar.gz manage 26 K 24 Jun 2010 - 16:05 Main.craig  
changebar.stysty changebar.sty manage 29 K 24 Jun 2010 - 16:34 Main.craig