[tex-live] %&latex and metapost using TL 2003

Olaf Weber olaf at infovore.xs4all.nl
Sat May 29 14:18:36 CEST 2004


Olaf Weber writes:

> We probably ought to do is change 'makempx' to get the %& line out and
> use the command it finds there.  Something like this might do:

And now for the correct patch, which includes giving sed a file to
work on.

Index: /home/olaf/web2c/src/texk/texk/web2c/mpware/makempx.in
===================================================================
RCS file: /usr/local/cvsroot/texk/texk/web2c/mpware/makempx.in,v
retrieving revision 1.12
retrieving revision 1.14
diff -u -r1.12 -r1.14
--- a//home/olaf/web2c/src/texk/texk/web2c/mpware/makempx.in	16 Apr 2004 09:51:42 -0000	1.12
+++ b//home/olaf/web2c/src/texk/texk/web2c/mpware/makempx.in	29 May 2004 12:13:51 -0000	1.14
@@ -1,11 +1,11 @@
 #!/bin/sh
-# '$Id: makempx.in,v 1.12 2004/04/16 09:51:42 olaf Exp $'
+# '$Id: makempx.in,v 1.14 2004/05/29 12:13:51 olaf Exp $'
 # Make an MPX file from the labels in a MetaPost source file,
 # using mpto and either dvitomp (TeX) or dmp (troff).
 # From John Hobby's original (though there's not much of it left by now).
 # Public domain.
 
-rcs_revision='$Revision: 1.12 $'
+rcs_revision='$Revision: 1.14 $'
 version=`set - $rcs_revision; echo $2`
 
 : ${DMP=dmp}
@@ -15,7 +15,6 @@
 : ${MPTOTEX='mpto -tex'}
 : ${MPTOTR='mpto -troff'}
 : ${NEWER=newer}
-: ${TEX='tex --parse-first-line'}
 : ${TROFF='eqn -Tpost -d\$\$ | troff -Tpost'}
 
 # convert relative path to absolute in $MAKEMPX_BINDIR:
@@ -125,6 +124,10 @@
       mv mpx$$.tmp mpx$$.tex
     fi
 
+    test -z "$TEX" && \
+      TEX=`sed -n '1s/%\&[ 	]*\([^ 	
]*\).*$/\1 --parse-first-line/p;q' mpx$$.tex`
+    test -z "$TEX" && TEX='tex --parse-first-line'
+
     if $TEX --interaction=batchmode mpx$$.tex </dev/null >/dev/null; then
       WHATEVER_TO_MPX="$DVITOMP"
       INFILE=mpx$$.dvi


> The sed expression does the following: Check if the first line starts
> with %& and matches %&<whitespace>NAME<...>, in which case we set TEX
> to 'NAME --parse-first-line' (there might be more options that we
> didn't copy out).

> If TEX is still empty after that, use the default value.

> makempx.c will have to be updated as well.  :-(

-- 
Olaf Weber

               (This space left blank for technical reasons.)



More information about the tex-live mailing list