CommunityData:LaTex Diff

From CommunityData
Revision as of 14:57, 26 April 2022 by Jdfoote (talk | contribs) (Created page with "== The Scenario == You've been given an R+R. Congrats! Often, it's either helpful or required to submit a version of your paper that shows what changed from the original vers...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Scenario

You've been given an R+R. Congrats! Often, it's either helpful or required to submit a version of your paper that shows what changed from the original version.

latexdiff

Fortunately, there is a tool designed for just this: latexdiff.

You will need the original version of the .tex file. If needed, you can checkout the git commit that you made when you created the original submitted version. Or, if using Overleaf, use the history to go back to that version.

If you are using knitr, then you will need to create the .tex file from the .Rtex file.

Save this .tex file as orig.tex.

Now, go back to the current version of the manuscript (e.g., by checking out the main branch in git). If your current file is called new.tex, then create the diff file with:

latexdiff orig.tex new.tex > diff.tex

Finally, you create the PDF of the diff with:

latexmk -f -pdf diff.tex