Skip to content

Instantly share code, notes, and snippets.

@pcapriotti
Created December 7, 2016 18:20
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 pcapriotti/8df7eb193470497f759ffa203e2ebcaf to your computer and use it in GitHub Desktop.
Save pcapriotti/8df7eb193470497f759ffa203e2ebcaf to your computer and use it in GitHub Desktop.
ArXiv submission script
#!/bin/bash
# prepare submission tarball for arXiv.org
set -e
usage() {
echo "Usage: $0 DEST SOURCE..."
exit 1
}
on_exit() {
[ -z "$tmpdir" ] || rm -fr "$tmpdir"
}
[ "$#" -gt 1 ] || usage
out="$1"
shift
basedir="$PWD"
tmpdir=`mktemp -d`
trap on_exit EXIT
cp "$@" "$tmpdir"
cd "$tmpdir"
sed -i '1 a \\\\pdfoutput=1' *.tex || true
zip -r "$basedir/$out" .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment