Tuesday, November 28, 2006

Watching file fails in kghostview?

I got very annoyed with a bug in kghostview. So typically I am writing a paper or slides in LaTeX and running something like

latex mypaper; dvipdf mypaper

I have a kghostview window open on mypaper.pdf with the "watch file" setting so it automatically updates. Even the latest acrobat reader lacks such a simple and useful feature so that is of no use. Now maybe my computer is faster, or my files bigger, but for whatever reason on my laptop running Mandriva Linux 2006 kghostview generates several annoying message boxes telling me it can't find "myfile.pdf". All of which have to be closed manually.

As a quick fix I do something like

latex mypaper; dvipdf mypaper temp.pdf; mv -u -f temp.pdf mypaper.pdf

no of course I don't have to keep typing the line. I "up arrow" in the shell, or you can automate in a script or in your favorite editor. The -f is so it does not ask me to overwrite but the -u is so it only updates if newer (just in case something has gone wrong). Anyone any better ideas? If I knew where to set it I could change the interval kghostview waits before checking the file.