TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

Is there a way to block indent whole paragraphs in emacs + auctex? I'm thinking in that functionality in such editors as WinEdt.

I've search in different fora, and in the available documentation, but what I've found doesn't seem to work in LaTeX mode.

share|improve this question
Do you mean indented in the LaTeX source or in the rendered document? – Erik P. Nov 30 '12 at 15:59
The source, of course.... – NVaughan Nov 30 '12 at 17:24
up vote 2 down vote accepted

Here's my assessment based on the other comments etc. Based your screen shots you have the entire paragraph as one long line and you are using visual-line-mode. That's perfectly fine except that visual-line-mode doesn't know how far to indent the wrapped lines. To do that you have to use something like adaptive-wrap-prefix-mode which is available from the GNU ELPA. Adding that to the appropriate hook should work.

The following isn't exactly how I invoke it, but I think it should work okay.

(add-hook 'text-mode-hook 'adaptive-wrap-prefix-mode)
share|improve this answer
Thanks, Ivan. That's what I was looking for. – NVaughan Dec 1 '12 at 23:44

Assuming you mean indent the source rather than indent the output,

There is indent-region (C-M-\) which will indent the region to what the mode thinks is the correct place relative to the previous line. If you want to force it you can give it a prefix argument so C-u 9 C-M-\ would indent the region to column 9.

failing that there's always

(defun foo()
(progn (mark-paragraph) (replace-string "\n" "\n     " nil (point) (mark))))

then M-x foo should indent the current para...

share|improve this answer
No, indent-region does nothing in my selected region. – NVaughan Nov 30 '12 at 17:45
My mode-line reads: LaTeX/FMP Rel Fly vl Wrap. – NVaughan Nov 30 '12 at 17:55
Without knowing what your selected region looks like, it's hard to know why indent-region isn't helping. You might try tabbing the first line of the paragraph over manually, then using M-q (bound to fill-paragraph) to indent and fill it to that manually-selected indentation. – Ben Lerner Nov 30 '12 at 18:15
A typical paragraph wouldn't normally be indent by much. Does it move if you give the prefix arguent? – David Carlisle Nov 30 '12 at 18:31
Only the first line of the paragraph gets indented. I was hoping the whole paragraph gets indented also (like a shift of the left margin). – NVaughan Nov 30 '12 at 19:19

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.