#!/bin/bash
-if [ ! -e $(which pdfnup) ]; then
+set -euo pipefail
+
+if [ ! -e $(which pdfjam) ]; then
echo "missing texlive-extra-utils"
exit 1
fi
-pdfnup --nup 1x3 --suffix 1x3 --letterpaper --no-landscape --offset "-3cm 0cm" --delta "0cm 0cm" --scale 0.9 $1
+infile=${1-}
+outfile="$(basename ${infile} .pdf)-1x3.pdf"
+
+pdfjam \
+ --nup 1x3 \
+ --letterpaper \
+ --no-landscape \
+ --offset "-3cm 0cm" \
+ --delta "0cm 0cm" \
+ --scale 0.9 \
+ --outfile "${outfile}" \
+ "${infile}"
#!/bin/bash
-pdfnup --nup 2x3 --suffix 2x3 --letterpaper --no-landscape $1
+set -euo pipefail
+
+if [ ! -e $(which pdfjam) ]; then
+ echo "missing texlive-extra-utils"
+ exit 1
+fi
+
+infile=${1-}
+outfile="$(basename ${infile} .pdf)-2x3.pdf"
+
+ #--offset "-3cm 0cm" \
+ #--delta "0cm 0cm" \
+ #--scale 0.9 \
+pdfjam \
+ --nup 2x3 \
+ --letterpaper \
+ --no-landscape \
+ --outfile "${outfile}" \
+ "${infile}"
+