From 9ff8ab21d79e4d1d59de8cf76b6f77373499c35b Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 24 Mar 2015 19:17:25 +0100 Subject: Support optional cover page, and add it to A4 flavor. --- Makefile | 10 +++++++--- template.tex | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0cee694..bab36ee 100644 --- a/Makefile +++ b/Makefile @@ -40,18 +40,21 @@ args_latex += -V frontmatter=yes -V classoption=titlepage -V classoption=$(if $( #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_a4 += -M isbn="978-90-823692-1-2" -V coverpage="$(stem)-a4-front.pdf" 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: get-$(stem).raw +download: get-$(stem).raw get-$(stem)-a4-front.pdf get-$(stem).raw: get-%: ./mediawiki-fetch $(source_baseurl) $(source_basename) $* +get-$(stem)-a4-front.pdf: get-%: + wget -O $* http://www.greens-efa.eu/fileadmin/dam/Documents/Studies/Ensuring-Utmost-Transparency--Piana-Oberg-Korff.pdf + $(stem).mw: $(stem).raw ./mediawiki-trim $< $@ ./mediawiki-blockquote $@ @@ -65,6 +68,7 @@ $(markdown_includes:.md=.tex): %.tex: %.md pandoc -f markdown -t latex --chapters -o $@ $< $(flavors:%=deps-%):: $(templates) $(includes) Makefile +deps-a4:: $(deps) $(stem)-a4-front.pdf $(flavors:%=$(stem)-%.pdf): $(stem)-%.pdf: $(stem).native $(deps-all) deps-% pandoc --standalone --no-tex-ligatures $(args_meta) $(args_latex) $(args_$*) -o $@ $< @@ -74,4 +78,4 @@ clean: rm -f $(includes) distclean: clean - rm -f $(stem:%=%.raw) + rm -f $(stem:%=%.raw) $(stem:%=%-a4-front.pdf) diff --git a/template.tex b/template.tex index 1e27603..72f1ab8 100644 --- a/template.tex +++ b/template.tex @@ -164,6 +164,10 @@ $else$ \newcommand{\EANisbn} $endif$ +$if(coverpage)$ +\usepackage{pdfpages} +$endif$ + $for(header-includes)$ $header-includes$ $endfor$ @@ -178,6 +182,9 @@ $endif$ $if(chapterstyle)$ % for documentclass memoir chapter headline styling \chapterstyle{$chapterstyle$} $endif$ +$if(coverpage)$ +\includepdf[pages={1}]{$coverpage$} +$endif$ $if(frontmatter)$ \frontmatter $endif$ -- cgit v1.2.3