PDF management
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install gs
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Missing implementation"
fi
# shrink PDF
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=output.pdf input.pdf
# merge PDFs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf source1.pdf source2.pdf source3.pdf