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).

  • What happens if you compile the tex file with the pdf file opened? Is not enough just use Alt+Tab to call the viewer with updated file? – Sigur Jan 7 '14 at 22:05
  • 7
    What don't you use SumatraPDF which doesn't lock your pdf file and lets you do direct and inverse search? It doesn't require to be the default pdf viewer in order to use it with WinEdt. – Bernard Jan 7 '14 at 22:50
  • 1
    Foxit can not be controlled by DDE, so WinEdt is not able to close it before compiling. I suggest you to follow @Bernard's suggestion. – karlkoeller Jan 8 '14 at 6:33
  • @karlkoeller Please write an answer to remove this question from the unanswered list. – Arzigoglu Jan 26 '17 at 12:51
  • @Arzigoglu An answer by the OP is already there... – karlkoeller Jan 26 '17 at 17:56
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.

  • 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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.