Newbie here. I have just installed emacs/auctex on my mac. I don't like xdvi to view the dvis, I like to use emacs' builtin pdf viewer to view pdf on its own split window on the right. It used to be so with emacs if I remember correctly, but after I installed the auctex, it seems it by default is using the xdvi. How can I switch back to use doc-view-mode to view my pdf then? Thanks

  • 1
    Do you mean to see that AUCTeX's compilation keystrokes are producing DVI output? Set TeX-PDF-mode to t (or just call it as a function, or use C-c C-t C-p). You may also be interested in tex.stackexchange.com/a/165645/17423. – Sean Allred Jun 26 '14 at 23:25
  • Oh, I see. Why then it by default is using evince on mac? How to change it back to doc-view? Sorry, I'm completely newbie on this – Daniel Jun 26 '14 at 23:38
  • 1
    Don't worry about it—I was right there with you a year or two ago. There might be a way to customize TeX-view-program-list to use find-file on the PDF (normally given by the format string %o). – Sean Allred Jun 26 '14 at 23:50
  • @SeanAllred, would you pls elaborate on the TeX-view-program-list, like step-1, step-2, step-3... Thanks. And beside, what's frustrating is to see the pdf file though C-x C-f, is not width fit. And I can't find any button to make it fit width... – Daniel Jun 27 '14 at 0:15
  • 1
    @SeanAllred If your cooking experiments will fail, I'll try to check it out ;-) – giordano Jun 28 '14 at 17:58

Try the following:

  1. Customize Tex View Program List

    • insert a new entry, with name set to Emacs (or any other meaningful word)
    • for the associated value menu, choose Command, and set the value to emacsclient %o
    • you may need to kill and restart Emacs for this to take effect
    • you will definitely need to start an Emacs server: either start emacs as emacs --daemon, or add (server-start) to your .emacs.
  2. Customize TeX View Program Selection

    • look for the entry for output-pdf
    • from the value menu for that entry, select Emacs

This works for me here on Emacs with Auctex 2014-02-04 from Melpa.

  • I did as instructed, but cannot find Emacs in the final value menu. – Schneider Jun 14 '18 at 16:05

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.