2

How can I set AucTex to either (a) not pop up that annoying compilation buffer every time I C-c C-c or (b) only pop it up if compilation is not successful? (b) is preferable, but if it's too hard then I'm fine with (a).

1
  • (a) is not the default behavior, no compilation buffer is shown by default. You activated it somehow.
    – giordano
    Sep 1, 2016 at 12:11

2 Answers 2

2

I have this in my latex config, but I forget where it come from ...it does (b)

(defadvice TeX-LaTeX-sentinel
    (around mg-TeX-LaTeX-sentinel-open-output activate)
  "Open output when there are errors."
  ;; Run `TeX-LaTeX-sentinel' as usual.
  ad-do-it
  ;; Check for the presence of errors.
  (when
      (with-current-buffer TeX-command-buffer
        (plist-get TeX-error-report-switches (intern (TeX-master-file))))
    ;; If there are errors, open the output buffer.
    (TeX-recenter-output-buffer nil)))
2
  • I guess it's my answer here: tex.stackexchange.com/a/185763 But really, compilation buffer is not shown by default, my guess is that the OP activated it with (setq TeX-show-compilation t).
    – giordano
    Dec 30, 2016 at 15:23
  • @giordano Actually, I eventually figured out it was because I was using emac's latex-mode (I think). Anyway, I don't have the problem now. Dec 30, 2016 at 20:48
1

When I was looking for to avoid this, I didn't found. But I finnaly found a solution to get around the problem by using latexmk. The following code may help you :

(defun run-latexmk ()
  "It compiles the current document"
  (interactive)
  (let ((TeX-save-query nil)
        (TeX-process-asynchronous nil)
        (master-file (TeX-master-file)))
    (TeX-save-document "")
    (TeX-run-TeX "latexmk"
         (TeX-command-expand "latexmk -pdf %t" 'TeX-master-file)
         master-file)
    (minibuffer-message "latexmk done")))

This was inspired by this page about how to make latexmk run the appropriate amount of times.

Then you can rebind C-c C-c with something like (local-set-key (kbd "C-c C-c") #'run-latexmk).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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