Currently, I edit LaTeX files by running latexmk -pvc
in the background to generate PDF automatically upon change to be previewed in Evince. However, when there is a syntax error, AucTeX is not able to show it. How can I complete this integration by jumping to errors given by the latexmk
process?
I have dealing with the same issue. That is my solution, it is a bit late but it could be useful.
(defun brust-LaTeX-next-error (args)
(interactive "p")
(if-let ((active-buffer (TeX-active-buffer)))
(if (< 15 args)
(TeX-error-overview)
(when (< 3 args)
(save-excursion
(set-buffer active-buffer)
(TeX-parse-all-errors)
(if TeX-error-list
(message ":::: WARNING :::: There are errors ::::")
(message ":::: Be happy, your LaTeX code has no errors ::::"))))
(call-interactively 'TeX-next-error))
(message "There is no active buffer")))
I guess that AUCTeX creates the list of errors once the compiling precess finishes.
So, the problem with latexmk -pvc
is that the process never ends and the list is never created.
The idea is to replace TeX-next-error
with previous function.
First, it checks whether there is an active process or not.
When you call brust-LaTeX-next-error
with prefix argument C-u
it creates the list from the active buffer with the same functions that AUCTeX does when the process ends (again I guess).
So, they should interact nicely.
When you call it with no prefix argument it just calls TeX-next-error
.
As an extra functionality when you call it with double prefix argument C-u C-u
a buffer with all errors listed is created.
TeX-next-error
andTex-previous-error
do not work? Are you usingauctex-latexmk
? – Timm Nov 18 '16 at 8:57latexmk -pvc
in the background so PDF gets rebuilt automatically upon saving.TeX-next-error
won't work. – xuhdev Nov 18 '16 at 9:02auctex-latexmk
with(setq TeX-save-query nil)
and the files are automatically saved when compiling withC-c C-c
. I don't see much of an advantage of usinglatexmk -pvc
instead. – Timm Nov 18 '16 at 9:25