I'm trying to use AUCTeX edit LaTeX files. The beginning of the document I just wanted to edit looks like this:

It's not neatly organized, inconsistent in many ways, and I should probably change it but it's readable. (I didn't pick a nice example, I picked the document I wanted to edit which had parts of it copied in from various other documents which is why it's so inconsistent in the header.)

However, after I selected the entire contents of the document and pressed C-c C-q C-r (LaTeX-fill-region), it looked like this:

The rest of the document looked fine before and still looks fine. The header looked ugly before and now looks utterly ravaged.

Is there a way to correct this behavior?


1 Answer 1


If you want a command to stay in a line on its own, add it to LaTeX-paragraph-commands:

(setq LaTeX-paragraph-commands '("documentclass" "usepackage"))

But, honestly, I didn't ever see anyone trying to fill the preamble ;-)

  • It was mainly because I misunderstood what filling means.
    – UTF-8
    Commented Dec 10, 2016 at 12:09

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.