3

I am using WinEdt 7.0 and my default pdf viewer is FoxitReader. So when I press F9 (compile) in WinEdt, it compiles and shows the pdf automatically. I want to set WinEdt somehow that after some editing of the tex file, when I want to compile and view the pdf I just press the F9 and the editor automatically closes the previous pdf and shows the updated pdf afterwards.

If I try to recompile the file while the viewer is open the output would be:

I can't write on file 'filename.pdf'
please type another file name for output:

Simply I want to open/close the pdf viewer automatically from WinEdt. I think there is a script (something like that) for that (e.g. --single-instance but I couldn't get it to work).

karlkoeller
  • 124,410
NKN
  • 1,034
  • 13
  • 23

1 Answers1

2

I have to mention that so far there is no solution for conventional PDF viewers such as Adobe Acrobat Reader and Foxit Reader. However, as @Bernard mentioned, by installing SumatraPDF and setting the PDF viewer setting in the WinEdt:

Execution Modes > PDF Viewer > "C:\Users\NKN\Documents\SumatraPDF-3.1.1\SumatraPDF.exe" 

now the system reopens and updates the PDF even if it was already open.

As a final point, although this question was posted in 2014, the problem still remains (in 2017) even with newer versions of WinEdt (9.1/10), Foxit Reader, and Adobe Reader.

NKN
  • 1,034
  • 13
  • 23
  • 1
    Evince is also an option though the windows build is way out of date. What's really annoying is that foxit didn't block the pdf file from being overwritten, until some time in about 2012/2013 when it started to. I got in touch with them when the change happened, and got a pleasant enough but unhelpful reply – Chris H Jan 26 '17 at 16:20
  • @ChrisH Evince cannot be controlled through DDE, so I don't think it's a good option for working with WinEdt. – karlkoeller Jan 26 '17 at 17:57
  • Adobe Reader supports DDE so it can be controlled by WinEdt, although it doesn't support forward/inverse search. Foxit is not controllable at all... – karlkoeller Jan 26 '17 at 17:59
  • @karlkoeller, my point was that by not blocking the file, and automatically refreshing (while staying on the same page), it allows you to overwrite the pdf without closing and reopening. In that respect it's like sumatra. DDE is a red herring as regards what the OP was looking for (stopping the "I can't write..." error) and only becomes relevant for searching – Chris H Jan 26 '17 at 19:14
  • @ChrisH OK, got it. – karlkoeller Jan 26 '17 at 19:16