home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / text / tex / 13449 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  6.5 KB

  1. Path: sparky!uunet!usc!news.service.uci.edu!unogate!mvb.saic.com!info-tex
  2. From: "George D. Greenwade" <bed_gdg@SHSU.edu>
  3. Newsgroups: comp.text.tex
  4. Subject: RE: TeX in batch mode
  5. Message-ID: <009640BE.414986E0.14469@SHSU.edu>
  6. Date: Mon, 23 Nov 1992 13:47:16 CST
  7. Organization: Info-Tex<==>Comp.Text.Tex Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 118
  10.  
  11. In <By036B.E6H@news.cso.uiuc.edu> (comp.text.tex, Fri, 20 Nov 1992 05:56:34
  12. GMT), cameron@symcom.math.uiuc.edu (Cameron Smith) asked:
  13. > Another request for help.
  14. >
  15. > One of the goals of a project I'm helping out with is to allow a computer
  16. > program to generate nicely formatted reports in response to remote
  17. > requests.  For this we are planning to have the program generate TeX code
  18. > as its output, then spawn a subprocess to run TeX to do the formatting,
  19. > then convert the resultant DVI file to an appropriate other form and send
  20. > that to the remote user for printing.  This means that we need to run TeX
  21. > in batch mode, under the supervision of another program, which needs at a
  22. > minimum to be able to detect whether a TeX run completed successfully so
  23. > that it will know whether it can go on to the next step and try to deliver
  24. > a document to the user.  This itself is apparently a non-trivial
  25. > proposition, since even a warning telling me that a page is 2pt overfull
  26. > causes TeX to deliver an "error" return code, even though an "error" like
  27. > that is acceptable for our purposes. I envision (with distaste) building a
  28. > parser that reads through a log file after a TeX run to decide whether
  29. > errors so serious that they preclude printing have occurred.
  30. >
  31. > This is very different from the way I've used TeX in the past, and because
  32. > my experience with this mode is so limited my question is quite general (I
  33. > don't know enough yet to ask anything specific!). I would simply like to
  34. > hear any pointers, tips, suggestions, warnings, and the like from anybody
  35. > who has tried this kind of thing.  I'd like to hear from you regardless of
  36. > whether you did or did not succeed in getting the results you wanted
  37. > (perhaps *especially* if you didn't, since if this is impractical to the
  38. > point of unfeasibility I'd prefer to find out now rather than after I've
  39. > spent six months on it).
  40. >
  41. > Email would be OK, but I'd rather read postings since that way everyone can
  42. > join in and either learn from or teach one another. Thanks in advance for
  43. > any info.
  44.  
  45. Given some of the terminology here ("spawn a subprocess", in particular), I
  46. assume that this for VMS.  There are two dimensions here.  First,
  47. processing the file as a spawned subprocess.  When writing the file, do NOT
  48. include the \batchmode statement so *you* can play with the file, if
  49. necessary, without further editing (which helps with version limits to see
  50. just what did happen).  
  51.  
  52. Simply spawn the process out, such as I have done in a brief (but handy)
  53. VMS command file I have named BATEX.COM (and define BATEX as a foreign
  54. symbol BATEX :== @device:[directory]BATEX.COM, then you can use BATEX
  55. filename to LaTeX the file in the subprocess; obviously for TeX, change the
  56. "LATEX" strings to "TEX" and name the new file BTEX.COM or whatever).  This
  57. file follows my signature (and I have used it for years under three
  58. versions of TeX and more than a few versions of LaTeX, so if there are bugs
  59. I am blissfully unaware of them).  This dimension is easy and obvious (but
  60. I thought all weekend about posting this DCL command file, so now I have a
  61. good reason 8-)).
  62.  
  63. The second dimension --- catching errors --- is not quite as
  64. straightforward (although it is probably much more system independent). 
  65. After looking at this problem in designing my menu-based TeX publishing
  66. system similar to All-in-1 (yet to be posted; if anyone is interested I
  67. might can make it available, but it's pretty site dependent), I noticed one
  68. very nice fact.  Just about the only time you see the characters "l." in
  69. columns 1 and 2 of the listing file, they are related to a failure (telling
  70. you the line number).  If you use the listing file from your job and search
  71. for occurrences of "l." in columns 1 and 2 and don't find them, there
  72. probably aren't any problems.  Indeed, from my PUBLISH.COM ('pub_document'
  73. is assigned to the DCL symbol associated with the filename sans extension):
  74. $!.....
  75. $ LATEX 'pub_document'
  76. $ set mess/nofac/nosev/notex/noid
  77. $ search 'pub_document'.lis "l." /out=sys$login:runtime.err
  78. $ if $status .ne. 1
  79. $   then delete/noconfirm/nolog sys$login:runtime.err.
  80. $        set mess/fac/sev/tex/id
  81. $        return
  82. $   endif
  83. $ set mess/nofac/nosev/notex/noid
  84. $ open/read start_file sys$login:runtime.err
  85. $ read start_file start_line
  86. $!.....
  87. $ close start_file
  88. $!.....
  89. and make some evaluations on the start_line symbol to isolate the exact
  90. line with the problem.
  91.  
  92. While this doesn't give the exact way to achieve what you might be wanting
  93. to do, these are a few of the tricks under VMS I have learned to live with.
  94.  
  95. Regards and good luck,   George
  96. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  97. George D. Greenwade, Ph.D.                            Bitnet:  BED_GDG@SHSU
  98. Department of Economics and Business Analysis         THEnet: SHSU::BED_GDG
  99. College of Business Administration                    Voice: (409) 294-1266
  100. P. O. Box 2118                                        FAX:   (409) 294-3612
  101. Sam Houston State University              Internet:        bed_gdg@SHSU.edu
  102. Huntsville, TX 77341                      bed_gdg%SHSU.decnet@relay.the.net
  103. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  104. $!! Program Name            : BATEX.COM
  105. $!!   Original Author       : BED_GDG
  106. $!!   Date                  : 23-NOV-1988
  107. $!!   Program Description   : Spawn out a subprocess to run LaTeX
  108. $!!                         : 
  109. $START:
  110. $ SUB_NAME = "BATEX_''F$EXTRACT(21,2,F$TIME())'"
  111. $ WO := WRITE SYS$OUTPUT
  112. $ WO " "
  113. $ WO "BaTeX -- LaTeX processing in an interactive batch environment."
  114. $ WO "  This program creates an attached sub-process to process LaTeX files."
  115. $ WO "  The attached sub-process environment is transparent to the user,"
  116. $ WO "  allowing full use of the terminal while LaTeX processing occurs."
  117. $ WO " "
  118. $ WO "  When processing is complete, you will be notified with the message:"
  119. $ WO "                   Subprocess ''SUB_NAME' has completed."
  120. $ID_FILE:
  121. $ WO " "
  122. $ IF P1 .EQS. "" THEN READ SYS$COMMAND/PROMPT= -
  123.  "What is the name of the file for LaTeX processing? " TEXNAME
  124. $ IF P1 .NES. "" THEN TEXNAME := 'P1'
  125. $ IF TEXNAME .EQS. "" THEN GOTO ID_FILE
  126. $ SPAWN/NOWAIT/NOLOG/NOTIFY/INPUT=NL:/PROCESS="''SUB_NAME'" -
  127.  /OUTPUT='sub_name'_JUNK.OUT LATEX 'TEXNAME'
  128. $ EXIT
  129.