Hello Uwe,

On 29/12/2025, Uwe Brauer wrote:
> And compiling the way described still gave
If you are referring to compilation inside Emacs, then you probably are
not getting the environment variables set correctly there. You can check
this by running

--8<---------------cut here---------------start------------->8---
(getenv "BIBINPUTS")
(getenv "TEXINPUTS")
--8<---------------cut here---------------end--------------->8---

You can modify the variables inside Emacs directly as follows:
--8<---------------cut here---------------start------------->8---
(dolist (e '("BIBINPUTS" "TEXINPUTS") )
    (setenv e (concat TeX-output-dir ":" (getenv e))))
--8<---------------cut here---------------end--------------->8---


Or, if you want to do this automatically and temporarily for BibTeX, you
can add this advice:

--8<---------------cut here---------------start------------->8---
(advice-add #'TeX-run-BibTeX
            :around
            (lambda (oldfn &rest args)
              (let ((process-environment (copy-sequence process-environment)))
                (dolist (e '("BIBINPUTS" "TEXINPUTS") )
                  (setenv e (concat TeX-output-dir ":" (getenv e))))
                (apply oldfn args))))
--8<---------------cut here---------------end--------------->8---

This might be worth adding into AUCTeX (along with setting TEXMFOUTPUT),
as latexmk does, but I am not sure if it should be done for individual
functions (since only some tools seem to not support output-directory
directly, like bibtex) or inside `TeX-run-command` for all commands.

-- Al

Reply via email to