I have been using the latest version of Spacemacs, with AUCTeX. However, when I compile the .tex file into a .pdf file, it opens in my default external PDF viewer software. Is there a way to make LaTeX compile into pdfs that get opened in another Spacemacs buffer and framewindow?

My computer runs Windows 10 64 bits.

  • 1
    pdftools will do this. See the github page for compiling on Windows.
    – Dan
    Commented Sep 2, 2017 at 16:55
  • @Dan thanks for the suggestion. I will give it a try, even if I still do not understand why is that needed, since in most if not all screenshots of AUCTeX in action, PDFs seem to be displayed embedded, not in an external window.
    – Louis15
    Commented Sep 4, 2017 at 1:34

2 Answers 2


It's been ages since I set this up for myself, but here's the code I use. Essentially, it's just registering Emacs itself (or, rather, emacsclient) as an external viewer.

(add-to-list 'TeX-view-program-selection '(output-pdf "Emacs"))
(add-to-list 'TeX-view-program-list '("Emacs" "emacsclient -n %o"))

Caveats: I don't know if this will work properly if you're not using emacsclient, and I don't know how it will interact with Spacemacs.

  • Thanks for your answer. Unfortunately, though, it seems to nor work in Spacemacs
    – Louis15
    Commented Sep 8, 2017 at 1:06
  • Can you open PDFs with Emacs at all? If so, Aaron's answer should work. If not, the problem may be limitations with Windows, rather than spacemacs
    – Tyler
    Commented Sep 8, 2017 at 7:55

Here is how I ended up solving the problem:

(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
  TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))
  TeX-source-correlate-start-server t

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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