AUCTeX and latex-mode

Incorrect latex mode loaded

I recently updated to the latest version of Doom (actually did a full re-install). I enabled the latex language. But when I load any file with a .tex extension, the Emacs native latex-mode is activated by default rather than AUCTeX’s LaTeX-mode, which means I don’t have access to any of AUCTeX’s goodies (eg, TeX-command-run-all)

I can fix it manually but I would rather not have to do that every single time I load a *.tex file. This wasn’t an issue with the previous version of Doom and AUCTeX.

What did you expect to happen?

I should have access to AUCTeX when I load a *.tex file.

Steps to reproduce

  1. Enable latex language in init.el, sync and restart
  2. Open any *.tex file with LaTeX commands
  3. Try to run an AUCTeX command like TeX-command-run-all

System information


Loading data dump...
1 Like

Same problem for me.

ran into this too and found a github issue with a workaround: LaTeX-mode does not automatically initialize when opening a .tex file · Issue #8191 · doomemacs/doomemacs · GitHub

it’s a bug introduced recently that affects emacs versions <=29, it’ll get fixed soon (see issue). Until then, putting this in your config fixes it:

(setq major-mode-remap-alist major-mode-remap-defaults)

1 Like

I’ve updated Emacs from 29.2 to 29.4 today and reinstalled Doom from scratch (from main). I get the same bug: I need to manually activate AucTeX for all .tex files. The most weird thing is that the status bar says “LaTeX” (that is, AucTeX) instead of the default latex mode.

Ah, in GitHub it says that the versions “<30” are affected, not “<=29”.