Following solution is used as base to compile current buffer that is a LaTeX
file:
(defun my-run-latex ()
"Save all buffers and run LaTeX on the current master."
(interactive)
(let* ((inhibit-message t)
(TeX-command-force "LaTeX")
(TeX-clean-confirm t)
(TeX-save-query nil)
(master (TeX-master-file))
(process (and (stringp master) (TeX-process master))))
(TeX-save-document master)
(when (and (processp process)
(eq (process-status process) 'run))
(delete-process process))
(TeX-command-master)))
(setq LaTeX-command-style '(("" "%(PDF)%(latex) -shell-escape -interaction=batchmode %S%(PDFout)"))) ;; https://tex.stackexchange.com/a/161303/127048
(add-hook 'LaTeX-mode-hook (λ ()
(TeX-fold-mode 1)))
Here even I have -interaction=batchmode
flag, AucTeX
adds -interaction=nonstopmode
, which force to generated output during latex compilation. I want to suppress the generated compile logs to speed up the build process.
file name *
:
Running `LaTeX' on `eblocbroker' with ``pdflatex -shell-escape -interaction=batchmode -interaction=nonstopmode work.tex''
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
\write18 enabled.
entering extended mode
(./work.tex
// generated compile log ...
How can I prevent pdflatex
logs to be created or is there any way to suppress the logs or have lowest verbose outputs?
/dev/null
– nega Jun 08 '22 at 16:30(setq LaTeX-command-style '(("" "%(PDF)%(latex) -shell-escape -interaction=batchmode %S%(PDFout) >/dev/null 2>&1")))
? – alper Jun 08 '22 at 21:35>/dev/null 2>&1
worked! it still generates a file called*
but having onlyTeX Output finished at Thu Jun 9 21:57:15
. Also I keep seeingLaTeX: problems after [0] pages
in the mini-buffer after the compiling – alper Jun 09 '22 at 20:06-aux-directory=/some/temp/dir
change the created path of the aux folders .-interaction=batchmode
is the flag to prevent logs to generated but emacs add additional-interaction=nonstopmode
flag that overwrite my configuration. If i can find a way emacs to not add-interaction=nonstopmode
flag into the command could be the solution – alper Jun 10 '22 at 09:52