Skip to content

Instantly share code, notes, and snippets.

@mlund
Created January 12, 2013 09:53
Show Gist options
  • Save mlund/4517019 to your computer and use it in GitHub Desktop.
Save mlund/4517019 to your computer and use it in GitHub Desktop.
Simplistic shell script to convert xmgrace (.agr files) figures to PDF. White borders will be removed in the conversion process using `pdfcrop`
#!/bin/bash
tmpfile=".tmp.pdf"
if [ $# -ge 1 ]; then
if [ $1 != "-h" ]; then
outfile=`dirname $1`/`basename "$1" \.agr`.pdf
LANG=en xmgrace -hardcopy -hdevice PDF $1 -printfile $tmpfile
pdfcrop $tmpfile $outfile
rm -f $tmpfile
exit
fi
fi
echo "Usage: `basename $0` file.agr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment