8

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

Daniel
  • 1,816
  • 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 http://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 00:15
  • The key you're looking for is W; use C-h m (or just ?) from within doc-view-mode for a good summary of commands ;). I'll draw up a good answer here shortly. – Sean Allred Jun 27 '14 at 00:16
  • If I ever get it to work…
  • – Sean Allred Jun 27 '14 at 00:30
  • @SeanAllred Hint: the second element of an entry of TeX-view-program-list can be a function, see for example the Evince entry in TeX-view-program-list-builtin :-) – giordano Jun 27 '14 at 08:22
  • @Daniel Is there a particular reason why you want to use doc-view-mode? Why not using a full-fledged viewer? – giordano Jun 27 '14 at 08:23
  • @giordano, there is a full-fledged viewer? I have no idea, I just like the way that doc-view's pdf displayed side by side with the tex file. – Daniel Jun 27 '14 at 13:14
  • What @giordano means is a conventional viewer such as evince or skim. There is something to be said for keeping everything in-house though using DocView (especially with auto-revert-mode). And I did try to get the function thing to work on my own, but having an example will be very helpful. I'll see if I can cook something up when I get home. – Sean Allred Jun 28 '14 at 17:39
  • 1
    @SeanAllred If your cooking experiments will fail, I'll try to check it out ;-) – giordano Jun 28 '14 at 17:58
  • @Daniel this question may interest you: http://tex.stackexchange.com/q/190882/31416 – giordano Jul 11 '14 at 13:52
  • @giordano I'm sorry, I'm not using a mac. but in my emacs, docview is default now. From the commands available, mostly xelatex and lualatex are unavailable, thus pdflatex or latex are being replaced manually. Next C-c C-c defaults, as expected, to docview in the other buffer. the output after compiling with xelatex or lualatex in docview buffer, is satisfactory. Is this the current behavior with the latest bzr emacs? – doed Sep 09 '14 at 08:59
  • @doed Sorry, I don't use bzr Emacs. – giordano Sep 09 '14 at 09:25
  • @giordano okay. I don't understand. – doed Sep 09 '14 at 09:58
  • @giordano I'm afraid what happened with my configuration,does not pertain to the question. But it's somehow related, since it affected the output of the document. Apparently, xemacs failed in more than two instances, resulting in the omission of my .emacs init file, which of course, resulting in auctex.el not longer being loaded. unmigrate also failed from xemacs. And so did my search, to find out, what had happened. Unfortunately xemacs has failed to compile due to a lone star error mesage, which had left me no choice but installing the ubuntu compiled version. – doed Sep 14 '14 at 03:18
  • ... hence the assumption at first, whether some changes had been made in emacs itself. (load "auctex.el nil t t) was no longer in the initialization file, for there was none to start with. – doed Sep 14 '14 at 03:21