blob: 6f1780efea3b73329b3f3cd82bb14d4a3d149f6a (
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-cs1 ./pandoc-todo
- filters += $(if $(citeproc_file),pandoc-citeproc)
- filters += ./pandoc-iri
- markdown_includes = copyright.md colophon.md
- mediawiki_includes = preface.mw foreword.mw
- includes += $(markdown_includes:.md=.tex)
- includes += $(mediawiki_includes:.mw=.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 matter=yes -V classoption=titlepage -V classoption=$(if $(final),final,draft)
- flavors = a4 book ebook
- args_a4 = -V papersize=a4paper -V fontsize=10pt -V classoption=oneside
- args_book = -V papersize=b5paper -V fontsize=10pt -V classoption=twoside
- args_ebook = -V papersize=ebook -V fontsize=12pt -V classoption=oneside -V classoption=openany
- all: $(flavors:%=$(stem)-%.pdf)
- download:
- wget -O $(stem).raw '$(source_baseurl)w/index.php?title=$(source_basename)&action=edit'
- $(stem).mw $(mediawiki_includes): $(stem).raw
- ./mediawiki-extract $< $@
- ./mediawiki-trim $@
- ./mediawiki-blockquote $@
- ./mediawiki-uri-escape $@
- ./mediawiki-matter $@
- $(stem).native: $(stem).mw $(localfilters)
- $(env_filter) pandoc -f mediawiki $(args_meta) $(args_filter) -o $@ $<
- $(mediawiki_includes:.mw=.tex): %.tex: %.mw $(stem).mw
- pandoc -f mediawiki -t latex --chapters -o $@ $<
- $(markdown_includes:.md=.tex): %.tex: %.md
- pandoc -f markdown -t latex --chapters -o $@ $<
- $(flavors:%=$(stem)-%.tex): $(stem)-%.tex: $(stem).native $(templates) $(includes)
- pandoc --standalone $(args_meta) $(args_latex) $(args_$*) -o $@ $<
- XELATEX = xelatex -no-shell-escape -halt-on-error -interaction=batchmode
- %.pdf: %.tex
- $(XELATEX) $<
- $(XELATEX) $<
- $(XELATEX) $<
- $(XELATEX) $<
- clean:
- rm -f $(foreach ext,pdf aux log out toc tex,$(flavors:%=$(stem)-%.$(ext)))
- rm -f $(foreach ext,native bib mw,$(stem:%=%.$(ext)))
- rm -f $(foreach ext,aux tex,$(includes:%.tex=%.$(ext)))
- rm -f $(mediawiki_includes)
- distclean: clean
- rm -f $(stem:%=%.raw)
|