# 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=oneside args_a4 += -M isbn="978-90-823692-1-2" 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 args_ebook += -M isbn="978-90-823692-0-5" all: $(flavors:%=$(stem)-%.pdf) download: ./mediawiki-fetch $(source_baseurl) $(source_basename) $(stem).raw $(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 $@ $< $(markdown_includes:.md=.tex): %.tex: %.md pandoc -f markdown -t latex --chapters -o $@ $< $(flavors:%=$(stem)-%.pdf): $(stem)-%.pdf: $(stem).native $(templates) $(includes) 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)