summaryrefslogtreecommitdiff
path: root/gup
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-06-08 11:24:37 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-06-08 11:24:37 +0200
commitf9e07db23dc0c5eabb90c4d9c04666e1ee5c3229 (patch)
treed18a1bfb3be8e134daf85b53500234c889cd87bb /gup
parent0b7d97f98e1a64e8c1c0e1decf7a11d9b4888daf (diff)
downloaduni-f9e07db23dc0c5eabb90c4d9c04666e1ee5c3229.tar
uni-f9e07db23dc0c5eabb90c4d9c04666e1ee5c3229.tar.gz
uni-f9e07db23dc0c5eabb90c4d9c04666e1ee5c3229.tar.bz2
uni-f9e07db23dc0c5eabb90c4d9c04666e1ee5c3229.tar.xz
uni-f9e07db23dc0c5eabb90c4d9c04666e1ee5c3229.zip
Much more work on pdf compilation
Diffstat (limited to 'gup')
-rwxr-xr-xgup/pdf.gup30
1 files changed, 24 insertions, 6 deletions
diff --git a/gup/pdf.gup b/gup/pdf.gup
index 96f46ca..103aadb 100755
--- a/gup/pdf.gup
+++ b/gup/pdf.gup
@@ -18,8 +18,17 @@ cleanup() {
18} 18}
19trap cleanup EXIT 19trap cleanup EXIT
20 20
21base=(${2%.pdf}.(md|lhs|tex)([1])) 21typeset -a beamerAspects
22metadata=(${2%.pdf}.meta.yml([1]N)) 22beamerAspects=(43 169)
23beamerAspect=beamerAspects[1]
24
25if [[ $beamerAspects[(i)${2:r:e}] -le $#beamerAspects ]]; then
26 beamerAspect=${2:r:e}
27 2=${2:r:r}.${2:e}
28fi
29
30base=(${2:r}.(md|lhs|tex)([1]))
31metadata=(${2:r}.meta.yml([1]N))
23 32
24gup -u ${base} ${metadata} preamble.tex 33gup -u ${base} ${metadata} preamble.tex
25 34
@@ -39,18 +48,25 @@ if [[ -n ${metadata} ]]; then
39 input=$(mktemp) 48 input=$(mktemp)
40 cleanupList+=("rm -v ${input}") 49 cleanupList+=("rm -v ${input}")
41 50
51 typeset -a class
52 class=()
53 [[ ${base:e} == "tex" ]] && class=(-f latex)
54
42 logged pandoc -f markdown -t native -s ${metadata} | head -n -1 >>${input} 55 logged pandoc -f markdown -t native -s ${metadata} | head -n -1 >>${input}
43 logged pandoc -R -t native ${base} >>${input} 56 logged pandoc -R ${class} -t native ${base} >>${input}
44 57
45 extraArgs+=(-f native) 58 extraArgs+=(-f native)
46fi 59fi
47 60
48# logged pandoc ${extraArgs} -t latex ${base} | cat -n >&2
49
50compileDir=$(mktemp -d) 61compileDir=$(mktemp -d)
51cleanupList+=("cd /" "rm -rfv ${compileDir}") 62cleanupList+=("cd /" "rm -rfv ${compileDir}")
52 63
53logged pandoc ${extraArgs} -t latex -o ${compileDir}/${base:t:r}.tex ${input} >&2 64if [[ ${base:t:r} == "presentation" ]]; then
65 gup -u ${buildDir}/beamer-template.tex
66 extraArgs+=(--template=${buildDir}/beamer-template.tex -M "aspectratio=${beamerAspect}")
67fi
68
69logged pandoc ${extraArgs} -o ${compileDir}/${base:t:r}.tex ${input} >&2
54 70
55cd ${compileDir} 71cd ${compileDir}
56for f (bib); do 72for f (bib); do
@@ -59,6 +75,8 @@ for f (bib); do
59 logged rsync -av ${base:h}/${f} . 75 logged rsync -av ${base:h}/${f} .
60done 76done
61 77
78# cat -n ${base:t:r}.tex >&2
79
62max=5 80max=5
63runs=0 81runs=0
64run=true 82run=true