forked from matplotlib/cheatsheets
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
79 lines (66 loc) · 2.29 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
SRC := $(wildcard *.tex)
CONVERTFLAGS = -density 150 -alpha remove -depth 8
.PHONY: default
default: all
.PHONY: all
all: logos figures cheatsheets handouts docs
.PHONY: logos
logos:
wget https://github.com/matplotlib/matplotlib/raw/v3.5.0/doc/_static/logo2.png -O ./logos/logo2.png
.PHONY: figures
figures:
# generate the figures
cd scripts && for script in *.py; do echo $$script; MPLBACKEND="agg" python $$script; done
# crop some of the figures
cd figures && pdfcrop adjustments.pdf adjustments.pdf
cd figures && pdfcrop annotate.pdf annotate.pdf
cd figures && pdfcrop annotation-arrow-styles.pdf annotation-arrow-styles.pdf
cd figures && pdfcrop anatomy.pdf anatomy.pdf
cd figures && pdfcrop colornames.pdf colornames.pdf
cd figures && pdfcrop fonts.pdf fonts.pdf
cd figures && pdfcrop markers.pdf markers.pdf
cd figures && pdfcrop text-alignments.pdf text-alignments.pdf
cd figures && pdfcrop tick-formatters.pdf tick-formatters.pdf
cd figures && pdfcrop tick-locators.pdf tick-locators.pdf
cd figures && pdfcrop tip-font-family.pdf tip-font-family.pdf
cd figures && pdfcrop tip-hatched.pdf tip-hatched.pdf
.PHONY: cheatsheets
cheatsheets:
xelatex cheatsheets.pt-br.tex
convert $(CONVERTFLAGS) cheatsheets.pt-br.pdf -scene 1 cheatsheets.pt-br.png
.PHONY: handouts
handouts:
xelatex handout-beginner.pt-br.tex
xelatex handout-intermediate.pt-br.tex
xelatex handout-tips.pt-br.tex
convert $(CONVERTFLAGS) handout-tips.pt-br.pdf handout-tips.pt-br.png
convert $(CONVERTFLAGS) handout-beginner.pt-br.pdf handout-beginner.pt-br.png
convert $(CONVERTFLAGS) handout-intermediate.pt-br.pdf handout-intermediate.pt-br.png
.PHONY: check
check:
./check-matplotlib-version.py
./check-num-pages.sh cheatsheets.pt-br.pdf 2
./check-num-pages.sh handout-tips.pt-br.pdf 1
./check-num-pages.sh handout-beginner.pt-br.pdf 1
./check-num-pages.sh handout-intermediate.pt-br.pdf 1
./check-links.py cheatsheets.pdf
.PHONY: docs
docs:
make -C docs/ html
cp ./cheatsheets*.p* ./docs/_build/html
cp ./handout-*.pt-br.p* ./docs/_build/html
.PHONY: fonts
fonts:
make -C fonts/
.PHONY: clean
clean: $(SRC)
latexmk -c $^
- rm -rf ./build/
.PHONY: clean-all
clean-all: clean
- rm ./logos/mpl-logo2.pdf
git clean -f -X ./figures/
git clean -f ./scripts/*.pdf
.PHONY: requirements
requirements:
$(MAKE) -C ./requirements/