views:

1841

answers:

5

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?

+3  A: 

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.

Michael Trausch
Unfortunately, this will not work. For me, as a programmer, it’s not a problem to start a program from the command line do something and check in. But it will be for the other editors of my book very hard to get rid of all the familiar convenience in Word and start command line hacking.
Mouk
You could always include a set of shell scripts and batch files that automate it for them...
Michael Trausch
+3  A: 

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.

See also:

and a self-plug:

dmckee
@J.F.: Why? General "kill the adjectives" editing practice? Or something more specific?
dmckee
Wait...was that a self referential joke?!? If so, it's very funny, and I'm slow...
dmckee
s/hardily/heartily/
Noah
+1  A: 

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.

Will Robertson
latexdiff works fine on large documents: I've used it with several clients and it's been no problem. It falls over with mutlipart docs - in the bad old days I used to convert these into a single file just to get latexdiff to work. The whole of the problem was that it inserts \usepackage directives into the preamble, making latex fall over - and so the new texdiff package solves the problem by leaving package inclusions and macro definitions to the user.
Charles Stewart
+12  A: 

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

godbyk
Awesome! Exactly what I was looking for.
Mouk
+2  A: 

I have used changes.sty, which gives basic change colouring:

\added{new text}
\deleted{old text}
\replaced{new text}{old text}

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.

Svante
Nice package, I'd forgotten about it. It supports comments in the source via a second optional argument to those commands. I suspect they end up in the \listofcomments.
Will Robertson
Although not exactly what I was looking for, I will be using this package too for sure. Very nice.
Mouk