[comp.lang.rexx] TxEd+ ARexx Macros

mwood@ut-emx.UUCP (Matt A. Wood) (11/21/89)

TxEd+ Users:

Here's some ARexx macros that will run AmigaTeX for you, starting it
and the previewer if need be.  They're hacked versions of those that
showed up here recently.  There's a couple other macros thrown in, too;
it's a mixed bag.  For completeness, I've included the s:StartTeX 
script I use, and my Startup.TxEd file.   I've just tagged everything
onto the end, here.  I don't know how to pack them with sh, and don't
have time to learn for one post.

Modify as you like.  If you've got anything that's generally useful, post.

Cheers,

Matt A. Wood
Astronomy Dept, University of Texas, Austin TX 78712  
matt@astro.UTEXAS.EDU.				(Internet)


NOTE:  search for 'cut line' for the file separation lines.


/*  This file texify's its argument */
/*  First, add the support library if needed */

msg 'TeXify this puppy!'

check = addlib('rexxsupport.library',0,-30,0) 

/*  Now save data from TxEd */
write

/*  Now put in Rockiki's TeX macro */

options failat 5
options results
filename = ""
'STatus F'
filename = result
if showlist('Ports','AmigaTeX')=0 then do
   address command "newwsh from s:StartTex"
   do i = 1 to 10
      if showlist('Ports','AmigaTeX') ~=0 then leave i
      address command 'wait 5'
   end
   if showlist('Ports','AmigaTeX')=0 then exit
end
address 'AmigaTeX'
do i = 1 to 10
   'Abort'
   if RC=0 then leave i 
   address command 'Wait 5'
end
'TeXify' filename
exit      
----------------------------- cut line ------------------------------------
echo StartTex:  you may want to delete this line, too.
stack 20000
preview
wait 2
tex -R
wait 1
----------------------------- cut line ------------------------------------
/* ToError:  Determine the error location that TeX is Sending */
options failat 5
address 'AmigaTeX' 'ErrorLoc'
errorloc = getclip('AmigaTeX.ErrorLoc')
if errorloc = "" then exit
else parse var errorloc filename linenum charpos
address 'TxEd1' "msg Jump to "||linenum||charpos
address 'TxEd1' "JU "||linenum||charpos

exit

----------------------------- cut line ------------------------------------
/*  ISpell:  This file runs ISpell on its argument */
/*  First, add the support library if needed */
check = addlib('rexxsupport.library',0,-30,0) 

/*  Now save data from TxEd and write message */
write

options failat 5
options results
filename = ""
'STatus F'
filename = result
address 'TxEd1' "msg ISpell "||filename||" . . ."
address COMMAND "c:ispell "||filename

exit      
----------------------------- cut line ------------------------------------
/* Join:  AREXX macro for TxEd to Join lines at ^J command,
          inserting a space b/n */

join
INSERT '" "'
----------------------------- cut line ------------------------------------
/*  Startup.txed:  M. Wood's Preferences for TxEd Plus  */

ARC 1
RM 73
'WRAP 1'

'Macro H ''BS'''	/* call me old-fashioned */
'Macro 1 ''WRITE'''
'Macro 2 ''QUIT'''
'Macro 3 ''Redisplay'''
'Macro W ''DWord'''
'Macro L ''DLine'''
'Macro E ''DEOL'''
'Macro X ''DChar''' 
'Macro J join.txed'

'MENU clear 4 4'
'menu clear 4 4'
'menu clear 4 8'
'menu clear 5 0'
'MENU 5 1 TeXify'
'MENU 5 2 ToError'
'Menu 5 3 TeX_Diss'
'Menu 5 5 ISpell'
'MENU 5 6 SetToggle'
'MENU 5 7 GetToggle'
'MENU 5 8 Toggle'
'MENU 5 9 Colcut'
'MENU 5 0 ColPaste'
'MENU 5 - MatchBrak'
'MENU 5 = CenterLine'
-- 
Matt A. Wood				matt@astro.as.utexas.edu
Astronomy Department			(512) 471-4419
The Univeristy of Texas 
Austin, TX  78712-1083