Created
January 6, 2021 18:24
-
-
Save smorad/d0e574430c4b9da5bd3818041e54fe7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
set -x | |
zipfile=$1 | |
wdir='latex_arxiv' | |
unzip $zipfile -d $wdir | |
pushd $wdir | |
svgs=$(find . -name *.svg | sed 's/.svg//') | |
epses=$(find . -name *.eps | sed 's/.eps//') | |
# Convert images | |
for s in $svgs; do | |
if [ ! -f $s.pdf ]; then | |
cairosvg $s.svg -o $s.pdf | |
rm $s.svg | |
fi | |
done | |
for e in $epses; do | |
if [ ! -f $e.pdf ]; then | |
convert $e.eps $e.pdf | |
rm $e.eps | |
fi | |
done | |
# Remove svg calls | |
texs=$(find . -name '*.tex') | |
sed -i 's/includesvg/includegraphics/' $texs | |
sed -i 's/\.svg/.pdf/' $texs | |
# Remove eps calls | |
sed -i 's/\.eps/.pdf/' $texs | |
popd | |
zip -r $wdir $wdir/* | |
echo "Results in $wdir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment