-
Notifications
You must be signed in to change notification settings - Fork 0
/
tex2pdf.bat
30 lines (21 loc) · 1.22 KB
/
tex2pdf.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
@echo off
setlocal
:: Get the current directory and set THESIS_ROOT variable
for /f %%A in ('cd') do set "THESIS_ROOT=%%A"
:: Change to the src directory, exit with an error message if not found
cd "%THESIS_ROOT%\src" || (echo src not found & exit /b 1)
:: Compile the LaTeX document with xelatex
xelatex -file-line-error -interaction=nonstopmode -synctex=1 -output-directory="%THESIS_ROOT%\out" -aux-directory="%THESIS_ROOT%\auxil" ecustthesis.tex
:: Change to the auxil directory, exit with an error message if not found
cd "%THESIS_ROOT%\auxil" || (echo auxil not found & exit /b 1)
:: Run biber to process the bibliography
biber --input-directory="%THESIS_ROOT%\src" ecustthesis
:: Change back to the src directory
cd "%THESIS_ROOT%\src" || (echo src not found & exit /b 1)
:: Compile the LaTeX document again
xelatex -file-line-error -interaction=nonstopmode -synctex=1 -output-directory="%THESIS_ROOT%\out" -aux-directory="%THESIS_ROOT%\auxil" ecustthesis.tex
xelatex -file-line-error -interaction=nonstopmode -synctex=1 -output-directory="%THESIS_ROOT%\out" -aux-directory="%THESIS_ROOT%\auxil" ecustthesis.tex
:: Change back to the root directory
cd "%THESIS_ROOT%" || (echo root not found & exit /b 1)
:: End of the script
endlocal