Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need help using the View command in Auctex running in emacs. This is essential for viewing pdfs and without it I can not make TeX documents. In my emacs file I have the following (which was created by M-x customize-variable):

 ;; custom-set-variables was added by Custom.                                            
 ;; If you edit it by hand, you could mess it up, so be careful.                         
 ;; Your init file should contain only one such instance.                                
 ;; If there is more than one, they won't work right.                                    
 '(TeX-view-program-list (quote (("Preview" "\"open -a %o\""))))

Now I open up a .tex document and enter C-c C-c (I have already compiled):

Emacs gives: Command: (default View)

I hit enter

Emacs gives this default command: View command: dvi2tty -q -w 132

I hit enter and emacs says: View: done. but displays nothing in a pdf reader!

dvi2tty is intended for text only devices, and the command actually creates a new buffer in emacs which attempts to display the pdf file (it is very messy). Anyway, if I replace dvi2tty -q -w 132 with `open -a %o' (I am running Mac os X 10.8.4 and Preview is the name of the default pdf reader) then Preview opens the pdf!

  1. How do I change the default View command from dvi2tty -q -w 132 to open -a %o?

All help is greatly appreciated!

share|improve this question
up vote 1 down vote accepted

I got lucky and found a solution!

Follow these steps

  1. M-x customize-variable
  2. Emacs gives: Customize variable: Enter: TeX-command-list
  3. Search for View (enter C-s and then type `View)
  4. Emacs will take you to the view command where you can enter text.

It will look something like this (after Command there will be a place for text entry):

[INS] [DEL] Name: View                                                                                 
            Command: open -a %s.pdf                                                        
            How: [Value Menu] TeX-run-command                                                          
            Create a process for NAME using COMMAND to process FILE. More                              
            Prompt: [Toggle]  on (non-nil)                                                             
            Modes: [Value Menu] All                                                                    
            Menu elements:                                                                             
            [INS] [DEL] Lisp expression: :help                                                         
            [INS] [DEL] Lisp expression: "Run Text viewer"

Change the text after Command: to whatever you need. This will automatically change your ~/.emacs file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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