Tutorial :Adding MS-Word-like comments in LaTeX

Question:

I need a way to add text comments in "Word style" to a Latex document? I don't mean to comment the "source code" of the document. What I want is a way to add corrections, suggestions, etc. to the document, so that they don't interrupt the text flow, but still easy for everyone to know, which part of the sentence they are related to. They should also "disappear" when compiling the document for printing.

At first, I thought about writing a new command, that just forward the input to \marginpar{}. And when compiling for printing just making the definition empty. The Problem is, you have no guarantee where the comments will appear and you will not be able to distinguish them from the other marginpars.

Any idea?

Solution:1

todonotes is another package that makes nice looking callouts. You can see a number of examples in the documentation.

Solution:2

Since LaTeX is a text format, if you want to show someone the differences in a way that they can use them (and cherry pick from them) use the standard diff tool (e.g., diff -u orig.tex new.tex > docdiffs). This is the best way to annotate something like LaTeX documents, and can be easily used by anyone involved in the production of a document from LaTeX sources. You can then use standard LaTeX comments in your patch to explain the changes, and they can be very easily integrated. If the document lives in a version control system of some sort, just use the VCS to generate a patch file that can be reviewed.

Solution:3

All of these take an optional parameter with the initials of the author who did this change. This results in different colours used, and these initials are displayed superscripted after the changed text.

\replaced[MI]{new text}{old text}

You can hide the change marks by giving the option final to the changes package.

This is very basic, and comments are not supported, but it might help.

Solution:4

My little home-rolled "fixme" tool uses \marginpar where possible and goes inline in places (like captions) where that is hard to arrange. This works out because I don't often use margin paragraphs for other things. This does mean you can't finalize the layout until everything is fixed, but I don't feel much pain from that...

Other than that I heartily agree with Michael about using standard tools and version control.

Solution:5

You can use the changebar package to highlight areas of text that have been affected.

If you don't want to do the markup manually (which can be tedious and interrupt the flow of editing) the neat latexdiff utility will take a diff of your document and produce a version of it with markup added to visually display the changes between the two versions in the typeset output.

This would be my preferred solution, although I haven't tested it out on large, multi-file documents.

Solution:6

Solution:7

The todonotes package looks great, but if that proves too cumbersome to use, a simple solution is just to use footnotes (e.g. in red to separate them from regular footnotes).

Solution:8

Package trackchanges.sty works exactly the way changes.sty. See @Svante's reply. It has easy to remember commands and you can change how edits will appear after compiling the document. You can also hide the edits for printing.

Solution:9

The best package I know is Easy Review that provides the commenting functionality into LaTeX environment. For example, you can use the following simple commands such as \add{NEW TEXT}, \remove{OLD TEXT}, \replace{OLD TEXT}{NEW TEXT}, \comment{TEXT}{COMMENT}, \highlight{TEXT}, and \alert{TEXT}.