Created
October 19, 2020 20:39
-
-
Save sijanec/0f5cbc2d894d74f48df80e35838ac967 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
#!/bin/bash | |
# this is what my vimrc does for tex documents with do-vimlatex-onwrite on write. | |
SECONDS=0 # bash time counter | |
pdflatex -synctex=1 -interaction=nonstopmode --shell-escape $1.tex # >> %:p:h/pdflatex.log 2>> %:p:h/pdflatex.log & | |
podofouncompress $1.pdf $1-uncompressed.pdf | |
sed -e "s/aaasecgeninsaaa/$SECONDS/g" <$1-uncompressed.pdf >$1-modified.pdf | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$1-recompressed.pdf $1-modified.pdf | |
mv $1-recompressed.pdf $1.pdf | |
rm $1-uncompressed.pdf $1-modified.pdf | |
wid=`xdotool search --name "Mozilla Firefox" | head -1` | |
wid_current=`xdotool getactivewindow` | |
xdotool windowactivate $wid | |
xdotool key F5 | |
xdotool windowactivate $wid_current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment