bug-texinfo
[Top][All Lists]
Advanced

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

FYI: texi2dvi: Use hevea as if it were tex


From: Akim Demaille
Subject: FYI: texi2dvi: Use hevea as if it were tex
Date: Tue, 16 Jan 2007 11:16:14 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        Use hevea more like we use tex itself, no longer as a tool
        that does everything magically.
        * util/texi2dvi (run_hevea): Remove trailing spaces in the
        output.
        (run_tex_suite): Change to the working directory here, no longer
        in...
        (run_core_conversion): here, so that even when running hevea where
        are in the working directory.
        No longer call cd_orig, do it...
        (run_tex_suite): here.
        (run_hevea): Pass verbose flags to it when --debug.
        (run_tex_suite): Since we now want to run the whole suite of tools,
        including bibtex, with hevea, use run_core_conversion, not
        run_tex.
        (run_core_conversion): Now call run_tex.

Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.94
diff -u -u -r1.94 texi2dvi
--- util/texi2dvi 16 Jan 2007 10:01:43 -0000 1.94
+++ util/texi2dvi 16 Jan 2007 10:14:10 -0000
@@ -918,6 +918,12 @@
 # Run the TeX tools until a fix point is reached.
 run_tex_suite ()
 {
+  # Move to the working directory.
+  if $tidy; then
+    verbose "cd $work_build"
+    cd "$work_build" || exit 1
+  fi
+
   # Count the number of cycles.
   local cycle=0
 
@@ -932,7 +938,7 @@
     # converse.
     run_bibtex
     run_index
-    run_tex
+    run_core_conversion
 
     xref_files_changed || break
   done
@@ -953,6 +959,8 @@
       move_to_dest "$in_noext.$(out_lang_ext)"
       ;;
   esac
+
+  cd_orig
 }
 
 ## -------------------------------- ##
@@ -1184,8 +1192,16 @@
   run_hevea="$run_hevea `list_prefix includes -I` -I '$orig_pwd' "
   run_hevea="$run_hevea '$in_input'"
 
+  if $debug; then
+    run_hevea="$run_hevea -v -v"
+  fi
+
   verbose "running $run_hevea"
   if eval "$run_hevea" >&5; then
+    # hevea leaves trailing white spaces, this is annoying.
+    case $1 in text|info)
+      perl -pi -e 's/[ \t]+$//g' "$out_base"*;;
+    esac
     case $1 in
     html|text) move_to_dest "$out_base";;
     info) # There can be foo.info-1, foo.info-2 etc.
@@ -1199,25 +1215,17 @@
 
 # run_core_conversion ()
 # ----------------------
-# Run the TeX tools until a fix point is reached.
+# Run the TeX (or HeVeA).
 run_core_conversion ()
 {
-  # Move to the working directory.
-  if $tidy; then
-    verbose "cd $work_build"
-    cd "$work_build" || exit 1
-  fi
-
   case $in_lang:$(out_lang_tex) in
     *:dvi|*:pdf)
-       run_tex_suite;;
+       run_tex;;
     latex:html|latex:text|latex:info)
        run_hevea $out_lang;;
     *)
        error 1 "invalid input/output combination: $in_lang/$out_lang";;
   esac
-
-  cd_orig
 }
 
 
@@ -1257,7 +1265,7 @@
   run_recode
 
   # Run until a fix point is reached.
-  run_core_conversion
+  run_tex_suite
 }
 
 




reply via email to

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