How to enforce 80 columns in latex using emacs

290 Views Asked by At

I see that fill column shows a nice bar at the point that I want.

This is great.

But I'm lazy. I would like it to automatically hit return for me. Not to mention that sometimes I go back to edit stuff and my 80 columns rule gets everything messy.

Is this possible?

1

There are 1 best solutions below

0
On BEST ANSWER

Turn on auto-fill-mode:

(setf fill-column 80)
(add-hook 'latex-mode-hook #'auto-fill-mode)

When Auto Fill mode is enabled, inserting a space at a column beyond `current-fill-column' automatically breaks the line at a previous space.

If you go back to edit code later, simply M-q (fill-paragraph) to rewrap.