# Parse \input statements in AucTeX, TeX-insert-quote

AucTeX recognizes for example the statement

\usepackage[german]{babel}


in a .tex file. Then typing " twice will result in " before a word resp. "' after a word. However if \usepackage[german]{babel} is hidden behind an input statement like

\input{preamble}


i.e. the statement is contained in the preamble file,

AucTeX doesn't recognize the statement above anymore.

Is there any way to make AucTeX parse the \input files too?

-
You might have better luck at the AucTeX mailing-list. Feel free to post the solution here if you get one there. –  Martin Scharrer Jul 3 '11 at 16:46
This would be a comment instead of an answer, but I could not find the button to comment. This thread is related: mail-archive.com/auctex@gnu.org/msg01411.html and I have the same problem. It seems to be easily solved, but I could not get my install of AUCTeX to complete \includegraphics. –  YIchun Jul 4 '11 at 3:48
@user4011 I'm struggling to see a difference in behaviour in AUCTeX between the case where a main file includes \usepackage[german]{babel} and where is doesn't, even before I worry about secondary files. Could you clarify what I should be seeing? –  Joseph Wright Jul 17 '11 at 8:37
@'Joseph Wright' Maybe a better example is \usepackage{amsmath}. If you have this in your preamble the AucTeX command LaTeX-environment (C-c C-e) knows the align environment (tab completion). However if you hide this statement in an external preamble file (included by an include statement) it doesn't know it anymore (after restarting emacs or pressing C-c C-n) –  student Oct 3 '11 at 18:13
@JosephWright : Simple test: as said above, use \usepackage{amsmath}, and toggle on latex-math-mode if not already. If ams is correctly detected, backtick-C F will give \mathcal{F} , else it will give {\cal F} –  T. Verron Dec 1 '11 at 22:22

If you are using included files in your document, you should check that the emacs-related lines are present at the end of the included file you are testing it with:

%%% Local Variables:
%%% mode: latex
%%% TeX-Master: foo
%%% End:


if foo.tex is the name of your master file, and for the master file (I'm not sure it is as useful, though):

%%% Local Variables:
%%% mode: latex
%%% TeX-Master: t
%%% End:


I had this problem, but it was because I had written my text below the variable lines, instead of above. Moving it, saving and reloading the file fixed the problem for me.

Some other hints :

• the \input command should probably be the only one on its line
• the file path has to be specified starting with ./ (assuming you use unix)

Actually, \input{./fmt/preamble.tex} works, but \input{fmt/preamble.tex}` doesn't.

-