1

This is my Emacs information.

GNU Emacs 24.4.1 (x86_64-apple-darwin14.1.0, NS apple-appkit-1344.72)
 of 2015-02-16 

I installed Auctex 11.88.2 with package-install.

When I open the main tex, and C-c C-c it, I got Command: (default latexmk). Enter it to see latexmk: problems after [0] pages.

I tried pdflatex from the Command: (default latexmk), I have [No match].

I checked that latexmk main.tex to get the correct pdf. Here are my questions.

  • Q1: Why the latexmk does not work on AucTex? If I have to give the main latex source, how to do that? How to see the error log in AucTeX?
  • Q2: How to set C-c C-c to prompt pdflatex not latexmk?
  • Did you setup latexmk in AUCTeX? How? It's not present by default, so you should explain what you did. In addition, after compiling what's the content of the output buffer you get with C-c C-l? – giordano Apr 1 '15 at 15:05
  • @giordano: I didn't do any setup/change for AucTeX. It's in its raw state after the installation. C-c C-1 is undefined for my AucTeX. – prosseek Apr 1 '15 at 15:14
  • In vanilla AUCTeX there is no latexmk command, so it's impossible you can run it without doing anything. C-c C-l shows the output log. At this point I must ask you: are you sure you are using AUCTeX? In the menu you should have a TeX or LaTeX entry, the last item in it is "Report AUCTeX bug". – giordano Apr 1 '15 at 15:28
  • Ah, in order to compile with pdflatex you should write LaTeX (case insensitive). – giordano Apr 1 '15 at 15:35
  • Maybe he installed Emacs with a starter package, there are some. @prosseek: Can you search for an init file or something like ".emacs"? To make sure, start Emacs with emacs -q from the command line and you will notice that you can not start latexmk via C-c C-c. – Keks Dose Apr 1 '15 at 16:00
3

I found that I have some messed up configuration setup. This page (http://www.stefanom.org/setting-up-a-nice-auctex-environment-on-mac-os-x/) shows how to get correct AUCTeX configuration for Mac OS X. This page (https://stackoverflow.com/questions/7899845/emacs-synctex-skim-how-to-correctly-set-up-syncronization-none-of-the-exi) also helped.

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

I also needed a ~/.latexmkrc

$pdflatex = 'pdflatex -interaction=nonstopmode -synctex=1 %O %S';
$pdf_previewer = 'open -a skim';
$clean_ext = 'bbl rel %R-blx.bib %R.synctex.gz';

I also had to include the path to the latexmk in the configuration file. (https://stackoverflow.com/questions/20015930/auctex-and-emacs-on-mac)

(let ((my-path (expand-file-name "/usr/local/bin:/usr/local/texlive/2014/bin/x86_64-darwin")))
    (setenv "PATH" (concat my-path ":" (getenv "PATH")))
    (add-to-list 'exec-path my-path)) 

After all these changes, it works fine.

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.