Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like using auto-fill-mode for hard line wrapping. However, when I'm making a big tabular in a .tex file, I like using align-current to have the table look somewhat like it would when printed. The difficulty is that if I have a table that is longer than the line width, auto-fill-mode breaks it, and then align-current can't put things to rights and gets confused.

Is there a way to tell emacs that when I'm between the \begin and \end tags of a particular kind of environment (in this case, tabular), don't word wrap...

share|improve this question
Interesting problem which also bugged me a lot. See…. The second code sample by Ivan Andrus works nicely for me. – eldering Jul 13 '11 at 12:11
Hmmm... actually doesn't seem to work out of the box. It only disabled auto-fill-mode because it gave an error in my .emacs file. – eldering Jul 14 '11 at 9:24

There are many things you can do, including but not limited to (In order of implementation time):

  • You can turn off auto-fill-mode and use M-q (fill-paragraph) to manually fill when you need it.
  • You can use org-mode on-the-fly to create and edit clean tabular data.
  • You can advise fill-paragraph to do something different depending on context
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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