Skip to content

Instantly share code, notes, and snippets.

@gwpl
Created May 10, 2017 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwpl/ef4b21532081abcab4b1ecd02635d02e to your computer and use it in GitHub Desktop.
Save gwpl/ef4b21532081abcab4b1ecd02635d02e to your computer and use it in GitHub Desktop.
git-latexdiff # how to configure latexdiff in git
#!/bin/bash
# http://tex.stackexchange.com/a/1417/7128
TMPDIR=$(mktemp -d /tmp/git-latexdiff.XXXXXX)
latexdiff "$1" "$2" > $TMPDIR/diff.tex
pdflatex -interaction nonstopmode -output-directory $TMPDIR $TMPDIR/diff.tex
okular $TMPDIR/diff.pdf
rm -rf $TMPDIR
# Add to ~/.gitconfig
# [difftool.latex]
# cmd = git-latexdiff "$LOCAL" "$REMOTE"
# [difftool]
# prompt = false
# [alias]
# ldiff = difftool -t latex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment