-
Notifications
You must be signed in to change notification settings - Fork 26
/
makefile
70 lines (67 loc) · 1.78 KB
/
makefile
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
DVIPDFMX:=$(shell grep '\\def\\usewhat{dvipdfmx}' main.tex)
PDFLATEX:=$(shell grep '\\def\\usewhat{pdflatex}' main.tex)
DVIPSPDF:=$(shell grep '\\def\\usewhat{dvipspdf}' main.tex)
XELATEX:=$(shell grep '\\def\\usewhat{xelatex}' main.tex)
YAP:=$(shell grep '\\def\\usewhat{yap}' main.tex)
PDFREADER:=evince
empty=
all:
ifneq ($(empty),$(XELATEX))
xelatex main.tex
xelatex main.tex
# @echo Done. Starting the browser......
# @$(PDFREADER) main.pdf >/dev/null 2>&1 &
endif
ifneq ($(empty),$(PDFLATEX))
@echo Making pdflatex......
rm main_pdflatex.pdf&
pdflatex main.tex
env BIBINPUTS=./ BSTINPUTS=./ bibtex main
pdflatex main.tex
#gbk2uni main.out
#pdflatex main.tex
#mv main.pdf main_pdflatex.pdf
@echo Done. Starting the browser......
@$(PDFREADER) main_pdflatex.pdf >/dev/null 2>&1 &
endif
ifneq ($(empty),$(DVIPDFMX))
@echo Making dvipdfmx......
rm main_dvipdfm.pdf main.dvi&
latex main.tex
# env BIBINPUTS=./ BSTINPUTS=./ bibtex main
latex main.tex
gbk2uni main.out
latex main.tex
dvipdfmx -p a4 main.dvi
mv main.pdf main_dvipdfm.pdf
@echo Done. Starting the browser......
@$(PDFREADER) main_dvipdfm.pdf >/dev/null 2>&1 &
endif
ifneq ($(empty),$(DVIPSPDF))
@echo Making dvipspdf......
rm main_dvipspdf.pdf main.dvi main.ps&
latex main.tex
# env BIBINPUTS=./ BSTINPUTS=./ bibtex main
latex main.tex
gbk2uni main.out
latex main.tex
dvips -G0 -ta4 main.dvi
ps2pdf main.ps main_dvipspdf.pdf
@echo Done. Starting the browser......
@$(PDFREADER) main_dvipspdf.pdf >/dev/null 2>&1 &
endif
ifneq ($(empty),$(YAP))
@echo Making dvi......
rm main.dvi&
latex main.tex
env BIBINPUTS=./ BSTINPUTS=./ bibtex main
latex main.tex
gbk2uni main.out
latex main.tex
xdvi main.dvi&
endif
clean:
@echo Cleaning up......
-rm *.log *.out *.thm *.toc *.toe *.pdf
-rm body/*.aux
@echo All done.