The following patch adds thumbpdf support to texi2dvi. I have not
made it optional (--thumb), since anyway if the author of the document
has added thumbpdf.sty to the document, she is certainly willing to
have them. Sure, it is adding a significant delay to the whole
process (running thumbpdf means running gs, plus an additional tex
pass), but PDF is not, I think, the right format for draft: DVI is.
There is something strongly unpleasant in this patch: code
duplication. That's because I observed the texi2dvi convention that
shell functions are not portable. I believe it is absolutely safe for
Texinfo to drop this obsolete requirement. I'll refactor with a great
please if there's a go for shell functions.
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
* util/texi2dvi: Add thumbpdf support.
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 10:51:35 -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 <[EMAIL PROTECTED]>,
general questions and discussion to <[EMAIL PROTECTED]>.
@@ -444,6 +444,7 @@
else
tex=${PDFLATEX:-pdflatex}
fi
+ thumbpdf=${THUMBPDF:-thumbpdf}
;;
*)
@@ -481,6 +482,7 @@
# As long as we had to run TeX, offer the user this convenience:
test "$txiformat" = Texinfo && escape=@
fi
+ thumbpdf=${THUMBPDF:-thumbpdf}
;;
esac
@@ -646,7 +648,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
_______________________________________________
Bug-texinfo mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-texinfo