# Compile PDFLATEX document with and without track changes

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 '13 at 15:15
I thin you can use with the package changes. – Marco Daniel Jun 9 '13 at 16:33
Can you point me out to an example of how changes is used? – TMOTTM Jun 9 '13 at 16:58
@TMOTTM: Did it. Hope it helps. – Marco Daniel Jun 9 '13 at 17:01
Have you considered using latexdiff? – Daniel Jun 9 '13 at 21:09

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

Example

\documentclass{article}
\usepackage[authormarkup=superscript,]{changes}
\definechangesauthor[name={TMOTTM},color=red]{TT}

\begin{document}
This is some filling text.

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

\end{document}


Result:

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.

\documentclass{article}
\usepackage[authormarkup=superscript,final]{changes}
\definechangesauthor[name={TMOTTM},color=red]{TT}

\begin{document}
This is some filling text.

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

\end{document}


Now the result is:

-

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:

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.

-
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 '13 at 14:26
@TMOTTM: That's perfectly possible with LyX. I have clarified this in my anser. – Daniel Jun 9 '13 at 21:08