summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/thuthesis/example/msmake.cmd
blob: 7bc188678a8714cc041e2cff90b726273a43b107 (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
@rem -*- mode: conf; encoding: chinese-gbk-dos; -*-
@rem ----------------------------------------------------------------------
@rem START OF FILE
@rem ----------------------------------------------------------------------
@rem 
@rem Filename: msmake.cmd
@rem Author: Fred Qi
@rem Created: 2006-05-20 14:09:57(+0800)
@rem Version: 
@rem 
@rem ----------------------------------------------------------------------
@rem COMMENTARY
@rem ----------------------------------------------------------------------
@rem
@rem ʹÓÃ˵Ã÷£º
@rem
@rem 1.ÅäÖÃthuthesisºê°ü
@rem msmake setup
@rem ¡¡¡¡ÔÚµ±Ç°Ä¿Â¼ÏÂÉú³Éthuthesisºê°ü¼°ËµÃ÷Îĵµthuthesis.pdf
@rem
@rem 2.Éú³ÉʾÀýÎĵµ
@rem msmake [shuji|main|all|other]
@rem ¡¡¡¡ÔÚµ±Ç°Ä¿Â¼ÏÂÉú³ÉʾÀýÎĵµ£¬»òÆäÖеÄÒ»²¿·Ö£¬»òÆäËûÓû§Ö¸¶¨Îĵµ
@rem Èç¹ûµ±Ç°Ä¿Â¼ÏÂÎÞthuthesis.cls£¬½«×Ô¶¯¸ù¾Ýthuthesis.insÉú³É¡£
@rem ¡¡¡¡- shuji	½öÉú³ÉÊé¼¹
@rem ¡¡¡¡- main		½öÉú³Émain.pdf
@rem ¡¡¡¡- all		Éú³ÉÊé¼¹ºÍmain.pdf£¬Ä¬ÈÏÑ¡Ïî
@rem ¡¡¡¡- other	Óû§Ö¸¶¨µÄtexÎļþÃû£¬ÓɸÃtexÎļþ²úÉúpdfÎĵµ
@rem
@rem 3.ÇåÀíĿ¼
@rem msmake clean [other]
@rem ¡¡¡¡ÇåÀíµ±Ç°Ä¿Â¼ÏÂÓÉthuthesisºê°üÉú³ÉµÄÎļþ£¬¾ßÌå°üÀ¨
@rem ºê°ü¼°Æä˵Ã÷Îĵµthuthesis.{cls,cfg,dvi,ps,pdf}
@rem ʾÀýÎĵµshuji.pdf, main.{dvi,ps,pdf,aux,etc.}
@rem Èç¹ûÓû§Ö¸¶¨ÆäËûÎļþÃû£¬²»É¾³ýmain.*£¬¶øɾ³ý
@rem other.{dvi,ps,pdf,lo?,aux,bbl,blg,out* toc thm}
@rem
@rem 4.¸¨ÖúͼÐÎͼÏñÎļþ¸ñʽת»»ÃüÁ
@rem msmake epspdf [param] 
@rem	 ½«µ±Ç°Ä¿Â¼ÏÂËùÓÐepsÎļþÓÃepstopdfתΪpdf¸ñʽ
@rem msmake bmpeps [param]
@rem	 ½«µ±Ç°Ä¿Â¼ÏÂËùÓÐbmp,jpg,pngÎļþÓÃbmepsתΪeps¸ñʽ
@rem ÒÔÉÏÁ½¸öÃüÁîÖУ¬[param]¿ÉÒÔÓÉÓû§Ö¸¶¨×ª»»³ÌÐòËùÓõIJÎÊý¡£
@rem 
@rem ----------------------------------------------------------------------
@rem CHANGE LOG
@rem ----------------------------------------------------------------------
@rem Last-Updated: 2006-05-26 11:47:40(+0800) [by Fred Qi@lab]
@rem     Update #: 312
@rem ----------------------------------------------------------------------
@rem 2006-05-20 16:53:38(+0800)    Fred Qi@lab
@rem    msmake.cmd initial. prepaired for thuthesis 2.5
@rem 
@rem 
@rem 
@rem ----------------------------------------------------------------------
@rem ----------------------------------------------------------------------

@echo off
set thupkg=thuthesis
set tmpfile=_clstemptest_
set ltxparam=-quiet -c-style-errors
if /i {%1}=={clean} goto clean
if /i {%1}=={epspdf} goto epspdf
if /i {%1}=={bmpeps} goto bmpeps
if /i {%1}=={setup} goto setup
goto testcls
:clean
@rem =============================================
@rem Çå³ýÎĵµÉú³É¹ý³ÌÖвúÉúµÄÁÙʱÎļþ
@rem =============================================
echo ɾ³ýthuthesisºê°üÏà¹ØÎļþ
del /f /q %thupkg%.cls %thupkg%.cfg 
echo ɾ³ýthuthesisºê°üµÄ˵Ã÷Îĵµ
del /f /q %thupkg%.dvi %thupkg%.ps %thupkg%.pdf
echo ɾ³ýshuji.pdf
del /f /q shuji.pdf shuji.ps shuji.dvi
echo ɾ³ýʾÀýÎĵµmain.pdf¼°Éú³É¸ÃÎĵµ¹ý³ÌÖвúÉúµÄÎļþ
if {%2}=={} (set targ=main) else (set targ=%2)
del /f %targ%.dvi %targ%.ps %targ%.pdf
del /f %targ%.lo? %targ%.aux %targ%.bbl %targ%.blg
del /f %targ%.out* %targ%.toc %targ%.thm
del /f data\*.aux
echo ɾ³ýÆäËüÁÙʱÎļþ
del /f /q *.log *.aux *.glo *.idx *.ilg *.ind *.out *.thm *.toc *.lot *.loe *.out.bak
goto end
@rem =============================================
@rem ½«µ±Ç°Ä¿Â¼ÏµÄepsÎļþת»»Îªpdf¸ñʽ
@rem ÐèÒªÓõ½epstopdf
@rem =============================================
:epspdf
if /i {%2}=={} (
  set conv=call epstopdf %%i
) else (
  set conv=call epstopdf %2 %%i
)
@echo on
for %%i in (*.eps) do %conv%
@echo off
goto end
@rem =============================================
@rem ½«µ±Ç°Ä¿Â¼ÏµÄbmp,jpg,pngͼÐÎת»»Îªeps¸ñʽ
@rem ÐèÒªÓõ½bmeps
@rem =============================================
:bmpeps
if /i {%2}=={} (set param=-c) else (set param=%2)
set conv=call bmeps %param% %%i %%~ni.eps
@echo on
for %%i in (*.bmp *.jpg *.png) do %conv%
@echo off
goto end
:testcls
@rem =============================================
echo ÕýÔÚ²âÊÔÊÇ·ñÐèÒªÉú³Éthuthesisºê°ü...
@rem =============================================
if not exist %thupkg%.cls goto presetup
if not exist %thupkg%.cfg goto presetup
goto choose
@rem -----------------------------
@rem this section of code is NOT used.
echo \documentclass{%thupkg%}>%tmpfile%.tex
echo \begin{document}>>%tmpfile%.tex
echo \end{document}>>%tmpfile%.tex
call latex %ltxparam% %tmpfile%.tex>nul
IF ERRORLEVEL 1 (goto presetup) else goto choose
@rem NOT used code block end.
@rem -----------------------------
:presetup
@rem del /f /q %tmpfile%.*
echo ÄúûÓа²×°»òÅäÖúÃthuthesisºê°ü£¬
echo ±¾³ÌÐòÊÔͼÖØÐÂÉú³É²¢ÅäÖÃthuthesisºê°ü...
:setup
@rem =============================================
@rem Éú³Éthuthesisºê°ü¼°ËµÃ÷Îĵµ
@rem =============================================
if not exist %thupkg%.ins goto clserr4
if exist %thupkg%.cls del /f /q %thupkg%.cls
if exist %thupkg%.cfg del /f /q %thupkg%.cfg
echo ÕýÔÚÉú³É%thupkg%ºê°ü...
call latex %ltxparam% %thupkg%.ins
@rem IF errorlevel 1 goto clserr3
echo ³É¹¦Éú³Éthuthesisºê°ü
@rem ----------------------------------------------
if not exist %thupkg%.dtx goto clserr2
echo ÕýÔÚÉú³É%thupkg%ºê°üµÄ˵Ã÷Îĵµ...
call latex %ltxparam% %thupkg%.dtx
if errorlevel 1 goto clserr1
call makeindex -s gind.ist -o %thupkg%.ind %thupkg%.idx
if errorlevel 1 goto clserr1
call makeindex -s gglo.ist -o %thupkg%.gls %thupkg%.glo
if errorlevel 1 goto clserr1
call latex %ltxparam% %thupkg%.dtx
if errorlevel 1 goto clserr1
call gbk2uni %thupkg%.out
if errorlevel 1 goto clserr1
call latex %ltxparam% %thupkg%.dtx
if errorlevel 1 goto clserr1
call dvips -Ppdf -G0 %thupkg%.dvi
if errorlevel 1 goto clserr1
call ps2pdf %thupkg%.ps
if errorlevel 1 goto clserr1
echo ³É¹¦Éú³Éthuthesis˵Ã÷Îĵµthuthesis.pdf
@rem ÇåÀí˵Ã÷ÎĵµÉú³É¹ý³ÌÖвúÉúµÄÁÙʱÎļþ
del /f /q %thupkg%.log
del /f /q %thupkg%.aux
del /f /q %thupkg%.glo
del /f /q %thupkg%.gls
del /f /q %thupkg%.idx
del /f /q %thupkg%.out
del /f /q %thupkg%.out.bak
del /f /q %thupkg%.ind
del /f /q %thupkg%.ilg
del /f /q %thupkg%.toc
@rem del /f /q %thupkg%.dvi
@rem del /f /q %thupkg%.ps
goto choose
@rem ----------------------------------------------
:clserr2
echo ûÓÐÕÒµ½thuthesis.dtxÎļþ
:clserr1
echo ÎÞ·¨Éú³É˵Ã÷Îĵµthuthesis.pdf
goto end
:clserr4
echo ûÓÐÕÒµ½thuthesis.insÎļþ
:clserr3
echo ÎÞ·¨Éú³Éthuthesisºê°ü
goto end
:choose
if /i {%1}=={setup} goto end
set ltx=latex %ltxparam%
if /i {%1}=={shuji} goto shuji
if /i {%1}=={main} goto main
if /i {%1}=={all} goto all
if /i {%1}=={} (goto all) else goto other
:dvips
@rem =============================================
@rem ʹÓÃlatex->dvips->ps2pdfÉú³ÉʾÀýÎĵµmain.pdf
@rem =============================================
:other
set targ=%2
goto latex
:all
:shuji
set targ=shuji
set errmsg=pdflatex
call pdflatex shuji.tex
if errorlevel 1 goto error
@rem set errmsg=dvipdfmx
@rem dvipdfmx shuji.dvi
@rem if errorlevel 1 goto error
del /f /q %targ%.aux
del /f /q %targ%.log
del /f /q %targ%.out
del /f /q %targ%.thm
@rem del /f /q %targ%.dvi
if /i {%1}=={shuji} goto end
:main
set targ=main
goto latex
:pdf
@rem =============================================
@rem ʹÓÃpdflatexÉú³ÉʾÀýÎĵµmain.pdf
@rem =============================================
@echo δʵÏֵŦÄÜ¡£
goto end
:latex
@rem =============================================
@rem Éú³ÉʾÀýÎĵµ
@rem =============================================
set errmsg=%ltx%
call %ltx% %targ%
if errorlevel 1 goto error
set errmsg=bibtex
call bibtex -quiet %targ%
if errorlevel 1 goto error
set errmsg=latex
call %ltx% %targ%
if errorlevel 1 goto error
set errmsg=gbk2uni
call gbk2uni %targ%
if errorlevel 1 goto error
set errmsg=latex
call %ltx% %targ%
if errorlevel 1 goto error
if {%1}=={pdf} goto end
set errmsg=dvips
call dvips -Ppdf -G0 -ta4 %targ%.dvi
if errorlevel 1 goto error
set errmsg=ps2pdf
call ps2pdf %targ%.ps
if errorlevel 1 goto error
goto end
@rem =============================================
@rem ʾÀýÎļþÉú³É¹ý³ÌÖгö´í´¦Àí
@rem =============================================
:error
echo ʹÓÃ%errmsg%Éú³É%targ%.pdfµÄ¹ý³ÌÖгö´í
:end
@rem =============================================
@rem Ö´ÐнáÊø
@rem =============================================
@rem ----------------------------------------------------------------------
@rem END OF FILE
@rem ----------------------------------------------------------------------