bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: texi2dvi: thumbpdf support


From: Akim Demaille
Subject: Re: texi2dvi: thumbpdf support
Date: Mon, 30 Jun 2003 14:12:13 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Doh!  I sent a patch against a version that I thought was the current
texi2dvi, but was not.  It was relying on the definition of fd 6,
which is not defined in that texi2dvi.  So an updated patch is the
following.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * util/texi2dvi: Add thumbpdf support.
        Use FD 6 instead of /dev/null so that when --debugging, the output
        from auxiliary tools can be observed.

Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.23
diff -u -u -r1.23 texi2dvi
--- util/texi2dvi 10 Jun 2003 20:50:03 -0000 1.23
+++ util/texi2dvi 30 Jun 2003 12:08:13 -0000
@@ -68,10 +68,10 @@
   -t, --command=CMD    insert CMD in copy of input file;
    or --texinfo=CMD    multiple values accumulate
 
-The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO, TEX
-(or PDFTEX), and TEXINDEX environment variables are used to run those
-commands, if they are set.  Any CMD strings are added after @setfilename
-for Texinfo input, in the first line for LaTeX input.
+The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
+TEX (or PDFTEX), TEXINDEX, and THUMBPDF environment variables are used
+to run those commands, if they are set.  Any CMD strings are added
+after @setfilename for Texinfo input, in the first line for LaTeX input.
 
 Email bug reports to <address@hidden>,
 general questions and discussion to <address@hidden>.
@@ -307,7 +307,12 @@
 fi
 
 # Enable tracing
-test "$debug" = t && set -x
+if test "$debug" = t; then
+  exec 6>&1
+  set -x
+else
+  exec 6>/dev/null
+fi
 
 # 
 # TeXify files.
@@ -317,7 +322,7 @@
 
   # If the COMMAND_LINE_FILENAME is not absolute (e.g., --debug.tex),
   # prepend `./' in order to avoid that the tools take it as an option.
-  echo "$command_line_filename" | $EGREP '^(/|[A-z]:/)' >/dev/null \
+  echo "$command_line_filename" | $EGREP '^(/|[A-z]:/)' >&6 \
   || command_line_filename="./$command_line_filename"
 
   # See if the file exists.  If it doesn't we're in trouble since, even
@@ -423,7 +428,7 @@
   # Otherwise, guess from the file extension.
   if test -n "$set_language"; then
     language=$set_language
-  elif sed 1q "$command_line_filename" | grep 'input texinfo' >/dev/null; then
+  elif sed 1q "$command_line_filename" | grep 'input texinfo' >&6; then
     language=texinfo
   else
     language=
@@ -444,6 +449,7 @@
       else
         tex=${PDFLATEX:-pdflatex}
       fi
+      thumbpdf=${THUMBPDF:-thumbpdf}
       ;;
 
     *)
@@ -481,6 +487,7 @@
         # As long as we had to run TeX, offer the user this convenience:
         test "$txiformat" = Texinfo && escape=@
       fi
+      thumbpdf=${THUMBPDF:-thumbpdf}
       ;;
   esac
 
@@ -560,7 +567,7 @@
            && grep '^\\bibstyle[{]' "$filename_noext.aux" \
            && (grep 'Warning:.*Citation.*undefined' "$filename_noext.log" \
                || grep 'No file .*\.bbl\.' "$filename_noext.log")) \
-          >/dev/null 2>&1; \
+          >&6 2>&1; \
     then
       $verbose "Running $bibtex $filename_noext ..."
       if $bibtex "$filename_noext" >&5; then :; else
@@ -613,7 +620,7 @@
     # subdirs, since texi2dvi does not try to compare xref files in
     # subdirs.  Performing xref files test is still good since LaTeX
     # does not report changes in xref files.
-    if grep "Rerun to get" "$filename_noext.log" >/dev/null 2>&1; then
+    if grep "Rerun to get" "$filename_noext.log" >&6 2>&1; then
       finished=
     fi
 
@@ -646,7 +653,29 @@
 
     # If finished, exit the loop, else rerun the loop.
     test -n "$finished" && break
-  done
+  done # while :;
+
+  # If we were using thumbpdf and producing PDF, then run thumbpdf
+  # and TeX one last time.
+  if test $oformat = pdf \
+     && test -r "$filename_noext.log" \
+     && grep 'thumbpdf\.sty'  "$filename_noext.log" >&6 2>&1; \
+  then
+    $verbose "Running $thumbpdf $filename_noext ..."
+    if $thumbpdf "$filename_noext" >&5; then :; else
+      echo "$0: $thumbpdf exited with bad status, quitting." >&2
+      exit 1
+    fi
+    $verbose "Running $cmd ..."
+    if $cmd >&5; then :; else
+      echo "$0: $tex exited with bad status, quitting." >&2
+      echo "$0: see $filename_noext.log for errors." >&2
+      test "$clean" = t \
+       && cp "$filename_noext.log" "$orig_pwd"
+      exit 1
+    fi
+  fi
+
 
   # If we were in clean mode, compilation was in a tmp directory.
   # Copy the DVI (or PDF) file into the directory where the compilation




reply via email to

[Prev in Thread] Current Thread [Next in Thread]