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?
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.
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.
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.
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.
todonotes
is another package that makes nice looking callouts. You can see a number of examples in the documentation.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With