aboutsummaryrefslogtreecommitdiff
path: root/md2latex
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-07 13:56:19 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-07 13:56:19 +0200
commitbd67527a240f0e027d7375c7b03995b4ce1b4bef (patch)
tree6e5fabb7724d55f392289a833ef553e6fa8833fb /md2latex
parent0ec9d66bc38e235008dfa181c17c101770dd8173 (diff)
added script and makefile for converting markdown to latex documents
Diffstat (limited to 'md2latex')
-rwxr-xr-xmd2latex13
1 files changed, 13 insertions, 0 deletions
diff --git a/md2latex b/md2latex
new file mode 100755
index 0000000..4d2bdd2
--- /dev/null
+++ b/md2latex
@@ -0,0 +1,13 @@
+#!/bin/sh
+TARGET="$1"
+
+sed '/^# /d' "$1.md" | pandoc -f markdown -o "$1.html"
+cat ../preamble.tex > "$1.tex"
+
+echo '\begin{document}' >> "$1.tex"
+printf '\\textbf{Databases} %s \\hfill Loek Le Blansch (2180996)\n' "`echo "$1" | sed 's/-/ /g'`" >> "$1.tex"
+pandoc "$1.html" -t latex | sed 's/svg/pdf/g' >> "$1.tex"
+echo '\end{document}' >> "$1.tex"
+
+latexmk -quiet "$1.tex"
+latexmk -quiet -c "$1.tex"