3

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 Sep 2 '17 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 Sep 4 '17 at 1:34
4

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 Sep 8 '17 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 Sep 8 '17 at 7:55
3

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, privacy policy and cookie policy

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