Makefile rule for cropping the PDF to extract small parts of the article

This commit is contained in:
Georges Dupéron 2018-07-31 22:59:48 +02:00
parent 41c6f78bc0
commit bac59a6495
3 changed files with 35 additions and 3 deletions

5
.gitignore vendored
View File

@ -1,4 +1,7 @@
/deques
/deques.cmi
/deques.cmo
/deques.mli
/deques.mli
/jacm-final.pdf
/jacm-final-page*.pdf
/jacm-final-crop-*-*-*-*-page*.pdf

View File

@ -1,9 +1,12 @@
sudo: false
language: c
addons:
apt:
packages:
- ocaml-interp
- ocaml
- ocaml-findlib
- libpodofo-utils
script:
- make print-tool-versions

View File

@ -1,3 +1,5 @@
.SECONDEXPANSION:
.PHONY: all
all: deques deques.mli Makefile
@ -8,5 +10,29 @@ deques.mli: deques.ml Makefile
ocamlc -i $< > $@
.PHONY: print-tool-versions
print-tool-versions:
print-tool-versions: Makefile
ocamlc -version
jacm-final.pdf: Makefile
wget http://www.math.tau.ac.il/~haimk/adv-ds-2000/jacm-final.pdf
#sudo apt-get install libpodofo-utils to get podofobox
jacm-final-page%.pdf: jacm-final.pdf Makefile
pdftk P=$< cat P$* output $@
# jacm-final-crop-LEFT-TOP-WIDTH-HEIGHT-pagePAGE.pdf
# Original page width: 488, original page height: 721.
# podofobox expects LEFT BOTTOM WIDTH HEIGHT, multiplied by 100.
jacm-final-crop-%.pdf: $$(shell echo '%.pdf' | sed -e 's/^[-0-9]*-page/jacm-final-page/')
f () { \
podofobox $< $@ \
media $$(( ($$1) * 100 )) \
$$(( ( 720 - ($$2) - ($$4) ) * 100 )) \
$$(( ($$3) * 100 )) \
$$(( ($$4) * 100 )); \
}; \
f $$(echo '$*' | sed -e 's/page[0-9]*$$//' -e 's/-/ /g')
.PHONY: clean
clean: Makefile
rm jacm-final-page*.pdf jacm-final-crop-*-page*.pdf