Skip to content

Instantly share code, notes, and snippets.

@MInner
Last active November 25, 2021 23:40
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 MInner/d31604fb0b10c25a99dfe414ba3406eb to your computer and use it in GitHub Desktop.
Save MInner/d31604fb0b10c25a99dfe414ba3406eb to your computer and use it in GitHub Desktop.
prepare_images_for_arxiv.sh
find . -name '*.png' | while read line; do echo ${line}; convert -resize 70% ${line} ${line}.small.png; pngquant --speed 1 ${line}.small.png -o ${line}.quant.png; done
find . -name '*.small.png' | while read line; do rm $line; done
read -p "Press [Enter] if you are happy with *.quant.png images, otherwise press Ctrl-C."
find . -name '*.quant.png' | while read line; do mv ${line} ${line:0:-10}; done
for EXT in png pdf; do find -name "*.${EXT}" | while read line; do echo $line; done; done | while read line; do if ! grep -q -r --include \*.tex ${line#*/} .; then echo ${line}; rm ${line}; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment