Articles > Latex

Here’s a quick and crude script to create a diff .tex file in Linux between two Latex revisions. It will highlight new and changed pargraphs in red, and ignore the removed ones. Make sure you use \usepackage{color}.

$ diff [original].tex [latest].tex -u | 
sed 's/^+\([^+%\].\+\)/+\\textcolor{red}{\1}/g' | 
patch -u [original].tex -o [output].tex