home *** CD-ROM | disk | FTP | other *** search
- /* This file texify's its argument */
- OPTIONS results
-
- filename = "tempfromtxed.tex"
-
- STATUS F
-
- if result ~= "" then filename = result
- dev = ""
- subdir = ""
-
- STATUS D
-
- directory = result
- if directory = "" then directory = ":"
- else parse var directory dev ":" subdir
- if subdir = "" then directory = dev":"
- else directory = dev":"subdir"/"
-
- address command "c:copy "directory||filename "to ram:"filename"_backup"
- working_directory = directory
-
- call CheckForFile()
- call CheckForTex()
- if ~showlist('p','TeX:dvistream') then call CheckForPreview()
- call StopTex()
-
-
- address 'AmigaTeX'
- 'TeXify' working_directory||filename /* send the current file */
-
- exit
-
- CheckForTex: /* Check to see if Tex is up */
- if ~showlist('P','AmigaTeX') then do
- WINDOW 0 0 screencols()-10 screenrows() - 80
- constring = "newwsh con:0/"screenrows()-79"/"screencols()-10"/79/'TeXWindow' CMD rexx:startup_tex.rexx"
- interpret address COMMAND '"'constring'"'
-
- do until showlist('p','AmigaTeX')
- address COMMAND 'c:WaitForPort "AmigaTeX"'
- /* give things time to get going */
- end
- end
- return 0
-
- CheckForPreview: /* Check for previewer being up if TeX is up */
- if ~showlist('P','TeX:dvistream') then address command runwsh preview
- do until showlist('p','TeX:dvistream')
- address COMMAND 'c:WaitForPort "TeX:dvistream"'
- /* give things time to get going */
- end
- return 0
-
- StopTex:
-
- do istop=1 to 50
- address 'AmigaTeX' 'Abort'
- if RC=0 then leave istop /* If it is doing something stop it */
- end
-
- return 0
-
- CheckForFile:
- answer = OKAY
-
- if directory ~= "vd0:" then do
- question = "Do you want to work from vd0: or the original disk ?"
- answer = request(100,100,question,,"vd0:","original dir",)
- end
-
- if answer = OKAY then do
-
- working_directory = "vd0:"
- SAVeas working_directory||filename
- end
- else SAVeas directory||filename
- return
-