diff --git a/git-latexdiff b/git-latexdiff index 57d96be..b0e233d 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -137,6 +137,8 @@ Options: --quiet redirect output from subprocesses to log files --prepare run before latexdiff (e.g. run make to generate included files) + --filter run after latexdiff and before compilation + (e.g. to fix up latexdiff output) --ln-untracked symlink uncommited files from the working directory --version show git-latexdiff version. --subtree checkout the tree at and below the main file @@ -335,6 +337,10 @@ while test $# -ne 0; do shift prepare_cmd="$1" ;; + "--filter") + shift + filter_cmd="$1" + ;; "--build-dir") test $# -gt 1 && shift || die "missing argument for $1" use_build_dir=$1 @@ -736,6 +742,15 @@ else verbose_done fi +if [ ! -z "$filter_cmd" ]; then + verbose "Running filter command $filter_cmd in new/" + ( cd "new/" && log_cmd filter.log eval "$filter_cmd" ) + if [ ! -f "new/$main" ]; then + die "$filter_cmd removed new/$main." + fi + verbose_done +fi + verbose "Compiling result" compile_error=0