I have an alignment/indentation problem in LaTeX mode. Every time I begin a line with an opening brace and I hit <TAB> or run an indentation command on the region, the brace becomes aligned with the previous opening brace, even if a closing brace has been inserted in between. For instance,




Because of this, the document is increasingly shifted to the right. How can I get rid of this behavior? I use GNU Emacs 24.5.1. I have tried to open the LaTex file with emacs -q --no-site-file to make sure this is not due to a local configuration file, to no avail...

  • Emacs 24.5.1 is six years old; there have been three releases since then. If at all possible, it would be good for you to update to version 27. You don't have to do this, but as your version gets further and further out of date, you are likely to run into more issues that are tricky to resolve. As in this case, where the way Auctex gets installed has changed with the package.el system.
    – Tyler
    Mar 29, 2021 at 14:14

1 Answer 1


I do not see this problem (emacs-version = 25.2.2; auctex-version = 12.1.0) In your place, I will try edebug. F1 k TAB (or another key to identify the tab command (probably indent-for-tab-command) follow the link in the popup to indent.el.The point being on the code of the function, C-u C-M-x to enable edebug of function.Back to the file being edited, activate the faulty command and trace its execution with the spacebar I hope the culprit will appear.

  • AUCTeX had not been properly installed on my Linux machine. The problem has been solved by installing it from within emacs rather from a terminal. Still, thanks for your help. Jan 16, 2018 at 11:08
  • How do your install from within emacs?
    – vy32
    Sep 11, 2018 at 10:08

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.