-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (36 loc) · 1.28 KB
/
Makefile
File metadata and controls
40 lines (36 loc) · 1.28 KB
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
TEX = $(wildcard *.tex)
REFERENCES = '/bibliography{references}/ {'
PATTERN1 = "s/\{references\}/\{supplementary\}/"
PATTERN2 = '/bibliography{supplementary}/ {'
.PHONY: paper
paper: $(TEX)
echo -n "Words in abstract (200 max): " > wordcount.tex
-texcount -total -brief -sum=1 summary.tex >> wordcount.tex
echo -n "Words in main text (3000 max): " >> wordcount.tex
-texcount -total -brief -sum=1 body.tex >> wordcount.tex
echo -n "Words in methods (3000 max): " >> wordcount.tex
-texcount -total -brief -sum=1 methods.tex >> wordcount.tex
TEXINPUTS=.//: latexmk -pdf -use-make paper.tex
.PHONY: submit
submit: paper
# Main
latexpand --keep-comments _main.tex > main.tex
python move_figures.py main.tex
latexmk -pdf -use-make main.tex
sed -e $(REFERENCES) -e 'r main.bbl' -e 'd' -e '}' -i main.tex
# Supplement
latexpand _supplementary.tex > supplementary.tex
latexmk -pdf -use-make supplementary.tex
bibexport -o supplementary.bib supplementary.aux
sed -ie '/textbf/,+2d' supplementary.bib
perl -pi -e $(PATTERN1) supplementary.tex
latexmk -pdf -use-make supplementary.tex
sed -e $(PATTERN2) -e 'r supplementary.bbl' -e 'd' -e '}' -i supplementary.tex
.PHONY: summary
summary:
pandoc --strip-comments -t plain summary.tex
.PHONY: clean
clean:
@rm -f *~
latexmk -CA
-rm wordcount.tex