forked from mohuangrui/ucasthesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Compile.bat
executable file
·50 lines (50 loc) · 1.87 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
@rem ******************************************
@rem *** Batch scripts for latex on windows ***
@rem ******************************************
@echo off
@rem ******************************************
@rem ********* Set target compiler ************
@rem ******************************************
set CompilerOrder="2"
@rem ******************************************
if %CompilerOrder% == "1" (
set CompileName="pdflatex"
) else (
set CompileName="xelatex"
)
@rem ******************************************
@rem ****** Get filename in batch for loop ****
@rem ******************************************
for %%F in (*.tex) do (
set FileName=%%~nF
)
@rem ******************************************
@rem ** Create Tmp dir for aux and log files *
@rem ******************************************
if not exist "./Tmp" (
md Tmp
)
@rem ******************************************
@rem *** Include subdirs to compile path ******
@rem ******************************************
set TEXINPUTS=.//;%TEXINPUTS%
set BIBINPUTS=.//;%BIBINPUTS%
set BSTINPUTS=.//;%BSTINPUTS%
@rem ******************************************
@rem ******** Compile target file ***********
@rem ******************************************
%CompileName% -output-directory=Tmp %FileName%
@rem ******************************************
@rem * if use bibtex, need following commands *
@rem ******************************************
bibtex ./Tmp/%FileName%
%CompileName% -output-directory=Tmp %FileName%
%CompileName% -output-directory=Tmp %FileName%
@rem ******************************************
@rem ****** Open the generated pdf file ******
@rem ******************************************
start " " /max "./Tmp/%FileName%.pdf"
@rem ******************************************
echo ****************************************************
echo use %CompileName% compile %FileName%.tex finished!
echo ****************************************************