atom-pdf-view
atom-pdf-view copied to clipboard
auto-reload on update doesn't not work
I use auto-pdf-view together with latex tool in atom on win10. When latex file is updated and rebuilt, the pdf file is updated however not reloaded in the pdf-viewer panel. It has to manually close the tab and reopen in order to view the latest file....
I confirm this behaviour on Linux. However this might not be due to pdf-view
but to the latex
plugn or latexmk
. Indeed, if you open the result pdf in a file manager (nautilus) then it does not reload automatically after build (where it used to). May it be that the copying from the latex
plugin from .build/main.pdf
to main.pdf
doesn't notify the system for a file change ?
OK, my bad. It seems I had not enough inotify watches. I did the following and it fixed my problem:
echo "fs.inotify.max_user_watches=204800" | sudo tee -a /etc/sysctl.d/90-override.conf
I am also not getting the pdf to update after recompiling. I have to close the file and reopen.
I have the exact same issue on two of my Windows 10 machines.
Same here on Debian 10
Same here on macOS Catalina, pdfs reload automatically in external Preview but not in pdf-view.
In the meantime, I made my own PDF viewer package for Atom:
https://atom.io/packages/pdfjs-viewer
It is designed as a drop-in replacement for pdf-view, and supports automatic reloading, as well as a bunch of other features. Feedback welcome.
Looks fantastic!
Fully functional, auto-update issue is solved on pdfs-viewer.
Thanks Carsten!
@micahjsmith glad you like it!
@allefeld Looks cool, although I'm finding the same issue on macOS Catalina: pdf refreshes in the Preview app after a new tex build, but does not reload in the pdfjs-viewer interface.
@WSDeWitt could you open the developer tools and see whether there are any error messages at the time the PDF is opened, and at the time it should be reloaded?
It can also depend on the way the pdf is recreated. If the file is first deleted, and then created again, file watching fails because it is based on inodes.
In any case, feel free to create an issue on my repository.
@allefeld Thanks! Indeed this seems related to the pdf recreation method. I am using SCons for TeX build, which by default deletes targets before rebuilding. This SCons behavior can be prevented with the Precious
function. This solves the refresh issue in atom-pdf-view
, but causes an error in pdfjs-viewer
(I will create an issue on that repo).