When I type <TAB> in a LaTeX file anywhere on a comment line, the comment symbol is moved to the beginning of the previous non-blank line. This also occurs with M-x indent-region.

Is there a way to protect comment lines from indentation and to keep them exactly as I type them? I have tried to set comment-style to plain, to no avail...

I had the same problem in the past with Fortran 90 files. For some reason, it disappeared in more recent versions of Emacs (I use GNU Emacs 24.3.1), so I hope it should be possible with LaTeX files too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.