diff --git a/git-latexdiff b/git-latexdiff index 644c563..1e4055b 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -75,6 +75,7 @@ Options: --help this help message --main name of the main LaTeX file --no-view don't display the resulting PDF file + --latex run latex instead of pdflatex --bibtex, -b run bibtex as well as latex (pdflatex,bibtex,pdflatex,pdflatex) --biber run BibLaTex-Biber as well as latex @@ -176,6 +177,8 @@ latexdiffopt=() latexpand=() bbl=0 latexdiff_flatten=0 +latex=0 + while test $# -ne 0; do case "$1" in @@ -230,6 +233,9 @@ while test $# -ne 0; do "-b"|"--bibtex") bibtex=1 ;; + "--latex") + latex=1 + ;; "--biber") biber=1 ;; @@ -362,6 +368,12 @@ if test $flatten = 1 && flatten=0 fi +if test $latex = 1; then + LATEX_EXEC=latex +else + LATEX_EXEC=pdflatex +fi + ## end option parsing ## check_knitr () { @@ -507,7 +519,7 @@ if test "$flatten" = 1; then verbose "Attempting to regenerate missing new/$maindir$mainbase.bbl" oldPWD=$PWD cd new/"$maindir" - log_cmd pdflatex0.log pdflatex $latexopt "$mainbase" || compile_error=1 + log_cmd pdflatex0.log $LATEX_EXEC $latexopt "$mainbase" || compile_error=1 log_cmd bibtex0.log bibtex "$mainbase" || compile_error=1 cd "$oldPWD" if [ "$compile_error" = 1 ]; then @@ -565,15 +577,15 @@ else else latexopt="$latexopt -interaction=errorstopmode" fi - log_cmd pdflatex1.log pdflatex $latexopt "$mainbase" || compile_error=1 + log_cmd pdflatex1.log $LATEX_EXEC $latexopt "$mainbase" || compile_error=1 if test "$bibtex" = 1 ; then log_cmd bibtex.log bibtex "$mainbase" || compile_error=1 fi if test "$biber" = 1 ; then log_cmd biber.log biber "$mainbase" || compile_error=1 fi - log_cmd pdflatex2.log pdflatex $latexopt "$mainbase" || compile_error=1 - log_cmd pdflatex3.log pdflatex $latexopt "$mainbase" || compile_error=1 + log_cmd pdflatex2.log $LATEX_EXEC $latexopt "$mainbase" || compile_error=1 + log_cmd pdflatex3.log $LATEX_EXEC $latexopt "$mainbase" || compile_error=1 fi verbose_done @@ -583,6 +595,11 @@ if [ "$compile_error" = 1 ] && [ "$ignorelatexerrors" = 1 ]; then compile_error=0 fi +if test $latex = 1; then + dvips "$mainbase".dvi + ps2pdf "$mainbase".ps +fi + pdffile="$mainbase".pdf if test ! -r "$pdffile" ; then echo "No PDF file generated."