summaryrefslogtreecommitdiff
path: root/Makefile
blob: 505254ce78149441210bb49fff3264e4f2e32f84 (plain)
  1. # Final document: make -B final=1
  2. stem = eut
  3. source_baseurl = http://euwiki.org/
  4. source_basename = EUT/2nd-edition
  5. citeproc_file = $(stem).bib
  6. templates = template.tex header.tex before.tex after.tex
  7. filters = ./pandoc-memoir ./pandoc-cs1
  8. filters += $(if $(citeproc_file),pandoc-citeproc)
  9. filters += ./pandoc-iri
  10. localfilters = $(filter ./%,$(filters))
  11. title = Ensuring utmost transparency
  12. subtitle = Free Software and Open Standards under the Rules of Procedure of the European Parliament
  13. env_filter += $(citeproc_file:%=PANDOC_CITEPROC_FILE=%)
  14. args_filter += $(filters:%=--filter %)
  15. args_meta += $(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=$(if $(final),final,draft)
  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. $(env_filter) 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 $@ $<