4

If I compile a .tex document using PDFLatex (i.e. the compilation ultimately produces a .pdf), and I have a pdf of the same name open in Adobe Acrobat, the compile will throw an error, asking for a different name for the output .pdf. However, if I attempt to accomplish the same task with the document open in Sumatra, the compilation happens without a problem, and the .pdf refreshes in Sumatra.

Obviously, this is something about the way the two different programs work. I assume that for some reason Sumatra loads a version of the file into memory, but then closes the file allowing it to be edited by LaTeX, while Acrobat keeps the file open. Why the difference? What are the advantages and disadvantages of each approach? Most .pdf readers seem to handle .pdfs like Acrobat, but are there others who do it like Sumatra?

10
  • 2
    Adobe reader locks the file, essentially making it read only, for other programs. Since Adobe reader/acrobat can edit the file, it makes sense to not allow others that access when the file is open.
    – daleif
    Commented Oct 22, 2018 at 12:34
  • 2
    @daleif It's only the Windows operating system which has this ridiculous concept of file locks at all. Commented Oct 22, 2018 at 12:53
  • @HenriMenke doesn't it lock on mac as well?
    – daleif
    Commented Oct 22, 2018 at 13:11
  • NOTE there is a working unlocked cache limit of 10Mb beyond which even SumatraPDF will need the PDF to be closed before a fresh compile. However if the file is the same name then with forward search it should open at the same location if remember settings is on. So if you have a large PDF file (due to high density images) it may be worth using image placeholders until the final compile.
    – user170109
    Commented Oct 22, 2018 at 14:58
  • @KJO " there is a working unlocked cache limit of 10Mb ... "Are you sure? I've recently created a 46Mb PDF viewed with Sumatra (v3.1.2 64-bit Windows) with no apparent problems when recompiling it while viewing it.
    – alephzero
    Commented Oct 22, 2018 at 15:53

1 Answer 1

3

This is now a super old question, but I have an answer that merits inclusion.

  1. Why does Sumatra allow you to compile a file while open? Because Sumatra loads the file and works on the loaded version of the file, rather than locking the current file to prevent conflicts. For Sumatra, this isn't much of a problem, because you cannot really edit the file in Sumatra, but is probably not possible without creating conflicts in files you can edit.
  2. Are there other readers that behave the same way? Yes! Okular, which has most of the utility of Sumatra and you can include comments and it works on Linux, Windows and Mac. In general, Okular is an amazing FOSS program.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .