One of your papers was reviewed and you were asked to mark changes in a different color? No problem! Use this method to easily mark everything you changed in your LaTeX document since your submitted the original paper. Also applicable to non-science use cases.
- get the difference between two commits (which you want to compare) of the tex file and save the output
git diff <old-commit> <new-commit> -- path/to/file.tex > changes.diff- Modified and added lines will be marked using the following script
python3 latex_diff_mark_changes.py- Include the diff in the LaTeX document
\documentclass{article}
\usepackage[draft]{changes} % Use 'draft' to show changes
\begin{document}
\input{formatted_changes.tex}
\end{document}