help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LaTeX reformat


From: Klaus Uhl
Subject: Re: LaTeX reformat
Date: 08 Jan 2004 23:54:00 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

David Rasmussen <david.rasmussen@gmx.net> writes:

> In plain emacs (I am not using AucTeX as I have not been able to find
> it anywhere), I use "Auto Fill", to make it wrap lines
> automatically. When I have fiddled around with the text a bit, the
> automatically inserted newlines are at random places so the text looks
> broken up (in emacs).
> 
> A way to solve this, is to delete the now extraneous newline, and then
> go to the end of the line, and press space. This causes the whole line
> to get reformatted.

You can use M-q to reformat a single paragraph. This is no AucTeX
command but a general emacs command (fill-paragraph) so it also works
in simple text mode (e.g. I also used it to format this message).

> But it would be nice if I could just mark an entire region and
> reformat it, so that newlines were at the right places, and lines
> wrapped naturally. What is the command for this?

There is also an emacs command fill-region (type M-x fill-region) but
I am not sure if it is bound to a shortcut by default. If you often
need to reformat regions that cover more than one paragraph you can
also define your own key binding for this command. Put the line

(global-set-key '(meta w) 'fill-region)

somewhere into your .emacs file and you have bound fill-region to the
key sequence M-w.

Remark: Many keyboards (especially those of PCs) do not have a
separate meta key. On those computers you can try to type ALT-q
instead of M-q if this is configured for your X-Server. Otherwise you
can always use the sequence ESC q (i.e. press _and_ release the escape
key and then press the w key) as a replacement for M-q.

-- 

                 God is real ...
\|/ ____ \|/     ... unless declared integer.
"@'/ ,. \`@"     
\_| \__/ |_/     Mail me : news@u-h-l.de
   \__U_/        WWW     : www.u-h-l.de
                 PGP     : Look at your favourite PGP-keyserver


reply via email to

[Prev in Thread] Current Thread [Next in Thread]