I'm new to Emacs, and dislike the default indentation in LaTeX mode. I want the indentation to do the following:
- insert a \t character (not spaces)
- be completely manual (I want to have to press Tab on each line to indent, rather than to have Emacs automatically make it match the previous line)
- display the \t characters as 4 spaces.
Essentially, I want Emacs to behave the same way as MS Notepad, XFCE's Mousepad or Vim do by default with respect to indentation (after setting \t to be displayed as 4 spaces).
I got close to this result by using the following .emacs file (taken from this q/a):
(add-hook 'LaTeX-mode-hook
(lambda ()
(setq indent-tabs-mode t
indent-line-function 'indent-relative)))
But it causes the following (strange) problem: if I type something like
\begin{thm}[Liouville 1851]
followed by pressing Return and Tab, it indents all the way to the "1" in "1851". I suspect this has something to do with the 'indent-relative, but I am not sure how to fix it.
Do anyone know how I can make Emacs indentation work this way, without having the above problem? Any help is highly appreciated.
-Aleks