summaryrefslogtreecommitdiffstats
path: root/presentations/fri-demokratisk/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'presentations/fri-demokratisk/Makefile')
-rw-r--r--presentations/fri-demokratisk/Makefile54
1 files changed, 54 insertions, 0 deletions
diff --git a/presentations/fri-demokratisk/Makefile b/presentations/fri-demokratisk/Makefile
new file mode 100644
index 0000000..e18abb3
--- /dev/null
+++ b/presentations/fri-demokratisk/Makefile
@@ -0,0 +1,54 @@
+SHELL = /bin/bash
+
+AUTHOR = eek
+DATE = 2015-10
+VERSION = draft
+
+all: notes posters images
+
+author := $(AUTHOR)
+date := $(DATE)
+base := $(notdir $(shell pwd))
+version := $(VERSION)
+pre = $(author)-$(date)-$(base)
+suf = $(version)
+
+notes: $(pre)-notes-$(suf).pdf
+
+posters: $(pre)-posters-$(suf).pdf
+
+IMAGES = Richard_Stallman_at_Marlboro_College.jpg Heckert_GNU.png Tux.pdf
+
+$(IMAGES):
+ make -C images $@
+
+$(pre)-notes-$(suf).tex: script.mdwn
+ pandoc -s -f markdown -t latex -V classoption=a4paper,twocolumn,11pt -V geometry=left=10mm,right=15mm,top=20mm,bottom=15mm,includefoot < $< |\
+ sed '/{geometry}/ a \\\\setlength\\columnsep{25mm}\\setlength\\columnseprule{0pt}' |\
+ sed '/\\subtitle/ i \\\newcommand{\\subtitle}[1]{}'> $@
+
+$(pre)-posters-$(suf).tex: posters.tex
+ sed "/input.bib/ s/bib/$(pre)-bib-$(suf)/" < $< > $@
+
+$(pre)-bib-$(suf).tex: $(pre)-notes-$(suf).tex
+ sed -n '/subsection.Den som vill veta mer/,/subsection/ p' < $< | sed '1,2 d; $$ d' > $@
+
+$(pre)-posters-$(suf).pdf: $(pre)-posters-$(suf).tex $(pre)-bib-$(suf).tex $(IMAGES)
+ jobname=$(basename $@) ;\
+ latex_count=5 ;\
+ latex_log=$$jobname.log ;\
+ pdflatex -jobname $$jobname $< ;\
+ while egrep -s 'Rerun (LaTeX|to get cross-references right)' $$latex_log && [ $$latex_count -gt 0 ] ;\
+ do echo "Rerunning latex...." ; pdflatex -jobname $$jobname $< ;\
+ latex_count=`expr $$latex_count - 1`;\
+ done;
+
+%.pdf: %.tex
+ jobname=$(basename $@) ;\
+ latex_count=5 ;\
+ latex_log=$$jobname.log ;\
+ pdflatex -jobname $$jobname $< ;\
+ while egrep -s 'Rerun (LaTeX|to get cross-references right)' $$latex_log && [ $$latex_count -gt 0 ] ;\
+ do echo "Rerunning latex...." ; pdflatex -jobname $$jobname $< ;\
+ latex_count=`expr $$latex_count - 1`;\
+ done;