forked from GuillermoHan97/SJTUThesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.bat
63 lines (55 loc) · 1.1 KB
/
compile.bat
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
@echo off
chcp 65001 >nul
set flag=%1
if %flag%x == x (
set flag=thesis
)
if %flag%x == thesisx (
call :cleanall
call :thesis
if ERRORLEVEL 1 (
echo Error! Please check the 'thesis.log' for more details...
pause
) else (
call :clean
echo Finished!
)
goto :EOF
)
if %flag%x == cleanx (
call :clean
goto :EOF
)
if %flag%x == cleanallx (
call :cleanall
goto :EOF
)
:help
echo This is the compile batch script for SJTUThesis.
echo Usage:
echo compile.bat [option]
echo options:
echo thesis Compile the thesis (default)
echo clean Clean all work files
echo cleanall Clean all work files and thesis.pdf
echo help Print this help message
goto :EOF
:thesis
echo Compile...
latexmk -xelatex -halt-on-error -silent thesis >nul 2>nul
goto :EOF
:clean
echo Clean files...
latexmk -c -silent 2>nul
del tex\*.aux >nul 2>nul
goto :EOF
:cleanall
echo Clean files...
latexmk -C -silent 2>nul
del tex\*.aux >nul 2>nul
if exist thesis.pdf (
echo Close the file: thesis.pdf!
pause
call :cleanall
)
goto :EOF