blow up the sun
This commit is contained in:
parent
ff6516fcaf
commit
4b9712881c
22
build.sh
22
build.sh
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
set +x
|
||||
pandoc --listings doc.md -o doc.tex
|
||||
pdflatex -interaction=nonstopmode main.tex
|
||||
|
||||
@ -5,26 +7,28 @@ pdflatex -interaction=nonstopmode main.tex
|
||||
pages=$(pdfinfo main.pdf | awk '/^Pages:/ {print $2}')
|
||||
|
||||
# split cover from guts to add correct signature
|
||||
pdfjam main.pdf 1,$(($pages))-$pages -o cover.pdf
|
||||
pdfjam main.pdf 1,$((pages)) -o cover.pdf
|
||||
pdfjam main.pdf 2-$((pages-1)) -o guts.pdf
|
||||
|
||||
# insert blank pages after front cover and before back cover
|
||||
# # insert blank pages after front cover and before back cover
|
||||
pdfjam cover.pdf '1,{},{},2' --outfile cover.pdf
|
||||
|
||||
# calculate pages for guts signature length
|
||||
pages=$(pdfinfo guts.pdf | awk '/^Pages:/ {print $2}')
|
||||
let rem=pages%4
|
||||
let extra=(4-rem)%4
|
||||
let sig=pages+extra
|
||||
pages="$(pdfinfo guts.pdf | awk '/^Pages:/ {print $2}')"
|
||||
rem=$((pages%4))
|
||||
extra=$((4-rem%4))
|
||||
sig=$((pages+extra))
|
||||
|
||||
# booklet print
|
||||
pdfbook2 -n --short-edge cover.pdf
|
||||
pdfbook2 -n --signature=$sig --short-edge guts.pdf
|
||||
pdfbook2 -n cover.pdf
|
||||
pdfbook2 -n --signature="$sig" guts.pdf
|
||||
# pdfbook2 -n --short-edge cover.pdf
|
||||
# pdfbook2 -n --signature="$sig" --short-edge guts.pdf
|
||||
|
||||
# put them back together!
|
||||
pdfunite cover-book.pdf guts-book.pdf print-zine.pdf
|
||||
mv main.pdf read-zine.pdf
|
||||
|
||||
# directory cleanup
|
||||
mv -t .build *.aux *.log *.out doc.tex cover.pdf guts.pdf cover-book.pdf guts-book.pdf
|
||||
mv -t .build ./*.aux ./*.log ./*.out doc.tex cover.pdf guts.pdf cover-book.pdf guts-book.pdf
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user