4

I configure indent-tabs-mode to t so that tab characters are used for indentation by default. AUCTeX apparently changes the value of indent-tabs-mode to nil and uses some other system for handling leading indentation, and there are many customization variables in the groups "TeX Indentation" and "LaTeX Indentation". As far as I've found so far, these variables only allow you to change the number of space characters used for indentation. How can I configure AUCTeX to use tab characters for indentation?

2
  • I don't think you can have both AUCTeX-style of indentation and indentation with tabs. If you want to latter, probably you only need to set indent-line-function to 'indent-relative (its default value), in addition to setting indent-tabs-mode to t. Is this what you want?
    – giordano
    Commented Aug 18, 2015 at 13:47
  • @giordano thanks a lot for those suggestions; I didn't know about indent-line-function. I've added a 'LaTeX-mode-hook to force both of these variables and will see how it goes! If you want to submit this as an answer I'll accept it.
    – DGrady
    Commented Aug 18, 2015 at 16:37

1 Answer 1

2

AUCTeX doesn't use tabs at all for indentation. This is done by changing two variables: indent-tabs-mode and indent-line-function. Thus, in order to get tabs back you can restore the default values of these variables (t for for the former and indent-line-function for the latter). You can do this in your init file with a hook:

(add-hook 'LaTeX-mode-hook
          (lambda ()
            (setq indent-tabs-mode t
                  indent-line-function 'indent-relative)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.