views:

133

answers:

2

How can you set the syntax of a .txt file .tex in Emacs?

+7  A: 

For questions like this, you should refer to other resources like the EmacsWiki.

In your .emacs, you could do something like:

(setq auto-mode-alist
  (append '(("\\.txt$" . tex-mode))
    auto-mode-alist))

Also, you could change the modeline of the current buffer using:

M-x tex-mode
popcnt
+5  A: 

You can also put the following at the start of the file:

% -*- TeX -*-

That will signal to emacs that your file should be in tex-mode.

chradcliffe