weixin_39674028
weixin_39674028
2020-11-29 23:46

Sumatra PDF does not reload document on compile

The first time I compile a LaTeX document, the PDF opens in Sumatra PDF, scrolled to the position of my furthest edit since my last compilation. After this, if I make changes to my LaTeX document and compile it again, the section of the PDF where my edit was performed is scrolled into view and highlighted momentarily in Sumatra PDF, but the new PDF isn't actually loaded. I have to manually reopen the document in Sumatra PDF in order to see my changes.

Sublime Text 3.1.1, Build 3176 Sumatra PDF 3.1.2 LaTeXTools 3.15.1 Windows 10 Enterprise (1709)

该提问来源于开源项目:SublimeText/LaTeXTools

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

24条回答

  • weixin_39893274 weixin_39893274 4月前

    Thanks for your observation, For me using a NTFS usb drive I have not seen an issue, can you confirm if your usb is standard FAT / FAT32 format, rather than NTFS ?

    点赞 评论 复制链接分享
  • weixin_39563827 weixin_39563827 4月前

    I was having the issue with NTFS. The secret is probably something with either the usb protocol itself, or the usual slower speed of external drives.

    点赞 评论 复制链接分享
  • weixin_39893274 weixin_39893274 4月前

    So If I am reading you right for you Windows 10 external NTFS usb drive is not working same as Windows 7 external NTFS usb drive That could explain some user differences (I cannot remember if it was on 7 or 10 that I last tested whilst using LatexTools)

    点赞 评论 复制链接分享
  • weixin_39893274 weixin_39893274 4月前

    Sorry to trouble you but I no longer have the current ability to run tests using LatexTools Today's 64bit daily build https://www.sumatrapdfreader.org/dailybuilds.html has an extra ability to detect any mismatch in UAC levels it would be interesting to know if running that version on both 7 and 10 with LatexTools thows up any related error messages. P.S. Sorry again todays build did not complete The next valid one after may take a while :-{

    点赞 评论 复制链接分享
  • weixin_39563827 weixin_39563827 4月前

    No, I'm saying that I was having this issue with sumatrapdf on a NTFS drive. Therefore, I was guessing some race condition could be involved.

    点赞 评论 复制链接分享
  • weixin_39822443 weixin_39822443 4月前

    Thanks for your observation, For me using a NTFS usb drive I have not seen an issue, can you confirm if your usb is standard FAT / FAT32 format, rather than NTFS ?

    It's exFAT.

    点赞 评论 复制链接分享
  • weixin_39893274 weixin_39893274 4月前

    Thanks as that generally would be unsupported

    To be clear are you saying the previous "race" behaviour is no longer a problem?

    After yesterdays issues the compiler ran today, so to repeat myself "Sorry to trouble you but I no longer have the current ability to run tests using LatexTools Today's 64bit daily build https://www.sumatrapdfreader.org/dailybuilds.html has an extra ability to detect any mismatch in UAC levels it would be interesting to know if running that version on both 7 and 10 with LatexTools thows up any related error messages.

    Are you in a position to use the current daily version and see if any issues occur ?

    点赞 评论 复制链接分享
  • weixin_39531992 weixin_39531992 4月前

    I also meet such a problem on version 3.2 when compiling by VScode. I tried to set both VScode (code.exe) and SumatraPDF.exe as "Run this program as an administrator" in the compatibility settings. This seems useless. It shows [Change detected; refreshing] but nothing changes.

    The new version is OK!2020-08-03, commit 66517e5bf34cc289cf400fbab3f9b253383d3d37:

    点赞 评论 复制链接分享
  • weixin_39893274 weixin_39893274 4月前

    -Chao-Liu Thanks for feedback, your observation thus sugests it could either be UAC or another recent change makes a difference NOTE there were other changes related to storing changes to settings file in https://github.com/sumatrapdfreader/sumatrapdf/commit/351f73d1e2b8269b3a6262987e72c3ea21727fd0 that may have helped

    点赞 评论 复制链接分享
  • weixin_39724889 weixin_39724889 4月前

    Did you find out how to fix it? I have the same issue.

    点赞 评论 复制链接分享
  • weixin_39640543 weixin_39640543 4月前

    In the sumatra pdf advanced settings there should be a line ReloadModifiedDocuments = true, which tells Sumatra to automatically reloads documents. This doesn't seem to work if the pdf file is bigger than 10 MB.

    点赞 评论 复制链接分享
  • weixin_39724889 weixin_39724889 4月前

    My file is smaller than 10MB and ReloadModifiedDocuments is set as "true" but I am still having the issue.

    点赞 评论 复制链接分享
  • weixin_39640543 weixin_39640543 4月前

    Sorry then I also don't know whats the problem.

    点赞 评论 复制链接分享
  • weixin_39724889 weixin_39724889 4月前

    Thank you, though.

    点赞 评论 复制链接分享
  • weixin_39585974 weixin_39585974 4月前

    I have the same problem. Has anyone resolved this?

    点赞 评论 复制链接分享
  • weixin_39563827 weixin_39563827 4月前

    Options really aren't it, because I have the same exact ones with the exact same builds on two computers, and yet one works the other doesn't. So: either it could be some magic in the slightly different latex environment I have here, who knows.. or way more probably it's a W10 problem (because it sure is perfect on W7)

    In fact something similar happens almost by design on non-ntfs filesystem, since the program is entirely dependent on some notifications the OS doesn't send https://github.com/sumatrapdfreader/sumatrapdf/issues/596

    点赞 评论 复制链接分享
  • weixin_39563827 weixin_39563827 4月前

    Jesus, the more I try, the less I think to know. Possible stuff * Windows api shenanigans (it wouldn't be the first api they broke randomly) * indeed, half of the dll sumatra gets to load are different between w7 and w10 * Sumatra has some broken code, or it has some bitterness for some hardware * e.g. they have a sleep thread, and ~~on super crazy fast disks (indeed, my nvme can hit upward of a GB/s)~~ some race condition may be hit

    Make even 3 the number of pcs I tried. All of those with a problem are on w10.

    点赞 评论 复制链接分享
  • weixin_39901332 weixin_39901332 4月前

    This happens to me as well. In my experience it seems to occur most often when the files are hosted on a cloud drive (google drive in particular). Could this point toward the source of the issue?

    点赞 评论 复制链接分享
  • weixin_39817122 weixin_39817122 4月前

    I confirm that it's not working on a Google Drive (File Stream) in my case with Windows 10. When the PDF file is modified on a true local drive, updating works.

    I took a Pandoc project and moved it from Google drive folder to my Downloads folder. I applied my workflow and automatic reloading is working.

    点赞 评论 复制链接分享
  • weixin_39893274 weixin_39893274 4月前

    the above different issues are in the main due to secondary non NTFS locations seperate individual problems may be due to using cloud drives / exFAT

    One seperate issue is offline/removed network drives (NTFS or not) / redundant file entries

    Perhaps consolidate this issue with https://github.com/sumatrapdfreader/sumatrapdf/issues/596 & https://github.com/sumatrapdfreader/sumatrapdf/issues/580

    点赞 评论 复制链接分享
  • weixin_39563827 weixin_39563827 4月前

    Indeed, nobody before my posts was mentioning network disks.

    Btw, I was trying to reproduce the bug "more simply" in a VM (without having to go through installing all the latex cruft).. But somehow using the normal copy command to overwrite files in place isn't enough to make it fail. Sumatra just refreshes as it is expected.

    点赞 评论 复制链接分享
  • weixin_39893274 weixin_39893274 4月前

    Although it possibly does not help in this case where cached files are apparently not perceived by SumatraPDF as updated in the file system, thus they manually require pressing R to refresh.

    It may be useful to know that the upcoming 3.2 release has been updated to increase the locking boundary from 10 Mb to 32 Mb.

    SumatraPDF can only be expected generally to monitor and see file changes that affect the file status in the MFT, If you think there are reasonable usage cases where a cloud drive provides a valid signal that can be added for monitoring then please consider providing details by raising an issue at https://github.com/sumatrapdfreader/sumatrapdf/issues?utf8=%E2%9C%93&q=is%3Aissue++sort%3Aupdated-desc+network

    点赞 评论 复制链接分享
  • weixin_39563827 weixin_39563827 4月前

    I'm saying that aside of the two posts between your and mine, my personal understanding was that this issue was indeed only about changes on a local file system on a local NTFS disk not being detected.

    But for me to really pin it down (so it can be understood, and perhaps fixed), I needed to see what was the big deal between my W7 desktop where everything is just fine and my W10 laptop which doesn't work.

    ... Though you mentioned the MFT now, and after a brief search, I could find out this. Specifically "the usage of copy command modifies one additional timestamp in case of Windows 7 (the entry date timestamp of $STANDARD_INFO)"... so, I don't know. Perhaps there is more to it.

    点赞 评论 复制链接分享
  • weixin_39822443 weixin_39822443 4月前

    I had the same issue when the .tex files were on a USB driver. Moving them on to the laptop solved this for me.

    点赞 评论 复制链接分享