I have my AUCTeX/emacs setup following this site: http://www.stefanom.org/setting-up-a-nice-auctex-environment-on-mac-os-x/.

Everything works fine, C-c C-c gives me correct pdf, and C-c C-v shows the pdf in skim.

However, when I click the button on tool bar (the lion head in the screen), I have this error message.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\(?: \"\\\\\\|\"\\|%\\(?:(\\(?:\\(?:PDF\\(?:out\\)?\\|ex\\(?:\\(?:ec\\|tra\\)opts\\)\\|file-line-error\\|latex\\|mode\\|o\\(?:\\?\\|utpage\\)\\|tex\\))\\)\\|cS\\|dS\\|vv\\|[%'SV`abdfl-tv]\\)\\)" nil nil)
  TeX-command-expand(nil TeX-master-file)
  TeX-command("LaTeX" TeX-master-file -1)
  (progn (TeX-save-document (TeX-master-file)) (TeX-command "LaTeX" (quote TeX-master-file) -1))
  (lambda nil (interactive) (progn (TeX-save-document (TeX-master-file)) (TeX-command "LaTeX" (quote TeX-master-file) -1)))()
  call-interactively((lambda nil (interactive) (progn (TeX-save-document (TeX-master-file)) (TeX-command "LaTeX" (quote TeX-master-file) -1))) nil nil)
  command-execute((lambda nil (interactive) (progn (TeX-save-document (TeX-master-file)) (TeX-command "LaTeX" (quote TeX-master-file) -1))))

I'm not sure, but I see a lot of nils, especially the TeX-master-file. I got the same error when I tried to click the button with the main tex file.

What might be wrong?

enter image description here

1 Answer 1


The variable TeX-command-list is missing an entry for "LaTeX".

When you are in the buffer, the list might be populated by a hook, but the button might not see the updated list. FWIW, here's my entry for latexmk:

(add-hook 'LaTeX-mode-hook (lambda ()
                                 '("latexmk" "latexmk -pdf %s" TeX-run-TeX nil t
                                   :help "Run latexmk on file")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .