0
After hitting C-c RET and compiling my .tex file, I would like the tex-shell buffer to close if the compilation was successful. How can I do that?
0
After hitting C-c RET and compiling my .tex file, I would like the tex-shell buffer to close if the compilation was successful. How can I do that?
1
In my .emacs
I have the following code:
(defun run-latexmk ()
(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)
(if (plist-get TeX-error-report-switches (intern master-file))
(TeX-next-error t)
(minibuffer-message "latexmk done"))))
(add-hook 'LaTeX-mode-hook
(lambda () (local-set-key (kbd "C-0") #'run-latexmk))
)
This binds C-0
to the defined function run-latexmk
which in turn saves all the files of the current document (based on the notion of master
file) and then runs latexmk
. If the compilation was successful then the compilation window closes. You can easily(?) change this code to your needs.