# Block indentation in TeXMaker

Is it possible to indent whole paragraphs of source code in TeXMaker (or alternatively, in any LaTeX editor), so that intentation applies to all rows in paragraphs when the text is wrapped over several lines is the editor?

By default, TeXMaker intents the source code like the first code snippet below, whereas I would like indentation as in the second snippet, i.e. applied to the whole paragraph.

\begin{abstract}
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
\end{abstract}


vs.

\begin{abstract}
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
\end{abstract}

-
Yes, emacs+auctex does this. –  Alex Aug 4 '13 at 19:49
@Alex, I would like to avoid using emacs if possible... :) –  malin Aug 4 '13 at 20:00
@malin Why? emacs is the best editor in the universe ;-) –  Alex Aug 4 '13 at 20:26
–  Torbjørn T. Aug 4 '13 at 20:27
Best Place to start Emacs Journey A simpleton's guide to TeX workflow with emacs –  texenthusiast Aug 4 '13 at 22:10

TeXstudio - originally called TexMakerX, a fork of Texmaker - apparently does the block indenting of word-wrapped paragraphs "out of the box". Here's a screenshot of a test I just did with my version of TeXstudio (version 2.6.2 running in Ubuntu 12.04):

-
This works even with hard-wrapping while soft-wrapping is shown here. –  Qrrbrbirlbel Aug 5 '13 at 2:28

Emacs/AucTeX does not seem to do block indentation be default, but by some googling last night I found that it can be enabled by installing a script like adaptive-wrap (see also Auctex block indent). The difference can be seen below.

Without any extra script you can also use LaTeX -> Formatting and Marking -> Format Environment/Paragraph/Region/Section from the menu, or the corresponding key codes (C-c C-q C-e/p/r/s). This will pretty-print these parts of your code. Or you can press tab when a line is not indented. –  Alex Aug 5 '13 at 14:44