/
Makefile
130 lines (94 loc) · 3.56 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
# specify thh main file and all the files that you are including
SOURCE= main.tex $(wildcard local*.tex) $(wildcard chapters/*.tex)
# specify your main target here:
pdf: main.bbl main.pdf #by the time main.pdf, bib assures there is a newer aux file
all: pod cover
complete: index main.pdf
index: main.snd
main.pdf: main.aux
xelatex main
main.aux: $(SOURCE)
xelatex -no-pdf main
#create only the book
main.bbl: $(SOURCE) localbibliography.bib
xelatex -no-pdf main
bibtex -min-crossrefs=200 main
main.snd: main.bbl
sed -i s/.*\\emph.*// main.adx #remove titles which biblatex puts into the name index
sed -i s/.*Institut.*// main.adx #remove titles which biblatex puts into the name index
sed -i 's/hyperindexformat{\\\(infn {[0-9]*\)}/\1/' main.sdx # ordering of references to footnotes
sed -i 's/hyperindexformat{\\\(infn {[0-9]*\)}/\1/' main.adx
sed -i 's/hyperindexformat{\\\(infn {[0-9]*\)}/\1/' main.ldx
python3 fixindex.py
mv mainmod.adx main.adx
makeindex -o main.and main.adx
makeindex -o main.lnd main.ldx
makeindex -o main.snd main.sdx
xelatex main
xelatex main
#create a png of the cover
cover: FORCE
convert main.pdf\[0\] -quality 100 -background white -alpha remove -bordercolor "#999999" -border 2 cover.png
cp cover.png googlebooks_frontcover.png
convert -geometry 50x50% cover.png covertwitter.png
display cover.png
#prepare for print on demand services
pod: bod createspace googlebooks
#prepare for submission to BOD
bod: bod/bodcontent.pdf
bod/bodcontent.pdf: complete
sed "s/output=book/output=coverbod/" main.tex >bodcover.tex
xelatex bodcover.tex
xelatex bodcover.tex
mv bodcover.pdf bod
bash filluppages 4 main.pdf bod/bodcontent.pdf
# prepare for submission to createspace
createspace: createspace/createspacecontent.pdf
createspace/createspacecontent.pdf: complete
sed "s/output=book/output=covercreatespace/" main.tex >createspacecover.tex
xelatex createspacecover.tex
xelatex createspacecover.tex
mv createspacecover.pdf createspace
bash filluppages 1 main.pdf createspace/createspacecontent.pdf
googlebooks: googlebooks_interior.pdf
googlebooks_interior.pdf: complete
cp main.pdf googlebooks_interior.pdf
pdftk main.pdf cat 1 output googlebooks_frontcover.pdf
openreview: openreview.pdf
openreview.pdf: main.pdf
pdftk main.pdf multistamp orstamp.pdf output openreview.pdf
proofreading: proofreading.pdf
paperhive:
git branch gh-pages
git checkout gh-pages
git add proofreading.pdf versions.json
git commit -m 'prepare for proofreading' proofreading.pdf versions.json
git push origin gh-pages
git checkout master
echo "langsci.github.io/BOOKID"
firefox https://paperhive.org/documents/new
proofreading.pdf: main.pdf
pdftk main.pdf multistamp prstamp.pdf output proofreading.pdf
blurb: blurb.html blurb.tex biosketch.tex biosketch.html
blurb.tex: blurb.md
pandoc -f markdown -t latex blurb.md>blurb.tex
blurb.html: blurb.md
pandoc -f markdown -t html blurb.md>blurb.html
biosketch.tex: blurb.md
pandoc -f markdown -t latex biosketch.md>biosketch.tex
biosketch.html: blurb.md
pandoc -f markdown -t html biosketch.md>biosketch.html
#housekeeping
clean:
rm -f *.bak *~ *.backup *.tmp \
*.adx *.and *.idx *.ind *.ldx *.lnd *.sdx *.snd *.rdx *.rnd *.wdx *.wnd \
*.log *.blg *.ilg \
*.aux *.toc *.cut *.out *.tpm *.bbl *-blx.bib *_tmp.bib \
*.glg *.glo *.gls *.wrd *.wdv *.xdv \
*.run.xml \
chapters/*aux chapters/*~ chapters/*.bak chapters/*.backup
realclean: clean
rm -f *.dvi *.ps *.pdf
chapterlist:
grep chapter main.toc|sed "s/.*numberline {[0-9]\+}\(.*\).newline.*/\\1/"
FORCE: