edit this page - page history - about editing

A Crude Latex Diff Script in Linux

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

Categories: Article | Latex | Linux
edit this page - what links to here? - page history - top
Last edited by jevon jevon 133 months ago