From d1c06bd7c24d101275662e6469f6389db175b21e Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Sun, 13 Oct 2019 21:18:15 +0200 Subject: [PATCH] [cache] PDF compilation infrastructure Add *Makefile* and Sed scripts for PDF-comilation via pandoc. Also update *.gitignore* --- cash/.gitignore | 1 + cash/Makefile | 21 +++++++++++++++++++++ cash/sed/latex.sed | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 cash/.gitignore create mode 100644 cash/Makefile create mode 100644 cash/sed/latex.sed diff --git a/cash/.gitignore b/cash/.gitignore new file mode 100644 index 0000000..a136337 --- /dev/null +++ b/cash/.gitignore @@ -0,0 +1 @@ +*.pdf diff --git a/cash/Makefile b/cash/Makefile new file mode 100644 index 0000000..6331bde --- /dev/null +++ b/cash/Makefile @@ -0,0 +1,21 @@ +ALL = \ + welcome-letter.pdf \ + tutorial.pdf \ + +all: $(ALL) + +OPTS = \ + -s -f markdown -t latex -V geometry=margin=2.5cm \ + -V classoption=12pt,a4paper -V links-as-notes \ + -V header-includes=\\usepackage{nopageno} + + +%.pdf: %.mdwn + cat $< |\ + sed -f sed/latex.sed |\ + pandoc $(OPTS) -o $@ + +clean: + rm -f $(ALL) + +.PHONO: all clean diff --git a/cash/sed/latex.sed b/cash/sed/latex.sed new file mode 100644 index 0000000..4bb2137 --- /dev/null +++ b/cash/sed/latex.sed @@ -0,0 +1,9 @@ +1,/^$/ { + 1 i --- + /^$/ i ... + s/^\[\[.*meta \(.*\)="\(.*\)".*$/\1: \2/ + /^title: / { + s/ -- /\\linebreak / + } +} + -- 2.39.2