[Tex/LaTex] Emacs is not recognizing files as latex and going into latex-mode

emacs

I understand that the tex-mode command of Emacs is supposed to try to identify whether a file is TeX, LaTeX or some other TeX-variant when opening a .tex file, and switch automatically into the appropriate mode. But mine is not doing this despite my verifying that tex-default-mode is set to latex-mode. Regardless of what I have in my document.tex file, Emacs loads tex-mode and the status line says "TeX" instead of "LaTeX". If I run latex-mode, it goes into the right mode.

Is there anything I have to do in my .emacs in order to have this recognize properly?

Best Answer

Another option is to write

% Emacs, this is -*-latex-*-

or similar at the top of your file (all that matters is the -*-latex-*- part), or at the bottom you could put

% Local Variables:
% mode: latex
% End: