#!/bin/sh -efu

cat <<EOF - "$1" | gs -sDEVICE=nullpage -dBATCH -q -dNOPAUSE - | sed -e "s/\[..\]\[\(..\)\]{\(.*\)'\(.*\)}/\[\2\]\[\1\]{\\\\\3}/"
/show { dup (\\\\psfrag{) print print (}[cc][cc]{) print print (}\\n) print} bind def
EOF

