Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding MS-Word-like comments in LaTeX

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 that would still make it 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 would just forward the input to \marginpar{}, and when compiling for printing would just make 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?

like image 795
Mouk Avatar asked Mar 05 '09 17:03

Mouk


People also ask

Can you add comments in LaTeX?

In LaTeX, you can use the % (percent sign) to comment out a line of text in your source code. If you'd like to include comments that appear in the PDF of your project, you can use the todonotes package.

Can you add comments in Overleaf?

Commenting: feature overviewThe Comment feature is available in all Overleaf accounts, free and paid, and this article shows how to use it. To read about Overleaf's Track Changes features, available to paid accounts, you can find further information in the article Track Changes in Overleaf.

How do I comment out a line in LaTeX?

It is often necessary to comment out temporarily a region of TeX or LaTeX code. This can be done with the commands C-c ; and C-c % . C-c ; will comment out all lines in the current region, while C-c % will comment out the current paragraph.

How do I comment a section in LaTeX?

in TeXnicCenter you can select a block of text and then use Ctrl+Q to comment it out. The inverse operation is done with Ctrl+W.


2 Answers

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

like image 149
godbyk Avatar answered Oct 18 '22 12:10

godbyk


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.

like image 45
Michael Trausch Avatar answered Oct 18 '22 13:10

Michael Trausch