-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (56 loc) · 1.45 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
71
72
73
74
75
76
77
Src=main#
Bib=$(shell ls *.bib *.bst)#
D=$(HOME)/tmp/$(Src)#
define grab
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=$(1) -dLastPage=$(2) \
-sOutputFile=$@ $<
endef
all: dirs tex bib tex tex tex done
typo:
- git status
- git commit -am "typo"
- git push origin master
commit:
- git status
- git commit -a
- git push origin master
update:
- git pull origin master
status:
- git status
one: dirs tex done
open:
open $(D).pdf
evince:
evince $(D).pdf 2> /dev/null &
skim:
/Applications/Skim.app/Contents/MacOS/Skim $(D).pdf &
view:
evince $(D).pdf &
abe : $(D)_a.pdf $(D)_b.pdf $(D)_e.pdf
$(D).pdf : $(Src).tex $(Bib)
pdflatex -output-directory=$(HOME)/tmp $(Src)
$(D)_a.pdf : $(D).pdf; $(call grab,1,1)
$(D)_b.pdf : $(D).pdf; $(call grab,2,16)
$(D)_e.pdf : $(D).pdf; $(call grab,18,28)
done: embedfonts
@printf "\n\n\n==============================================\n"
@printf "see output in $(D).pdf\n"
@printf "==============================================\n\n\n"
@printf "\n\nWarnings (may be none):\n\n"
grep arning $D.log
dirs:
- [ ! -d $(HOME)/tmp ] && mkdir $(HOME)/tmp
tex: files $(D).pdf
files:
cp *.tex $(HOME)/tmp
embedfonts:
@ gs -q -dNOPAUSE -dBATCH -dPDFSETTINGS=/prepress -sDEVICE=pdfwrite \
-sOutputFile=$(D)-embedded.pdf $(D).pdf
@ mv $(D)-embedded.pdf $(D).pdf
bib:
echo $(Bib)
- cp $(Bib) $(HOME)/tmp; cd $(HOME)/tmp; bibtex $(Src)
clean:
rm $D.*