forked from chianjin/outline-of-mechanics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
45 lines (45 loc) · 1.67 KB
/
build.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
@rem ------------------------------------------------
@echo off
cd /d %~dp0
@rem ------------------------------------------------
@rem ->> Source and dist file names
@rem ------------------------------------------------
set PDFFileName=Á¦Ñ§¸ÅÂÛ-LaTeX-ÖØÅű¾
set TeXFileName=outline-of-mechanics
@rem ------------------------------------------------
@rem ->> TeX compiler
@rem ------------------------------------------------
set Compiler=latexmk -xelatex
@rem ------------------------------------------------
@rem ->> Build directory
@rem ------------------------------------------------
set BuildPath=build
set SourcePath=tex
if not exist %BuildPath% (
md %BuildPath%
)
@rem ------------------------------------------------
@rem ->> Build textual content
@rem ------------------------------------------------
@rem %Compiler% -synctex=1 -interaction=nonstopmode -output-directory=%BuildPath% .\%SourcePath\%TeXFileName%
cd %SourcePath%
%Compiler% -synctex=1 -output-directory=..\%BuildPath% %TeXFileName%.tex
cd ..
@rem ------------------------------------------------
@rem ->> Rename output PDF filename
@rem ------------------------------------------------
if exist %PDFFileName%.pdf (
del %PDFFileName%.pdf
)
if exist %BuildPath%\%TeXFileName%.pdf (
copy %BuildPath%\%TeXFileName%.pdf %PDFFileName%.pdf
)
@rem ------------------------------------------------
@rem ->> View compiled file
@rem ------------------------------------------------
@rem if exist .\%BuildPath%\%PDFFileName%.pdf (
@rem start " " /max .\%BuildPath%\%PDFFileName%.pdf
@rem )
echo ------------------------------------------------
echo %Compiler% %TeXFileName%.tex finished...
echo ------------------------------------------------