Reviewers frequently request some clarifications which we add in the text. Journals frequently require to submit two versions of the revised manuscript, with changes highlighted (in red) and with changes but for production, so no highlighting.

I wonder if I can somehow add a switch to the document so when I compile it, say with the switch to "on", I get the changes in red, and when the switch is off, the changes are there, but not highlighted red.

Is it possible?

  • FWIW, in ConTeXt such conditional typesetting is achieved using Modes
    – Aditya
    Jun 9, 2013 at 15:15
  • I thin you can use with the package changes. Jun 9, 2013 at 16:33
  • Can you point me out to an example of how changes is used?
    – TMOTTM
    Jun 9, 2013 at 16:58
  • @TMOTTM: Did it. Hope it helps. Jun 9, 2013 at 17:01
  • Have you considered using latexdiff?
    – Daniel
    Jun 9, 2013 at 21:09

3 Answers 3


I want to suggest the package changes. It's very powerful.



This is some filling text. 

This is more filling text with a \replaced[id=TT, ]{bad}{nice} font



enter image description here

This is the draft version. The package offers the possibility to add also a list of changes. Instead of replacing you can also add material by \added.

If you want to print the final version you can simply add the option final to the package.


This is some filling text. 

This is more filling text with a \replaced[id=TT, ]{bad}{nice} font


Now the result is:

enter image description here

  • You can also use \deleted{...} to remove sections.
    – airdas
    Aug 17, 2021 at 14:49

One option might be to import the document into LyX and edit it there. LyX has a built-in change tracking system. I have used it quite a bit for paper reworking and editors and shepherds where always pleased by the diff view it produces:

PDF with change tracking

This PDF output can be generated by a simple switch in the LyX GUI. (The default is to compile the final document without the highlighting of changes.)

The changes are also visualized inside the editor and over multiple authors, which is pretty useful if collaborating on a paper.

Lyx with change tracking

  • This might be useful but I want to accomplish something different. I want to be able to compile the document in two slightly different ways, depending on a switch. I want to be able to highlight all track changes with one command. Manually doing that is very inconvenient, because there are usually many.
    – TMOTTM
    Jun 9, 2013 at 14:26
  • @TMOTTM: That's perfectly possible with LyX. I have clarified this in my anser.
    – Daniel
    Jun 9, 2013 at 21:08

Latexdiff is a great solution for your problem: https://www.overleaf.com/learn/latex/Articles/Using_Latexdiff_For_Marking_Changes_To_Tex_Documents

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .