blob: 30439a1e91580225bc958319afb1c258a31eb795 (
plain)
- # expensive checks enabled: make -B flightcheck=1
- # Final document: make -B final=1
- stem = eut
- source_baseurl = http://euwiki.org/
- source_basename = EUT/2nd-edition
- citeproc_file = $(stem).bib
- templates = template.tex header.tex before.tex after.tex
- filters = ./pandoc-memoir ./pandoc-emphasis ./pandoc-cs1 ./pandoc-todo
- filters += $(if $(citeproc_file),pandoc-citeproc)
- filters += ./pandoc-iri
- markdown_includes = copyright.md colophon.md
- includes += $(markdown_includes:.md=.tex)
- localfilters = $(filter ./%,$(filters))
- title = Ensuring utmost transparency
- subtitle = Free Software and Open Standards under the Rules of Procedure of the European Parliament
- env_filter += $(citeproc_file:%=PANDOC_CITEPROC_FILE=%)
- env_filter += $(if $(flightcheck),NETWORK_TESTS=1)
- args_filter += $(filters:%=--filter %)
- args_meta += $(citeproc_file:%=-M bibliography=%)
- args_meta += -V lang=english -V langoption=variant=british
- args_meta += -M title="$(title) - $(subtitle)"
- args_meta += -V title="$(title)"
- args_meta += -V subtitle="$(subtitle)"
- args_meta += -M author="Carlo Piana, Ulf Öberg"
- args_meta += -V author="Carlo Piana" -V author="Ulf Öberg"
- args_meta += -V date=""
- args_latex += --template=template.tex --latex-engine=xelatex
- args_latex += -H header.tex -B before.tex -A after.tex
- args_latex += -V mainfont="Lora" -V sansfont="Quattrocento Sans" -V monofont="Inconsolata"
- args_latex += -V documentclass=memoir -V pagestyle=plain -V headstyles=komalike -V chapterstyle=ell
- args_latex += -V frontmatter=yes -V classoption=titlepage -V classoption=$(if $(final),final,draft)
- #flavors = a4 book ebook
- flavors = a4 ebook
- args_a4 = -V papersize=a4paper -V fontsize=10pt -V classoption=twoside
- args_a4 += -M isbn="978-90-823692-1-2" -V coverpage="$(stem)-a4-front.pdf"
- args_book = -V papersize=b5paper -V fontsize=10pt -V classoption=twoside
- args_ebook = -V papersize=a5paper -V fontsize=12pt -V classoption=oneside -V classoption=openany
- args_ebook += -M isbn="978-90-823692-0-5"
- args_ebook += -H header-ebook.tex
- all: $(flavors:%=$(stem)-%.pdf)
- download:: get-$(stem).raw
- download:: get-$(stem)-front-logo2.bmp get-$(stem)-front.svg
- get-$(stem).raw: get-%:
- ./mediawiki-fetch $(source_baseurl) $(source_basename) $*
- # upstream source requires login
- #get-$(stem)-front-photo-orig.jpg: get-%:
- # wget -O $* http://audiovisual.europarl.europa.eu/Asset.aspx?type=nl&id=52c6e976-dd19-4a10-a8f0-afebae7fddd8
- $(stem)-front-photo.jpg: $(stem)-front-photo-orig.jpg
- cp -f $< $@
- jpegoptim --strip-all $@
- get-$(stem)-front-logo2.bmp: get-%:
- wget -O $* http://siri.biks.dk/transparency/GreensEFA-EN.bmp
- $(stem)-front-logo2.png: $(stem)-front-logo2.bmp
- optipng -clobber $<
- get-$(stem)-front-a4-orig.svg: get-%:
- wget -O $* http://siri.biks.dk/transparency/transparency_front.svg
- $(stem)-front-a4.svg: $(stem)-front-a4-orig.svg eut-front-logo2.png eut-front-photo.jpg
- cp -f $< $@
- perl -i -pe 's,xlink:href="\K[^\"]+\.bmp,eut-front-logo2.png,' $@
- perl -i -pe 's,xlink:href="\K[^\"]+\.jpg,eut-front-photo.jpg,' $@
- $(stem)-a4-front.pdf: $(stem)-front-a4.svg
- inkscape -z --export-pdf=$@ $<
- $(stem).mw: $(stem).raw
- ./mediawiki-trim $< $@
- ./mediawiki-blockquote $@
- ./mediawiki-uri-escape $@
- ./mediawiki-matter $@
- $(stem).native: $(stem).mw $(localfilters)
- $(env_filter) pandoc -f mediawiki --smart $(args_meta) $(args_filter) -o $@ $<
- # ./native-hacks $@
- $(markdown_includes:.md=.tex): %.tex: %.md
- pandoc -f markdown -t latex --chapters -o $@ $<
- $(flavors:%=deps-%):: $(templates) $(includes) Makefile
- deps-a4:: $(deps) $(stem)-a4-front.pdf
- $(flavors:%=$(stem)-%.pdf): $(stem)-%.pdf: $(stem).native $(deps-all) deps-%
- pandoc --standalone --no-tex-ligatures $(args_meta) $(args_latex) $(args_$*) -o $@ $<
- clean:
- rm -f $(foreach ext,native bib mw,$(stem:%=%.$(ext)))
- rm -f $(includes)
- distclean: clean
- rm -f $(stem:%=%.raw) $(stem:%=%-a4-front.pdf)
|