2

I'm in Windows 7 (32 bit) and I'm using Emacs 24.4 where I have, among other things, Org 8.2.

I'd like to open pdfs in Sumatra PDF after exporting *.org files to pdf via *.tex. So I read this other discussion, and I wrote in my .emacs config file the following code similar to what's written under the "Tricks" paragraph:

(eval-after-load "org" '(progn (setcdr (assoc "\\.pdf\\'" org-file-apps) "sumatra PDF %s")))

I know it's not correct because when I export (C-c C-e l o) from org to pdf, it doesn't open the pdf in Sumatra PDF. I have the configuration for tex --> pdf fw/backwrd sync b/w AUCTeX and Sumatra -- it works perfectly. I'd like the same for org and Sumatra too. Is it possible? If not, just opening with Sumatra instead of Adobe Acrobat Reader will do. Can someone please help me out here?

  • Might it be that the space between sumatra and PDF is superfluous. Shouldn't it read "SumatraPDF %s" instead of "sumatra PDF %s"? – Tobias Jan 22 '16 at 19:48
  • Didn't work. Messages buffer says: "Process completed. Running SumatraPDF "c:\home\projects[path]\URM.pdf"...done user-error: Minibuffer window is not active". What can that mean? – WobblyWindows Jan 22 '16 at 20:21
  • 1
    Hm. You get that Minibuffer message in the case that you double-click into the minibuffer (bottom-line of emacs) when it is not waiting for input. Try to start SumatraPDF from eshell or term. Does that work? Make sure that SumatraPDF is the right name. Is it in %PATH%? – Tobias Jan 22 '16 at 20:29
  • I did not have the path file to Sumatra PDF in Windows' %PATH% Environment Variable (My Computer > System Properties > Advanced Syst settings > Environment variables > User variables > PATH). So I added C:\Program Files\SumatraPDF\; which is where SumatraPDF.exe is but so far the response from emacs hasn't changed a bit! – WobblyWindows Jan 22 '16 at 20:56
  • Got it! I needed to restart the machine. Maybe if you put your suggestion as an official 'answer' I can accept it. Thank you. – WobblyWindows Jan 23 '16 at 9:46

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.