summaryrefslogtreecommitdiff
path: root/support/mnu/texbat.bat
blob: df850b4946d3c73414feb8362380017cc0443c86 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
rem ... The "subroutine batch" called from TEXSET.BAT
rem ................................. running menu:
:menu
%RAM%\mnu %RAM%\cfg.mnu %RAM%\envir.bat %RAM%\dos.bat %RAM%\mfbat.bat
call %RAM%\envir
rem ................................. chose process:
if errorlevel 255 goto syserr
if errorlevel 235 goto spell
if errorlevel 233 goto EXview
if errorlevel 232 goto EXtex
if errorlevel 231 goto EXedit
if errorlevel 169 goto load
if errorlevel 168 goto save
if errorlevel 151 goto parmf
if errorlevel 141 goto cstocs
if errorlevel 131 goto others
if errorlevel 125 goto dosbat
if errorlevel 124 goto archive
if errorlevel  52 goto metafont
if errorlevel  41 goto prints
if errorlevel  38 goto usercom
if errorlevel  36 goto tie
if errorlevel  34 goto specEd
if errorlevel  33 goto view
if errorlevel  32 goto TeX
if errorlevel  31 goto edit
if errorlevel  29 goto quit
if errorlevel  27 goto editor
if errorlevel  26 goto shell
if errorlevel  24 goto clear
goto quit
rem ................................. running Edit -> TeX -> View:
:edit
  %EDIT% %WORK%.tex %EDITPAR%
  set EDITPAR=
  set MNU=32
  goto menu
:TeX
  set MNU=33
  call %RAM%\texrun %MAIN% tex
  goto menu
:View
  %TEXDIR%\dvidrv dviscr @scr.cnf %SCROPT% %MAIN%
  set MNU=31
  goto menu
:specEd
  %EDIT% %MARK%
  set MNU=32
  goto menu
:editor
  %EDIT% %F3FILE%
  goto menu
rem ................................. Experiment:
:EXedit
  %EDIT% %MAIN%.try %EDITPAR%
  set EDITPAR=
  set MNU=232
  goto menu
:EXtex
  set MNU=233
  call %RAM%\texrun %MAIN% try
  goto menu
:exView
  %TEXDIR%\dvidrv dviscr @scr.cnf %SCROPT% %MAIN%
  set MNU=231
  goto menu
rem ................................. others bats:
:prints
  call %TEXDIRCFG%\prints
  goto menu
:others
  call %TEXDIRCFG%\others
  goto menu
:metafont
  if not exist %TEXDIRCFG%\metafont.bat goto sorry
  call %TEXDIRCFG%\metafont
  goto menu
rem ................................. correction of document:
:spell
  if not exist %TEXDIR%\cstug\velky.%MARK% goto sorry
  if %MARK%==ces set MARK=C
  if %MARK%==slv set MARK=S
  if %MARK%==ang set MARK=A
  %TEXDIR%\cstug\texspell %WORK%.tex =%MARK% %SPELLOPT%
  set MNU=32
  goto menu
:tie
  %TEXDIR%\vlnka %WORK%.tex
  set MNU=32
  goto menu
:usercom
  %COMSPEC% /c %USERCOM%
  goto menu
:cstocs
  if errorlevel 141 set MARK=-i1 -o0
  if errorlevel 142 set MARK=-i0 -o1
  if errorlevel 143 set MARK=-i2 -o0
  if errorlevel 144 set MARK=-i0 -o2
  if errorlevel 145 set MARK=-i1 -o2
  if errorlevel 146 set MARK=-i2 -o1
  echo CSTOCS %MARK% %WORK%.tex
  %TEXDIR%\cstocs %MARK% %WORK%.tex
  if errorlevel 1 %COMSPEC% /c pause
  set MNU=31
  goto menu
rem ................................. Special functions:
:dosbat
  set MNU=25
  @echo on
  @call %RAM%\dos
  @echo off
  goto menu
:clear
  if not %MAIN%==%WORK% echo delete %WORK%.bak
  if not %MAIN%==%WORK% del %WORK%.bak
  echo delete %MAIN%.bak %MAIN%.log %MAIN%.dvi %MAIN%.aux %MAIN%.lq %MAIN%.hp %MAIN%.fx
  for %%f in (bak log dvi aux lq hp fx) do del %MAIN%.%%f
  goto menu
:shell
  echo Quit the shell to return to TEX-MENU-SYSTEM.
  %SHELL%
  goto menu
:parmf
  set MNU=152
  goto menu
:save
  set > %RAM%\file.mnu
  echo echo **** CONFIGURATION from file %MARK%.bat **** > %MARK%.bat
  dupcent %RAM%\file.mnu set >> %MARK%.bat
  echo set MNU=31 >> %MARK%.bat
  del %RAM%\file.mnu
  set mnu=65
  goto menu
:load
  set MNU=66
  call %MARK%
  goto menu
rem ................................. Sorry
:sorry
  %RAM%\mnu %TEXDIRCFG%\sorry.mnu
  goto menu
rem ................................. Diskette:
:archive
  if %AR%==from goto fromdisc
  echo copy %D%:%MAIN%.tex
  copy %D%:%MAIN%.tex
  if not %WORK%==%MAIN% echo copy %D%:%WORK%.tex
  if not %WORK%==%MAIN% copy %D%:%WORK%.tex
  set MNU=31
  goto menu
:fromdisc
  echo copy %MAIN%.tex %D%:
  copy %MAIN%.tex %D%:
  if not %MAIN%==%WORK% echo copy %WORK%.tex %D%:
  if not %MAIN%==%WORK% copy %WORK%.tex %D%:
  set MNU=31
  goto menu
rem ................................. Final:
:syserr
  echo SORRY - Error in configuration of TeX system.
  echo Please ask the system engineer to solve this problem.
:quit
  %KBD% %TEXDIR%\kbd /u
  %LASTCOM%