auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \documentclass does not activate latex-mode


From: Mandar Mitra
Subject: Re: \documentclass does not activate latex-mode
Date: Mon, 15 Aug 2022 18:11:52 +0530

jfbu wrote (Sun, Aug 14, 2022 at 06:14:12PM +0200):
> I can not add any file local variable, the file is output
> by some build.

You can't modify the build file that generates your .tex file? Something as 
simple as renaming haru.tex to haru.ltx might fix things for you.

Some more questionable suggestions, while you wait for the experts to weigh in.

C-h v shows that I have the following entries in auto-mode-alist:

("\\.[tT]e[xX]\\'" . tex-mode)

("\\.ltx\\'" . latex-mode)

Do you ever use plain-tex-mode at all? If not, or only very infrequently, you 
could see if

(add-to-list 'auto-mode-alist '("\\[tT]e[xX]\\'" . latex-mode))

in your .emacs or init.el helps. 


> But IMHO, should'nt \documentclass by itself trigger latex-mode?
> It is relatively frequent to have to put code before the
> \documentclass.

According to the variable TeX-format-list at tex.el:3640, a file will have to 
start with \documentclass, or \begin, \section, \subsection, etc. for auctex to 
go into latex-mode. The last entry in the list is a catchall regexp "." that 
invokes plain-tex-mode.

-mandar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]