summaryrefslogtreecommitdiff
path: root/Makefile
blob: be722409a685a108c6f2e403ddae8fd4c170936a (plain)
  1. stem = eut
  2. source_baseurl = http://euwiki.org/
  3. source_basename = EUT/2nd-edition
  4. templates = template.tex header.tex before.tex after.tex
  5. filters = ./pandoc-memoir ./pandoc-cs1
  6. export PANDOC_CITEPROC_FILE = $(stem).bib
  7. filters += $(if $(PANDOC_CITEPROC_FILE),pandoc-citeproc)
  8. filters += ./pandoc-iri
  9. localfilters = $(filter ./%,$(filters))
  10. # To produce final document: make -B STATUS=final
  11. STATUS ?= draft
  12. title = Ensuring utmost transparency
  13. subtitle = Free Software and Open Standards under the Rules of Procedure of the European Parliament
  14. args_filter += $(filters:%=--filter %)
  15. args_meta += $(PANDOC_CITEPROC_FILE:%=-M bibliography=%)
  16. args_meta += -V lang=english -V langoption=variant=british
  17. args_meta += -M title="$(title) - $(subtitle)"
  18. args_meta += -V title="$(title)"
  19. args_meta += -V subtitle="$(subtitle)"
  20. args_meta += -M author="Carlo Piana, Ulf Öberg"
  21. args_meta += -V author="Carlo Piana" -V author="Ulf Öberg"
  22. args_meta += -V date=""
  23. args_latex += --template=template.tex --latex-engine=xelatex
  24. args_latex += -H header.tex -B before.tex -A after.tex
  25. args_latex += -V mainfont="Lora" -V sansfont="Quattrocento Sans" -V monofont="Inconsolata"
  26. args_latex += -V documentclass=memoir -V headstyles=komalike -V chapterstyle=ell
  27. args_latex += -V classoption=titlepage -V classoption=$(STATUS)
  28. flavors = a4 book ebook
  29. args_a4 = -V papersize=a4paper -V fontsize=10pt -V classoption=oneside
  30. args_book = -V papersize=b5paper -V fontsize=10pt -V classoption=twoside
  31. args_ebook = -V papersize=ebook -V fontsize=12pt -V classoption=oneside
  32. all: $(flavors:%=$(stem)-%.pdf)
  33. download:
  34. wget -O $(stem).raw '$(source_baseurl)w/index.php?title=$(source_basename)&action=edit'
  35. $(stem).mediawiki: $(stem).raw
  36. ./mediawiki-extract $< $@
  37. ./mediawiki-trim $@
  38. ./mediawiki-blockquote $@
  39. ./mediawiki-uri-escape $@
  40. $(stem).native: $(stem).mediawiki $(localfilters)
  41. pandoc -f mediawiki $(args_meta) $(args_filter) -o $@ $<
  42. $(flavors:%=$(stem)-%.pdf) $(stem).tex: $(stem).native $(templates)
  43. pandoc $(args_meta) $(args_latex) $(args_$(@:$(stem)-%.pdf=%)) -o $@ $<