forked from huangxg/lnotes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmtex.cmd
117 lines (104 loc) · 2.11 KB
/
mtex.cmd
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
:VARIABLES
@SET PDFLATEX=xelatex
@SET MAINFILE=src/lnotes2.tex
@SET OPTIONS="-output-driver=\"xdvipdfmx -V 5\""
@IF "%1" == "-clean" GOTO CLEAN
@IF "%1" == "-build" GOTO BUILD
:USAGE
@ECHO TeX Manager 0.7 (2019-04-12) by Alpha Huang
@ECHO Manage workflow of LaTeX Notes 2.
@ECHO.
@ECHO Usage: mtex [ACTION] [TARGET]
@ECHO ACTION: -clean Delete auxiliary files of TARGET.
@ECHO -build Build TARGET.
@ECHO TARGET: main Main file.
@ECHO graph Graphics files.
@ECHO all All files.
@GOTO END
:CLEAN
@IF "%2" == "main" (
CALL :CLEAN_MAIN
@GOTO :EOF
) ELSE @IF "%2" == "graph" (
CALL :CLEAN_GRAPH
@GOTO :EOF
) ELSE @IF "%2" == "all" (
CALL :CLEAN_MAIN
CALL :CLEAN_GRAPH
@GOTO :EOF
) ELSE (
@ECHO Invalid TARGET
@ECHO.
@GOTO USAGE
)
:CLEAN_MAIN
@DEL tmp\*.*
@ECHO main temporary files cleaned.
@EXIT /B
:CLEAN_GRAPH
@DEL graph\tmp\*.*
@ECHO graph temporary files cleaned.
@EXIT /B
:BUILD
@IF "%2" == "main" (
CALL :BUILD_MAIN
@GOTO :EOF
) ELSE @IF "%2" == "graph" (
CALL :BUILD_GRAPH
@GOTO :EOF
) ELSE @IF "%2" == "all" (
CALL :BUILD_MAIN
CALL :BUILD_GRAPH
@GOTO :EOF
) ELSE (
@ECHO Invalid TARGET
@ECHO.
@GOTO USAGE
)
:BUILD_MAIN
@ECHO building main
@MOVE tmp\*.* . > NUL
@REM texify -pqV --tex-option=%OPTIONS% %MAINFILE%
texify -pqV %MAINFILE%
makeindex org
makeindex people
@REM texify -pqV --tex-option=%OPTIONS% %MAINFILE%
texify -pqV %MAINFILE%
@MOVE *.aux tmp > NUL
@MOVE *.bbl tmp > NUL
@MOVE *.blg tmp > NUL
@MOVE *.exa tmp > NUL
@MOVE *.idx tmp > NUL
@MOVE *.ilg tmp > NUL
@MOVE *.ind tmp > NUL
@MOVE *.loe tmp > NUL
@MOVE *.lof tmp > NUL
@MOVE *.log tmp > NUL
@MOVE *.lot tmp > NUL
@MOVE *.out tmp > NUL
@MOVE *.toc tmp > NUL
@ECHO.
@ECHO done
@EXIT /B
:BUILD_GRAPH
@ECHO building graph
@CD graph
CALL ctex -x mini
CALL ctex -m fig
CALL ctex -x pst
CALL ctex -p pgf
CALL ctex -x beamer
CALL ctex -x beamer-warsaw
CALL ctex -x letter-bus
CALL ctex -x letter-memo
CALL ctex -x letter-pr
CALL ctex -x letter-std
CALL ctex -x letter-env
CALL ctex -x cv-banking
CALL ctex -x cv-casual
CALL ctex -x cv-classic
CALL ctex -x cv-old
@CD ..
@ECHO.
@ECHO done
@EXIT /B