# Configuring TEXINPUTS from AUCTeX?

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 '11 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. –  Richard Hansen Dec 5 '11 at 21:44

%%% Local Variables:

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. –  Richard Hansen Feb 3 '12 at 5:15