13.1 ⁑Change Markup
There are many entries listed on the editorial topic that allow you to mark changes in a document. Some of these are for LaTeX2.09, Plain TeX, ConTeXt or LuaTeX, but even discounting these, there are still too many to describe, so I'm just going to describe the changes package [44], which is available on both TeX Live and MiKTeX. The changes package provides a way for the user to manually markup changes, such as additions, deletions or replacements.
The changes package provides an anonymous author that's used by default, but if you want to track the changes according to a particular author, you need to define each tracked author using:
where ⟨options⟩ is a key=value list of options and ⟨id⟩ is a label identifying the author. Available options:
name
- The author's name.
color
- The colour to use when marking up this author's changes. (Defaults to black.)
Example:
To markup changes you can use:
to indicate that ⟨text⟩ has been added,
to indicate that ⟨text⟩ has been deleted, and
to indicate that ⟨old text⟩ has been replaced by ⟨new text⟩. Each of these commands has an optional argument that's a key=value list where the following keys are available:
id
- The author's ID (as
provided in
\definechangesauthor
). remark
- A remark about the change.
You can create a list or summary of the changes using
The optional argument is again a key=value list, but there is
currently only one key available: style
,
which may have the value list
or summary
. The
default value is list
. As with commands such as
\tableofcontents
and \listoffigures
, this command
requires two LaTeX runs to produce the list. The default extension
for the summary of changes file is .soc, but this can be changed using
You can suppress the change markup using the
final
package option:
\usepackage[final]{changes}
The draft
option enables the markup.
The other package options are ⟨key⟩=⟨value⟩
options, where the following keys are available:
markup
=⟨value⟩ sets the markup style. The ⟨value⟩ may be one of:default
- Colour markup for added text, strike out
for deleted text.
underlined
- Added text is underlined, deleted text
is struck out.
bfit
- Bold for added text and italic for deleted
text.
nocolor
- As
underlined
but without colour.
addedmarkup
=⟨value⟩ anddeletedmarkup
=⟨value⟩ set the markup style for added and deleted text. The ⟨value⟩ may be one of:none
- No markup.
uline
- Underlined text ().
uuline
- Double underlined text ().
uwave
- Wavy underlined text ().
dashuline
- Dashed underlined text ().
dotuline
- Dotted underlined text ().
sout
- Struck out text ().
xout
- Crossed out text ().
bf
- Bold text.
it
- Italic text.
sl
- Slanted text.
em
- Emphasized text.
authormarkup
=⟨value⟩ sets the style of the author identification. The ⟨value⟩ may be one of:superscript
- Superscript author's name or ID.
subscript
- Subscript author's name or ID.
brackets
- Author's name or ID in parentheses.
footnote
- Author's name or ID in a footnote.
none
- No author identification.
authormarkupposition
=⟨value⟩ sets which side of the change to place the author's ID. The ⟨value⟩ may beright
orleft
.authormarkuptext
=⟨value⟩ sets whether to use the author's ID or name in the change markup. The ⟨value⟩ may be eitherid
(default) orname
.
The changes package automatically loads the
ulem [2] and xcolor packages. You can pass
options to these packages using the ulem
and
xcolor
keys. For example
The changes package also provides
\textsubscript{⟨text⟩}
which is analogous to LaTeX's \textsuperscript
kernel command.
This example document has been edited by three authors: Mabel Canary, Fred Canary and Prof Important Person:
\documentclass[12pt]{article} \usepackage[ulem={normalem,normalbf}]{changes} \definechangesauthor[name={Mabel Canary},color=violet]{MC} \definechangesauthor[name={Fred Canary},color=blue]{FC} \definechangesauthor[name={Prof Important Person},color=teal]{IP} \begin{document} \section{About the Lab} The Secret Lab of Experimental Stuff is a \replaced[id=MC]{top-secret}{sinister} laboratory whose existence is highly classified so don't tell anyone about it \added[id=FC]{or we'll get really cross with you}. The \added[id=IP]{world-renown} University of Somewhere denies all knowledge of the Secret Lab of Experimental Stuff, except on Open Days where members of the public may visit the facility and ask questions as long as they consent to a memory wipe when they leave. The memory wipe is \deleted[id=MC,remark={no it isn't}]{completely} harmless and your memory of the visit will be replaced by a \added[id=MC]{pleasant} recollection of spending the day feeding the \replaced[id=FC,remark={what geese?}]{ducks}{geese} \added[id=MC,remark={they're the weird-looking ducks}]{and geese} in the nearby pond. \end{document}
The changes are colour-coded according to the author who made the edit. Any remarks are added as footnotes, as shown in Figure 13.1. You can download or view this example.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).