-
Notifications
You must be signed in to change notification settings - Fork 0
/
localbuild.bat
39 lines (27 loc) · 1007 Bytes
/
localbuild.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
@echo off
setlocal enabledelayedexpansion
for %%I in (.) do set TEXFILE=%%~nxI
echo TEXFILE is set to: %TEXFILE%
echo Building %TEXFILE%.tex...
echo Building %TEXFILE%.tex...
uplatex -interaction=nonstopmode -file-line-error -halt-on-error -synctex=1 %TEXFILE%.tex
if !errorlevel! neq 0 goto :error
upbibtex %TEXFILE%.aux
if !errorlevel! neq 0 goto :error
uplatex -interaction=nonstopmode -file-line-error -halt-on-error -synctex=1 %TEXFILE%.tex
if !errorlevel! neq 0 goto :error
uplatex -interaction=nonstopmode -file-line-error -halt-on-error -synctex=1 %TEXFILE%.tex
if !errorlevel! neq 0 goto :error
dvipdfmx %TEXFILE%.dvi
if !errorlevel! neq 0 goto :error
echo Cleaning up temporary files...
for %%F in (%TEXFILE%.aux %TEXFILE%.dvi %TEXFILE%.log %TEXFILE%.out %TEXFILE%.synctex.gz %TEXFILE%.toc %TEXFILE%.bbl %TEXFILE%.blg) do (
if exist %%F del %%F
)
echo Build process completed successfully.
goto :end
:error
echo An error occurred during the build process.
exit /b 1
:end
exit /b 0