summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-changebars.html
blob: aa9a8bba6b95b5470e6b62ee192e436acc34fbfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<head>
<title>UK TeX FAQ -- question label changebars</title>
</head><body>
<h3>Marking changed parts of your document</h3>
<p/>One often needs clear indications of how a document has changed, but
the commonest technique, &ldquo;change bars&rdquo; (also known as &ldquo;revision
bars&rdquo;), requires surprisingly much
trickery of the programmer.  The problem is that TeX &lsquo;proper&rsquo;
doesn&rsquo;t provide the programmer with any information about the
&ldquo;current position&rdquo; from which a putative start- or end-point of a
bar might be calculated.   PDFTeX <em>does</em> provide that
information, but no PDFTeX-based changebar package has been
published, that takes advantage of that.
<p/>The simplest package that offers change bars is Peter Schmitt&rsquo;s
<i>backgrnd.tex</i>; 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 <i>backgrnd</i> patches their output routine, and
will watch its behaviour very carefully (patching the LaTeX output
routine is not something to undertake lightly&hellip;).
<p/>The longest-established LaTeX-specific solution is the
<i>changebar</i> package,
which uses <code>\</code><code>special</code> commands supplied by the driver you&rsquo;re using.
You need therefore to tell the package which driver to you&rsquo;re using
(in the same way that you need to tell the <i>graphics</i>
package); the list of available drivers is pretty
wide, but does not include <i>dvipdfm</i>.  The package comes with
a shell script <i>chbar.sh</i> (for use on Unix machines) that
will compare two documents and generate a third which is marked-up
with <i>changebar</i> macros to highlight changes.
<p/>The shareware <i>WinEDT</i> editor has a macro that will generate
<i>changebar</i> (or other) macros to show differences from an
earlier version of your file, stored in an <i>RCS</i>-controlled
repository &mdash; see
<a href="http://www.winedt.org/Macros/LaTeX/RCSdiff.php">http://www.winedt.org/Macros/LaTeX/RCSdiff.php</a>
<p/>The <i>vertbars</i> package uses the techniques of the
<i>lineno</i> package (which it loads, so the <i>lineno</i>
itself must be installed); it&rsquo;s thus the smallest of the packages for
change bar marking, since it leaves all the trickery to another
package.  <i>Vertbars</i> defines a <code>vertbar</code>
environment to create changebars.
<p/>The <i>framed</i> package is
another that provides bars as a side-effect of other desirable
functionality: its <code>leftbar</code> environment is simply a
stripped-down frame (note, though, that the environment makes a
separate paragraph of its contents, so it is best used when the
convention is to mark a whole changed paragraph.
<p/>Finally, the <i>memoir</i> class allows marginal editorial comments,
which you can obviously use to delimit areas of changed text.
<p/>An even more comprehensive way to keep track of changes is employed by
some word-processors &mdash; to produce a document that embodies both
&ldquo;old&rdquo; and &ldquo;new&rdquo; versions.
<p/>To this end, the package <i>changes</i> allows the user to manually
markup changes of text, such as additions, deletions, or replacements.
Changed text is shown in a different colour; deleted text is crossed
out.  The package allows you to define additional authors and their
associated colour; it also allows you to define a markup for authors
or annotations.  The documentation (very clearly) demonstrates how the
various functions work.
<p/>The <i>Perl</i> script <i>latexdiff</i> may also be used to
generate such markup for LaTeX documents; you feed it the two
documents, and it produces a new LaTeX document in which the
changes are very visible.  An example of the output is embedded in the
documentation,

  <a href="http://mirrors.ctan.org/support/latexdiff/latexdiff-man.pdf">latexdiff-man.pdf</a>
  (part of the distribution).
A rudimentary revision facility is provided by another
<i>Perl</i> script, <i>latexrevise</i>, which accepts or rejects
all changes.  Manual editing of the difference file can be used to 
accept or reject selected changes only.
<dl>
<dt><tt><i>backgrnd.tex</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/generic/misc/backgrnd.tex">macros/generic/misc/backgrnd.tex</a>
<dt><tt><i>changebar.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/changebar.zip">macros/latex/contrib/changebar</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/changebar/">browse the directory</a>)
<dt><tt><i>changes.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/changes.zip">macros/latex/contrib/changes</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/changes/">browse the directory</a>)
<dt><tt><i>framed.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/misc/framed.sty">macros/latex/contrib/misc/framed.sty</a>
<dt><tt><i>latexdiff, latexrevise</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/support/latexdiff.zip">support/latexdiff</a> (or <a href="http://www.tex.ac.uk/tex-archive/support/latexdiff/">browse the directory</a>)
<dt><tt><i>lineno.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/lineno.zip">macros/latex/contrib/lineno</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/lineno/">browse the directory</a>)
<dt><tt><i>memoir.cls</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/memoir.zip">macros/latex/contrib/memoir</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/memoir/">browse the directory</a>)
<dt><tt><i>vertbars.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/misc/vertbars.sty">macros/latex/contrib/misc/vertbars.sty</a>
<dt><tt><i>winedt</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/systems/win32/winedt/">systems/win32/winedt/</a>
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=changebars">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=changebars</a>
</body>