-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
68 lines (61 loc) · 1.73 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
all: report
report: report
reportP: report_plain
presentation: presentation
presentationP: presentation_plain
clean: clean_all
convert: convert_presentation
report:
lualatex CoSSRT.tex
bibtex CoSSRT
lualatex CoSSRT.tex
lualatex CoSSRT.tex
report_plain:
lualatex CoSSRT.tex
presentation:
pdflatex CoSSPT.tex
biber CoSSPT
pdflatex CoSSPT.tex
pdflatex CoSSPT.tex
presentation_plain:
pdflatex CoSSPT.tex
clean_all:
rm -f *.aux
rm -f *.log
rm -f *.out
rm -f *.toc
rm -f *.bbl
rm -f *.blg
rm -f *.bcf
rm -f *.nav
rm -f *.run.xml
rm -f *.snm
rm -fr presentation_image
convert_presentation:
mkdir -p presentation_image
convert -verbose -density 600 -fill white -opaque none -quality 100 -resize 1600x -fill white -opaque none "CoSSPT.pdf" "presentation_image/%02d.png"
{ echo "import pptx" ;\
echo "import glob" ;\
echo "p = pptx.Presentation()" ;\
echo "ims = sorted(glob.glob('presentation_image/*'))"; \
echo "blank_slide_layout= p.slide_layouts[6]" ;\
echo "for im in ims:" ;\
echo " slide = p.slides.add_slide(blank_slide_layout)" ;\
echo " slide.shapes.add_picture(im, 0, 0, p.slide_width, p.slide_height)" ;\
echo "p.save('CoSSPT.pptx')" ;\
} | python
convert_presentation_sh:
mkdir -p presentation_image
convert -verbose -density 600 -fill white -opaque none -quality 100 -resize 1600x -fill white -opaque none "CoSSPT.pdf" "presentation_image/%02d.png"
# pip install python-pptx
python - <<END
## Python code
import pptx
import glob
p = pptx.Presentation()
ims = sorted(glob.glob("presentation_image/*"))
blank_slide_layout= p.slide_layouts[6]
for im in ims:
slide = p.slides.add_slide(blank_slide_layout)
slide.shapes.add_picture(im, 0, 0, p.slide_width, p.slide_height)
p.save("CoSSPT.pptx")