summaryrefslogtreecommitdiff
path: root/dviware/qms/vms/dotex.com
blob: 40d06b715037c5746165eeadabeaee95a4ea4ee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
$ if P1 .eqs. "" then inquire P1 "$_File"
$ if P1 .eqs. "" then exit
$ doprint = 1
$ dodelete = 1
$ copystring = ""
$ PT2 = P2
$ PT3 = P3
$ PT4 = P4
$ PT5 = P5
$nextparam:
$ if PT2 .eqs. "" then goto doneparse
$ goto 'f$extract(0,3,PT2)'
$nop:
$NOP:
$ doprint = 0
$ goto checknext
$nod:
$NOD:
$ dodelete = 0
$ goto checknext
$cop:
$COP:
$ copystring = "/"+PT2
$checknext:
$ PT2 = PT3
$ PT3 = PT4
$ PT4 = PT5
$ goto nextparam
$doneparse:
$ device   = f$parse(P1,,,"DEVICE")
$ directory= f$parse(P1,,,"DIRECTORY")
$ filename = f$parse(P1,,,"NAME")
$ filetype = f$parse(P1,".TEX",,"TYPE")
$ version  = f$parse(P1,,,"VERSION")
$ directory = f$extract(1,f$length(directory)-2,directory)
$ filespec = "''device'[''directory']''filename'''filetype'''version'"
$ message = ""
$ NumCopies = "1"
$ response = "Y"
$ if filetype .nes. ".TEX" then -
	inquire response "Is this a TeX file? (Y/N) [N]"
$ if response .nes. "Y" then goto dotex_abort
$ on control_Y then goto abort_ctrlY
$ on error then goto error_exit
$!	------------------------
$!	--- Process TeX File ---
$!	------------------------
$ if f$search("''filespec'") .eqs. "" then goto TeXfilnotfou
$ write sys$output "  executing TeX.."
$ write sys$output ""
$ assign/user_mode sys$command sys$input
$ TEX 'filespec'
$!	------------------------
$!	--- Process DVI File ---
$!	------------------------
$ if f$search("''filename'.DVI") .eqs. "" then goto DVIfilnotfou
$ write sys$output "  executing DVIQMS.."
$ assign/user_mode sys$command sys$input
$ DVIQMS 'filename''copystring'
$!	---------------------
$!	--- Print BITfile ---
$!	---------------------
$ if doprint .eq. 0 then goto normexit
$ if f$search("''filename'.BIT") .eqs. "" then goto BITfilnotfou
$ delstring = ""
$ if dodelete .ne. 0 then dodelete = "/delete"
$ write sys$output "  printing ''filename'.."
$ lasprint/notify'delstring' 'filename'.BIT
$normexit:
$ if dodelete .eq. 0 then exit
$ write sys$output -
	"  deleting temporary files.."
$!	--------------------------
$!	--- Delete Temp Files ----
$!	--------------------------
$ if f$search("''filename'.DVI") .nes. "" then -
	delete/noconfirm/nolog  'filename'.DVI;
$ if f$search("''filename'.LIS") .nes. "" then -
	delete/noconfirm/nolog  'filename'.LIS;
$ exit
$!
$abort_ctrlY:
$ message = "Control-Y termination."
$ goto dotex_abort
$error_exit:
$ message = "Error detected."
$ goto dotex_abort
$TeXfilnotfou:
$ message = "Input file ''filespec' not found."
$ goto dotex_abort
$DVIfilnotfou:
$ message = "DVI file not created."
$ goto dotex_abort
$BITfilnotfou:
$ message = "BIT file not created."
$ goto dotex_abort
$dotex_abort:
$ if f$search("''filename'.DVI") .nes. "" then -
	delete/noconfirm/log  'filename'.DVI;
$ if f$search("''filename'.LIS") .nes. "" then -
	delete/noconfirm/log  'filename'.LIS;
$ if f$search("''filename'.BIT") .nes. "" then -
	delete/noconfirm/log  'filename'.BIT;
$ write sys$output "DoTeX aborted."
$ if message .nes. "" then write sys$output message
$ exit