home *** CD-ROM | disk | FTP | other *** search
/ Dream 45 / Amiga_Dream_45.iso / Amiga / Magazine / Dossier-LaTeX / AmiWeb2C.lha / source / web2c-6.1 / web2c / mpware / makempx.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-06  |  2KB  |  67 lines

  1. /*
  2.  * This AREXX script simulates the UNIX-/bin/sh script of the same name.
  3.  */
  4.  
  5. Options FailAt 21 /* Handle all error levels in this script */
  6.  
  7. /* Pragma('Directory','.') *//* You should have Martin Scott's `UnixDirsII' */
  8.  
  9. /*
  10.  * MPLIB is where newer, mptotex, and dvitomp are installed.
  11.  */
  12. MPLIB = "TeXMF:bin/web2c61"
  13. DOTEX = "virtex"
  14.  
  15. /*****************************************************
  16.  * Everything below here should seldom need changing *
  17.  *****************************************************/
  18. ERRLOG = "mpxerr.log" /* file for an error log if necessary */
  19. TEXERR = "mpxerr.tex" /* file for erroneous TeX file if any */
  20. DVIERR = "mpxerr.dvi" /* troublesome dvi file if any */
  21.  
  22. Parse Arg MPFILE MPXFILE . /* input and output files */
  23.  
  24. MPX = "mpx" || time(seconds) /* Simulate `$$' = task number */
  25. NL = '0A'X /* `new line' character */
  26.  
  27. Address Command "delete force quiet >NIL:" MPX || ".#?" ERRLOG TEXERR DVIERR
  28.  
  29. Address Command MPLIB || "/newer" MPFILE MPXFILE
  30.  
  31. If 0 = RC Then Do /* 0 = TRUE in UNIX */
  32.  
  33.    Address Command MPLIB || "/mptotex" MPFILE ">" MPX || ".tex -E" || ERRLOG
  34.  
  35.    If 0 ~= RC Then Do
  36.       Say NL || "Command failed:" MPLIB || "/mptotex" MPFILE
  37.       Address Command "type" ERRLOG
  38.       Address Command "delete force quiet" MPX || ".tex"
  39.       Exit 1
  40.    End
  41.  
  42.    Address Command DOTEX "\batchmode \input" MPX "> NIL:"
  43.  
  44.    If 0 ~= RC Then Do
  45.       Address Command "copy" MPX || ".tex" TEXERR
  46.       Address Command "copy" MPX || ".log" ERRLOG
  47.       Say NL || "Command failed:" DOTEX TEXERR NL || "See" ERRLOG
  48.       Address Command "delete force quiet" MPX || ".#?"
  49.       Exit 2
  50.    End
  51.  
  52.    Address Command MPLIB || "/dvitomp" MPX || ".dvi" MPXFILE ">" ERRLOG
  53.  
  54.    If 0 ~= RC Then Do
  55.       Address Command "copy" MPX || ".dvi" DVIERR
  56.       Say NL || "Command failed:" MPLIB || "/dvitomp" DVIERR
  57.       Address Command "type" ERRLOG
  58.       Address Command "delete force quiet" MPX || ".#?"
  59.       Exit 3
  60.    End
  61.  
  62.    Address Command "delete force quiet" MPX || ".#?" ERRLOG
  63.  
  64. End
  65.  
  66. Exit 0
  67.