I'm working on a collaborative (version controlled) LaTeX project. We have a bunch of custom .sty files in a subdirectory of our project named tex. We set TEXINPUTS=".:tex:" in the project Makefile so that we can use \usepackage{foo} instead of \usepackage{tex/foo}. This avoids annoying LaTeX warnings and avoids the need to modify those .sty files that \input or \RequirePackage another file in the same tex directory. All of this works well.

What doesn't work well is AUCTeX. We add the following to the bottom of each of our LaTeX sources:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../relative/path/to/main.tex"
%%% End:

Unfortunately, hitting C-c C-c LaTeX results in an error because TEXINPUTS isn't set properly.

Here are my questions:

  • Is there a TeX macro that allows us to change the TeX input search path from within the document itself?
  • Is there a non-risky file local variable we can use to tell AUCTeX to set TEXINPUTS when it runs LaTeX?
  • Is there an alternative approach we can take? I don't want each user to have to modify his/her environment before starting emacs.
  • Have you tried setting TEXINPUTS from a shell (export TEXINPUTS=.:tex:${TEXINPUTS} in bash syntax) and invoking AUCTeX from there?
    – Daniel
    Dec 5, 2011 at 20:53
  • @Daniel: Yes, and that works, but I don't want each user to have to modify his/her environment before starting emacs. Dec 5, 2011 at 21:44

1 Answer 1

%%% Local Variables:
%%% eval: (setenv "TEXINPUTS" "--place your setting here---")

Look in to this thread for some more information http://lists.gnu.org/archive/html/auctex/2005-05/msg00097.html

  • 4
    I'm looking for a safe file local variable I can set -- adding eval: (setenv "TEXINPUTS" ...) results in a warning when the file is visited. Feb 3, 2012 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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