0

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?

  • 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 Oct 22 '18 at 12:34
  • 1
    @daleif It's only the Windows operating system which has this ridiculous concept of file locks at all. – Henri Menke Oct 22 '18 at 12:53
  • @HenriMenke doesn't it lock on mac as well? – daleif Oct 22 '18 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 Oct 22 '18 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 Oct 22 '18 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.