Browse Source

First attempt for some Makefile for handouts

Not finished yet.

Signed-off-by: Daniel Borchmann <daniel@algebra20.de>
master
Daniel 3 years ago
parent
commit
1854dc6f24
Signed by: Daniel Borchmann <daniel@algebra20.de> GPG Key ID: 455E361001FF778F
2 changed files with 10 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 9
    0
      lectures/Makefile

+ 1
- 0
.gitignore View File

@@ -135,3 +135,4 @@
135 135
 /lectures/lecture-05-macros.synctex.gz
136 136
 /lectures/lecture-05-macros.toc
137 137
 /lectures/lecture-05-macros.vrb
138
+/lectures/lecture-*-handout.*

+ 9
- 0
lectures/Makefile View File

@@ -0,0 +1,9 @@
1
+# This is buggy: it replaces *all* occurrences of documentclass
2
+# maybe this helps: https://stackoverflow.com/questions/6278057/replace-only-first-match-in-multiple-files-with-perl
3
+
4
+%-handout.pdf: %.tex
5
+	cat $< | sed -e 's/^\\documentclass\[/\\documentclass\[handout,/' -e 's/^\\documentclass{/\\documentclass\[handout\]{/' | lualatex -jobname=$(basename $@)
6
+	cat $< | sed -e 's/^\\documentclass\[/\\documentclass\[handout,/' -e 's/^\\documentclass{/\\documentclass\[handout\]{/' | lualatex -jobname=$(basename $@)
7
+
8
+clean:
9
+	rm -f *-handout.pdf

Loading…
Cancel
Save