home *** CD-ROM | disk | FTP | other *** search
- /* This file texify's a chunk */
- OPTIONS results
- filename = "vd0:tempfromtxed.tex"
-
- STATUS D
- directory = result
- if directory = "" then directory = ":"
-
- STATUS F
- if result ~= "" then filename = result
- if filename ~= "vd0:tempfromtexed.tex" then origfile = directory||filename
- else origfile = filename
-
- parse var filename rootname "." rest
-
- STATUS P
-
- TEXport = result
- parse var TEXport "TxEd Plus" TEXport"/c".
- TEXport = "Port"TEXport
-
- chunkfile = "ram:"rootname"_Chunk.tex"
-
-
- checkpad = open(scratchpad,chunkfile,"W")
-
- COPY X
- STATUS MX
- chunktext = result
- chunklength = length(chunktext)
-
- LEFT chunklength
- STATUS R
- lineandcol = result
- parse var lineandcol row lineno col colno
-
- chunktext = chunktext||" \bye"
- chunkwrite = writech(scratchpad,chunktext)
-
- envvarname = TEXport" vd0:"rootname"_Chunk.data"
- envvarvalue = " origfile = '"origfile"' ;"
- envvarvalue = envvarvalue||" rowno = "lineno" ; "
- envvarvalue = envvarvalue||" colno = "colno"; "
-
- y = setenv(envvarname,envvarvalue)
-
- call close(scratchpad)
-
- call CheckForTeX()
- if ~showlist('p','TeX:dvistream') then call CheckForPreview() call StopTex()
- call StopTex()
-
-
- address 'AmigaTeX'
- 'TeXify' chunkfile /* send the 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
-
-