Skip to content

Instantly share code, notes, and snippets.

@yangl1996
Created April 23, 2019 23:03
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 yangl1996/6a4fa7b3e0ecf0a5755b23d50ba57b0c to your computer and use it in GitHub Desktop.
Save yangl1996/6a4fa7b3e0ecf0a5755b23d50ba57b0c to your computer and use it in GitHub Desktop.
Print slides in 2-up format
#!/bin/bash
# requires pdfjam from MacTeX, install thru tlmgr
for filename in "$@"
do
echo "Laying out $(basename $filename)"
outpath="$(dirname $filename)/$(basename $filename .pdf)_layout.pdf"
pdfjam $filename --nup 1x2 --outfile $outpath &> /dev/null
echo "Output written to $outpath"
lpr -P "CSAIL_G9_Xerox" -o sides=two-sided-long-edge $outpath
echo "Job sent to printer"
rm $outpath
echo "Deleted layout result"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment