atom-pdf-view icon indicating copy to clipboard operation
atom-pdf-view copied to clipboard

auto-reload on update doesn't not work

Open glglgithub opened this issue 6 years ago • 12 comments

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....

glglgithub avatar Jul 02 '18 04:07 glglgithub

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 ?

ptitjes avatar Jul 09 '18 12:07 ptitjes

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

ptitjes avatar Jul 09 '18 12:07 ptitjes

I am also not getting the pdf to update after recompiling. I have to close the file and reopen.

wsdewitt avatar Aug 07 '18 19:08 wsdewitt

I have the exact same issue on two of my Windows 10 machines.

jackbshim avatar Mar 28 '19 02:03 jackbshim

Same here on Debian 10

allefeld avatar Dec 29 '19 18:12 allefeld

Same here on macOS Catalina, pdfs reload automatically in external Preview but not in pdf-view.

micahjsmith avatar Jan 17 '20 13:01 micahjsmith

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.

allefeld avatar Jan 17 '20 19:01 allefeld

Looks fantastic!

Fully functional, auto-update issue is solved on pdfs-viewer.

Thanks Carsten!

micahjsmith avatar Jan 17 '20 20:01 micahjsmith

@micahjsmith glad you like it!

allefeld avatar Jan 17 '20 20:01 allefeld

@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 avatar Jan 17 '20 23:01 wsdewitt

@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 avatar Jan 18 '20 16:01 allefeld

@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).

wsdewitt avatar Jan 18 '20 20:01 wsdewitt