Skip to content

Instantly share code, notes, and snippets.

@IdlePhysicist
Created May 28, 2019 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IdlePhysicist/efc9f68e87eaf50716175dfe246d4fb3 to your computer and use it in GitHub Desktop.
Save IdlePhysicist/efc9f68e87eaf50716175dfe246d4fb3 to your computer and use it in GitHub Desktop.
.md -> .pdf
#!/bin/bash
pdf () {
pandoc $1 -s --template cave-log.tex \
-o ${1%.*}.pdf --latex-engine=xelatex
}
xerox () {
convert -density 150 ${1%.*}.pdf \
-rotate 0.5 \
-attenuate 0.7 \
+noise Multiplicative \
-colorspace Gray ${1%.*}.pdf
}
echo "Converting markdown"
pdf $1
if (( $# > 2)); then
break
else
echo "Xerox-ing the output"
xerox $1
fi
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment