0

I use Emacs on Mac, and I use AUCTeX to edit TeX files. I use auto-complete-auctex, too.

If I use C-c C-v just after opening a TeX file, a PDF file opens.However, if I use C-c C-v after compiling, a DVI file opens. I want to use only PDF files to preview. How can I achieve this?

Here are my settings:

;; Automatic Parsing of TeX files.
(setq TeX-parse-self t)

;; latexmk
(auctex-latexmk-setup)

;; auto-complete
(require 'auto-complete-auctex)

(eval-after-load "tex"
  '(progn
     (setq TeX-command-default "LatexMk")
     (setq TeX-view-program-list '(("Skim" "/usr/bin/open -a Skim.app %o")))
     (setq TeX-view-program-selection '((output-dvi "Skim")
                                        (output-pdf "Skim")))
     (define-key LaTeX-mode-map (kbd "C-c j") 'latex-math-preview-insert-symbol)))
itsjeyd
  • 5,070
  • 2
  • 30
  • 49
nohm
  • 101
  • 1
  • Thanks for an answer, but I found a solution by myself. ` (setq TeX-view-program-list '(("Skim" "/usr/bin/open -a Skim.app %o") ("Skim-dvi" "f=%o; open -a Skim.app \"${f%.dvi}.pdf\""))) (setq TeX-view-program-selection '((output-dvi "Skim-dvi") (output-pdf "Skim")))` – nohm Mar 31 '14 at 14:27
  • By using either `(TeX-global-PDF-mode t)` or `(add-hook 'LaTeX-mode-hook (lambda () (setq TeX-PDF-mode t)))`, there would be no need to trick AUCTeX into thinking it is opening up a `*.dvi` file (when in reality it is opening up a `*.pdf` file). Setting the variable `TeX-PDF-mode` to `t` permits AUCTeX to use `output-pdf`. – lawlist Mar 31 '14 at 15:59

0 Answers0