48

I'm writing a LaTeX document and am using the command line to compile the LaTeX code into a PDF document. In Linux I would just open the PDF with Evince PDF Viewer, and whenever I recompiled the LaTeX code, the PDF would refresh after a couple of seconds.

I'm now trying to do the same thing in Windows. The trouble is, whenever I have the PDF open in Adobe Reader or Foxit Reader, it doesn't even allow me to write to the PDF file. I get this error in the command line when I run pdflatex test.tex:

! I can't write on file `test.pdf'.

Is there a PDF viewer for Windows that does the following?

  1. Disables write protection when opening a PDF
  2. Auto-refreshes when a new PDF is generated
1

5 Answers 5

19

There's an Evince version for Windows.

7
  • 1
    Didn't seem to auto-refresh when I tried it, SumatraPDF worked great. May 28, 2012 at 0:45
  • I am using version 2.32.0.145 of evince, it does auto refresh the files which are generated on my Linux machine but displayed under Windows via a samba share (on a portrait monitor at 1200x1920 pixels).
    – Anthon
    Mar 26, 2013 at 8:34
  • Autorefreshes for me: win7, network drive, extremly fast -> awesome Feb 13, 2014 at 9:05
  • Autorefreshes in WSL too
    – partizanos
    Jul 23, 2020 at 23:05
  • 2
    There is no longer evince for windows. And the solution for pdf x-change seems to no longer work either, But Rob's suggestion below for Sumatra DOES.
    – Ian
    Jun 13, 2022 at 8:53
48

SumatraPDF is free, for Windows, and plays nicely with LaTeX. It will automatically refresh when the pdf is updated.

5
  • SumatraPDF works great!
    – Danvil
    Jul 4, 2012 at 11:24
  • 1
    SumatraPDF is good. but it doesn't reload opened file on NFS. Have to use Evince for that feature.
    – Jokester
    Apr 4, 2013 at 7:16
  • Sumatra seems to have an issue with Samba version 4 (not version 3) in that it does not release a file lock over the share properly on the mounted filesystem. The PDF gets updated sporadically and not reliably as over Samba 3. I am still looking for a solution for this. If I find one, I will add it here. Jan 24, 2017 at 9:48
  • It's good for a quick and dirty solution, but it lacks some features. For example, I'm going through the PDF spec right now and changing /F to 3 (bookmark should display bold and italic) has no effect... Sep 23, 2021 at 13:56
  • Sumatra used to be great. But since the current version it opens a new tab with each new version of the file. It tries to be helpful, but for my purposes isnt :). Switched to TexWorks now (answer below).
    – Aditya
    Jun 14, 2022 at 7:33
11

I know the question is old, but I think an important option is missing.

As a lot of people use MiKTeX on Windows they already have TeXworks installed. The PDF viewer included with TeXWorks does indeed refresh.

start texworks main.pdf

or right click any PDF file and select to open with TeXworks.

I'm not saying that the PDF viewer itself is the best, but it's very convenient (if you have MiKTeX) as you don't have to install yet another PDF viewer.

2

PDF-XChange Viewer has an option for this, too. Invoke from command line (cmd.exe):

pdfxcview /A "nolock=yes=OpenParameters" test.pdf

See similar question

1
  • It's not ideal: (a) can't globally start pdfxcview in that mode. Have to provide that flag together with the filename of the document. And (b) the viewer will only reload when it gets focus.
    – user643011
    Apr 4, 2018 at 18:19
1

Install WSL as Administator user in Windows 10. Install "Debian on Windows" using the Windows 10 app (not as administrator, this is not clear at all in the document or forums!!!), alternatively use Ubuntu/OpenSUSE. Install Xming for Windows 10, run it. Inside the debian command line install texlive and evince

Create a Makefile to build your tex file and bibliography:

pdflatex myfile.tex
pdflatex myfile.tex
bibtex myfile.bib
pdflatex myfile.tex

Run:

make
evince myfile.pdf &

Then you can edit the myfile.tex as many times as you like and just run make to see the automatically updated PDF in evince.

1
  • Definitely overkill if you aren't already using WSL. But if you are, then this sounds useful!
    – Paul Wintz
    Jan 26, 2021 at 5:21

You must log in to answer this question.

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