UK TeX FAQ -- question 190

### Marking changed parts of your document

One often needs clear indications of how a document has changed, but the commonest technique, "change bars", requires surprisingly much trickery of the programmer (the problem being that TeX 'proper' doesn't provide the programmer with any information about the "current position" from which a putative start- or end-point of a bar might be calculated; PDFTeX does provide the information, but we're not aware yet of any programmer taking advantage of the fact to write a PDFTeX-based changebar package).

The simplest package that offers change bars is Peter Schmitt's backgrnd.tex; this was written as a Plain TeX application that patches the output routine, but it appears to work at least on simple LaTeX documents. Wise LaTeX users will be alerted by the information that backgrnd patches their output routine, and will watch its behaviour very carefully (patching the LaTeX output routine is not something to undertake lightly\dots).

The longest-established solution is the changebar package, which uses `\special` commands supplied by the driver you're using. You need therefore to tell the package which driver to generate `\special`s for (in the same way that you need to tell the graphics package); the list of available drivers is pretty restricted, but does include dvips. The package comes with a shell script chbar.sh (for use on Unix machines) that will compare two documents and generate a third which is marked-up with changebar macros to highlight changes.

The vertbars package uses the techniques of the lineno package (which must be present); it's thus the smallest of the packages for change bar marking, since it leaves all the trickery to another package.

`backgrnd.tex`
  macros/generic/backgrnd.tex
`changebar.sty`
  macros/latex/contrib/supported/changebar.tar.gz
`lineno.sty`
  macros/latex/contrib/supported/lineno.tar.gz
`vertbars.sty`
  macros/latex/contrib/supported/misc/vertbars.sty