Browse Source

New option --ignore-latex-errors

This option causes git-latexdiff to be permissive about errors generated
by running LaTeX on the difference file, so long as a PDF file is
produced.  I have found this to be necessary for documents with complex
math markup and that use the `amsmath` package.  The difference file
tends to generate many "Multiple \label's" errors, although these are
harmless and do not affect the output PDF file.
master
William Henney 11 years ago
parent
commit
f39dc483a0
  1. 15
      git-latexdiff

15
git-latexdiff

@ -95,6 +95,8 @@ Options:
--subtree checkout the tree at and below the main file --subtree checkout the tree at and below the main file
(enabled by default, disable with --whole-tree) (enabled by default, disable with --whole-tree)
--whole-tree checkout the whole tree (contrast with --subtree) --whole-tree checkout the whole tree (contrast with --subtree)
--ignore-latex-errors keep on going even if latex gives errors, so long as
a PDF file is produced
--ignore-makefile ignore the Makefile, build as though it doesn't exist --ignore-makefile ignore the Makefile, build as though it doesn't exist
-* other options are passed directly to latexdiff -* other options are passed directly to latexdiff
--bbl shortcut to flatten a bbl file of the same name as the project --bbl shortcut to flatten a bbl file of the same name as the project
@ -150,6 +152,7 @@ uselatexmk=
latexopt= latexopt=
ln_untracked=0 ln_untracked=0
quiet=0 quiet=0
ignorelatexerrors=0
latexdiffopt=() latexdiffopt=()
latexpand=() latexpand=()
workingdir=() workingdir=()
@ -179,6 +182,9 @@ while test $# -ne 0; do
"--no-cleanup") "--no-cleanup")
cleanup=none cleanup=none
;; ;;
"--ignore-latex-errors")
ignorelatexerrors=1
;;
"--cleanup") "--cleanup")
shift shift
case "$1" in case "$1" in
@ -505,7 +511,9 @@ if test -f Makefile && test "$ignoremake" != 1 ; then
elif test "$uselatexmk" = 1; then elif test "$uselatexmk" = 1; then
log_cmd latexmk.log latexmk -f -pdf -silent "$mainbase" || compile_error=1 log_cmd latexmk.log latexmk -f -pdf -silent "$mainbase" || compile_error=1
else else
if [ "$quiet" = 1 ]; then
if [ "$ignorelatexerrors" = 1 ]; then
latexopt="$latexopt -interaction=batchmode"
elif [ "$quiet" = 1 ]; then
latexopt="$latexopt -interaction=nonstopmode" latexopt="$latexopt -interaction=nonstopmode"
else else
latexopt="$latexopt -interaction=errorstopmode" latexopt="$latexopt -interaction=errorstopmode"
@ -523,6 +531,11 @@ fi
verbose_done verbose_done
if [ "$compile_error" = 1 ] && [ "$ignorelatexerrors" = 1 ]; then
echo "LaTeX errors were found - but attempting to carry on."
compile_error=0
fi
pdffile="$mainbase".pdf pdffile="$mainbase".pdf
if test ! -r "$pdffile" ; then if test ! -r "$pdffile" ; then
echo "No PDF file generated." echo "No PDF file generated."

Loading…
Cancel
Save