stem = eut source_baseurl = http://euwiki.org/ source_basename = EUT/2nd-edition # work around in mediawiki bug parsing blockquote tags on same line re_blockquote = s|\n*()\n*|\n$$1\n|g export PANDOC_CITEPROC_FILE = $(stem).bib #PANDOC_CITEPROC_FILE = $(stem).bib # To produce final document: make -B STATUS=final STATUS ?= draft all: $(stem).pdf download: wget -o $(stem).raw '$(source_baseurl)index.php?title=$(source_basename)&action=edit' $(stem).mediawiki: $(stem).raw perl -0777 -MHTML::Entities -p \ -e 's|.*]*>||s; s|||s;' \ -e '$(re_blockquote);' \ < $< > $@ $(stem).pdf: $(stem).mediawiki template.tex pandoc -f mediawiki --template=template.tex --latex-engine=xelatex \ -H header.tex -B before.tex -A after.tex \ --filter ./pandoc-filter-sections --filter ./pandoc-filter-bib \ --bibliography=$(PANDOC_CITEPROC_FILE) \ -V mainfont="Lora" -V sansfont="Quattrocento Sans" -V monofont="Inconsolata" \ -V papersize=a4paper -V fontsize=10pt \ -V documentclass=memoir -V headstyles=komalike -V chapterstyle=ell \ -V classoption=oneside -V classoption=titlepage -V classoption=$(STATUS) \ -V lang=english -V langoption=variant=british \ -V title="Ensuring utmost transparency" \ -V subtitle="Free Software and Open Standards under the Rules of Procedure of the European Parliament" \ -V author="Carlo Piana" -V author="Ulf Öberg" \ -V date="" \ -o $@ $<