home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR4
/
TEXMAC.ZIP
/
TEX.SPM
< prev
Wrap
Text File
|
1991-11-22
|
11KB
|
334 lines
; NOTES:
;Find TeX errors macros
; written by Hal Varian on CServe Borapp forum, modified by RDT 3/21/91
; start in TeX file, hit ^B to start. Macro prompts you for log file
; name and sets up screen. Then hit ^G to go to each error in turn
; wanna add loose and tight lines over and underfull boxes
BeginLog :
; 4 set Q0 flist "*.log" ;present menu of log files
; set Q0 fchange "%.LOG" cdstrip fname
set Q0 flist "%.LOG"
if length Q0 ; if it exists
(2->windows ;create 2 windows
r winswitch ;switch to top window
if !(buffind Q0) ;if already open, get reread by BigDos
open Q0 ;open the chosen log file
r toend ;go to start of log file
f winswitch ;go back to TeX file
r toend) ;go to start of TeX file
; ought also to write macro to find underfull and overful hboxes
; for loose and tight lines. Or change these to do both errors and ...
FindError :
(2 search "l.[0-9]+" ;search for line of error
dline scroll ;scroll this line to top of screen
f c c ;move forward two characters
copy (past (2 match "[0-9]+")) Q1 ;read line number into Q1
draw) ;redraw the screen
; tosol 1->select toeol draw 0->select ; humm
GoToError : atoi Q1 -> line ;convert Q1 to number and go to that line
HiliteLine :
(toeol set themark ;go to end of line and set the mark
1->select ;turn on reverse video
tosol draw ;go to start of line and redraw the screen
0->select ;turn reverse video off
0 wait draw) ;wait for keystroke and redraw the screen
GetError :
(r winswitch ;switch to the log file
FindError ;find the error
f winswitch ;switch back to the TeX file
GoToError ;go to the error line
HiliteLine) ;hilite the line containing error
; be nice to add under/overfull hbox search
; 3/21/91, Macros by RDT to assist invoking Tex programs from Sprint menus
; how bout a flag 1/0 for TEX status ?
SetCompose : ; stuff TEx compose line into QI slot
set QD ""
6 GetQIStr message "\nCompose: " set QD 6 SetQIStr
SetDVI : ; stuff DVI print input into QI slot
7 GetQIStr message "\nDVI Print: " set QD 7 SetQIStr
SetPreview : ; stuff preview input into QI slot
8 GetQIStr message "\nPreview: " set QD 8 SetQIStr
GetPreview : ; stuff preview input into QI slot
8 GetQIStr ;message "\nPreview: " set QD 8 SetQIStr
Compose : ; Format a DVI file
if record KeyRecordEnd ; allow graceful keyrecord endings if 16 used for call
SetCurrentDir ; go to directory of current file, uses QD
; This keeps .log file in job file's dir.
; SetCompose ; returns tex command line in QD
if NeedSave FileSave
set Q0 fname ; cdstrip fname
0 QSlash ; which presents file name in Tex legal format
; 0 QStripExt ; remove extension
SetOvlModf ; save the damn variables
; 1+8+ BigDos call QD " " Q0 ; QD is either Tex or Latex, run restart after
1+8+ BigDos call "tex " Q0
; gotta go back to previous dir from Restart macro
Dvi2Print : ; output DVI file to printer
if record KeyRecordEnd ; allow graceful keyrecord endings if 16 used for call
SetCurrentDir ; go to directory of current file, uses QD, this keeps .err files with job
set q0 fchange "%.DVI" fname
0 QLow ; lowercases for peculiarity of dvi2tty, at least in 4dos
1 GetQINum -> PrintDest
if PrintDest = 3 (4 GetQIStr $ call "capture nb nt " QD) ; queue redirected output
SetDVI ; puts dvi output command in QD and saves it
SetOvlModf ; save the damn variables
1+8+ BigDos call QD " " Q0 ; runs Restart with 8 to get current dir reset
TTY : ; preview DVI file to DVI2TTY to home pview.tty file
set q0 fchange "%.DVI" cdstrip fname
0 QLow ; lowercases for peculiarity of dvi2tty, at least in 4dos
4 QTMP ; create temp file in home dir in Q4
GetPreview ; puts TTY command in QD and saves it
1 call QD " -o" Q4 Q0
open "" read Q4
r toend
DVideo : ; preview DVI file with DVideo
set q0 fchange "%.DVI" cdstrip fname
SetOvlModf ; save the damn variables
8+BigDos call "dvideo -x.5in -y.5in " Q0
; overlaid on top of my base sprint macros
TexDVIMenu : ; 1->InTex here? for restart or pbreak use?
menu "TeX Output Menu" {
"Compose" Compose,
"Print" Dvi2Print,
"DVideo View" Dvideo,
"Quick View" SetPreview TTY,
"_",
"Start Error Search" BeginLog GetError,
"Next Error" GetError
}
;============================================================
; This is a menu system for inserting common LaTex composition commands
; and for running LaTex, the previewer, and the printer from within
; SPRINT
; modified from HCH contribution to Borapp forum by RDT, 3/23/91
;Put region into a \begin{Q0} ... \end{Q0} pair
EnvEntry :
if select
markregion{
insert "^J\\begin{" insert Q0 insert "}^J"
swapmark
insert "^J\\end{" insert Q0 insert "}^J^J"
unselect
}
else {
tosol
insert "^J\\begin{" insert Q0 insert "}^J^J"
insert "\\end{" insert Q0 insert "}^J^J"
3 up
}
;takes Q0, forms \Q0{region}
ComEntry : ; Q0 has the command
if (!select)(setmark)
markregion{
insert"\\"
insert Q0
'{' insert
swapmark
'}' insert
swapmark
}
if select Unselect
else (r c )
;takes Q0, forms {\Q0 region}
ScopeEntry : ; Q0 has the command
if (! select)(setmark)
markregion{
insert"{"
insert Q0
swapmark
insert QD
swapmark
}
if select Unselect
else (r length QD repeat (r c) ) ; get back past length of QD
ListsMenu :
menu "List Environments" {
"Centering" insert "\\centering\n",
"N-Center" set Q0 "center" EnvEntry,
"Description" set Q0 "description" EnvEntry,
"Enumerate" set Q0 "enumerate" EnvEntry,
"Itemize" set Q0 "itemize" EnvEntry,
"X-item" insert "\n\\item ",
"Letter" set Q0 "letter}{ " EnvEntry,
"Figure" set Q0 "figure" EnvEntry,
"Table" set Q0 "table" EnvEntry,
"_",
"Other"message "\nOther Env: " set Q0 EnvEntry
}
FontSizeMenu :
set QD "}"
menu "Font Size" {
"1--Scriptsize" set Q0 "\\scriptsize " ScopeEntry,
"2--Footnotesize" set Q0 "\\footnotesize " ScopeEntry,
"3--Small" set Q0 "\\small " ScopeEntry,
"4--Normalsize" set Q0 "\\normalsize " ScopeEntry,
"5--large" set Q0 "\\large " ScopeEntry,
"6--Large" set Q0 "\\Large " ScopeEntry,
"7--LARGE" set Q0 "\\LARGE " ScopeEntry,
"8--huge" set Q0 "\\huge " ScopeEntry
}
FontMenu :
set QD "}"
menu "Font Commands" {
"BoldFace" set Q0 "\\bf " ScopeEntry,
"Caps" set Q0 "\\sc " ScopeEntry,
"Emphasized" set Q0 "\\em " set QD "\\/}" ScopeEntry,
"Italics" set Q0 "\\it " set QD "\\/}" ScopeEntry,
"San Serif" set Q0 "\\sf " ScopeEntry,
"Typewriter" set Q0 "\\tt " ScopeEntry,
"_",
"Magnitude" fontsizemenu
}
BreaksMenu :
menu "Break Commands" {
"Linebreak" insert "\\\\[]^J" ,
"Pagebreak" insert "\\newpage^J",
"Hspace" insert "\\hspace{}" r c,
"Spring" insert "\\hfill ",
"Verticalspace" insert "\\vspace{}" r c
}
TexUtilitiesmenu :
menu "Utility Commands" {
"Array" set Q0 "array" EnvEntry,
"Curlybraces" set Q0 "" set QD "}" ScopeEntry,
"Equation" set Q0 "equation" EnvEntry,
"Displaymath" set Q0 "displaymath" EnvEntry,
"_",
"Newblock" insert "\\newblock ",
"O nocite" set Q0 "nocite" ComEntry,
"I cite" set Q0 "cite" ComEntry,
"T Bibitem" set Q0 "bibitem" ComEntry
}
Articlesetup :
insert "\\documentstyle[12pt]{article}\n"
insert "\\setcounter{secnumdepth}{0}\n"
insert "\\begin{document}\n"
insert "\\end{document}"
Lettersetup :
insert "\\documentstyle[12pt]{letter}\n"
insert "\\begin{document}\n"
insert "\\end{document}"
Overallmenu :
menu "Global Forms" {
"Article" Articlesetup,
"Letter" Lettersetup
; , "Memo" memosetup,
; "Officeletter" officelettersetup,
; "Homeletter" homelettersetup
}
Sectionsmenu :
menu "Sectioning Commands"{
"Section" set Q0 "section" ComEntry,
"Usubsection" set Q0 "subsection" ComEntry,
"Bsubsubsection" set Q0 "subsubsection" ComEntry,
"Paragraph" set Q0 "paragraph" ComEntry,
"_",
"Other" message "\nOther: " set Q0 ComEntry
}
TexFormatMenu :
menu "TeX Format Menu"{
"Lists" listsmenu,
"Font" fontmenu,
"Overall" overallmenu,
"Utilities" texutilitiesmenu,
"Sections" Sectionsmenu,
"Gaps" breaksmenu
}
articleentry:
collectionentry:
misComEntry:
bookentry:
Bibliographymenu :
menu "Bibliography Entry Types"{
"Article" articleentry,
"Book" bookentry,
"Incollection" collectionentry,
"Misc" misComEntry
}
bookentry :
mark{
insert "@Book{,^J"
insert " author = { },^J"
insert " editor = { },^J"
insert " title = { },^J"
insert " publisher = { },^J"
insert " year = { },^J"
insert " address = { },^J"
insert " edition = { }^J"
insert "}^J^J"
}
10 up toeol r c
articleentry :
insert "@article{,^J"
insert " author = { },^J"
insert " title = { },^J"
insert " journal = { },^J"
insert " year = { },^J"
insert " volume = { },^J"
insert " number = { },^J"
insert " pages = { }^J"
insert "}^J^J"
10 up toeol r c
collectionentry :
insert "@incollection{,^J"
insert " author = { },^J"
insert " title = { },^J"
insert " booktitle = { },^J"
insert " publisher = { },^J"
insert " editor = { },^J"
insert " chapter = { },^J"
insert " pages = { },^J"
insert " year = { },^J"
insert " address = { },^J"
insert " edition = { }^J"
insert "}^J^J"
13 up toeol r c
misComEntry :
insert "@misc{ ,^J"
insert " author = { },^J"
insert " title = { },^J"
insert " howpublished = { },^J"
insert " year = { }^J"
insert "}^J^J"