Hello:)
First I do not understand the changes in this script.
Certain users prefer to work with latex but without pstricks, why not make two different scripts.
There is a little change in one line :
now if [ -s "${PDF}" -a ! "$PDF" -ot "$FILE" ]; then
before if [ -s "${PDF}" -a "$PDF" -nt "$FILE" ]; then .....
-ot instead -nt ? why ?
Greetings Alain Matthes