# Indenting a whole paragraph

How do I indent a whole paragraph at the same distance from my left margin, with the simplest command or environment?

-

Without any additional packages, you could wrap your paragraph in a minipage:

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\lipsum[1]

\hfill\begin{minipage}{\dimexpr\textwidth-3cm}
\lipsum[2]
\xdef\tpd{\the\prevdepth}
\end{minipage}

\prevdepth\tpd\lipsum[3]
\end{document}
​


In the above example, the paragraph depth correction (via \prevdepth is from How to keep a constant baselineskip when using minipages (or \parboxes)?).

The indent from the left is set to 3cm, but can be modified. Also, if a paragraph indent is required, use \indent within the minipage. All of the afore-mentioned modification can be automated. One caveat is that it will not allow breaking across the page boundary.

A rather crude way of doing it as well is to modify \leftskip:

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\lipsum[1]

\setlength{\leftskip}{3cm}

\lipsum[2]

\setlength{\leftskip}{0pt}

\lipsum[3]
\end{document}
​

-
Crude as in simple, or ugly? –  Ayman Elmasry Nov 23 '11 at 19:06
@AymanElmasry: It depends on what is contained between the modification. If nothing else uses \leftskip, then it is perfectly okay. Big layout changes such as that is usually put in an environment to either make it localized (so it reverts back to normal after the environment), or in some macro so that you have more control over it in a general setting... rather than just have length modifications mid-document. However, this all depends on the end-use. –  Werner Nov 23 '11 at 19:09
you also need to adjust the spacing between the preceding paragraph and the indented one. this one doesn't look too bad, but if the last line of the preceding paragraph were longer, and had no descenders, it would look pretty awful. –  barbara beeton Nov 23 '11 at 19:37
@barbarabeeton Agreed minipage is wrong for this and it can also end up at the bottom of the page and disappear. What is wrong using just \narrower?. –  Yiannis Lazarides Nov 23 '11 at 19:48
Another reason for not using a minipage in this case is that the OP may want to allow page-breaks in the indented paragraphs. –  lockstep Nov 23 '11 at 22:35

You could use the adjustwidth environment from changepage package- a MWE follows. Note that adjustwidth environment deals with page breaks.

The adjustwidth environment takes 2 arguments: the first is the indent from the left margin, and the second is the indent from the right margin. See the documentation for more details.

\documentclass{report}

\usepackage{lipsum}       % for sample text
\usepackage{changepage}   % for the adjustwidth environment

\begin{document}

\lipsum[1]

\lipsum[1]
\end{document}


If you plan to use this idea a lot, then it's probably worth defining your own environment

\newenvironment{myenv}{\begin{adjustwidth}{2cm}{}}{\end{adjustwidth}}


which could be used as

\begin{myenv}
\lipsum[1]
\end{myenv}


Following Werner's comment, you could make your environment take an optional argument that would overwrite the default indentation:

\newenvironment{myenv}[1][2cm]{\begin{adjustwidth}{#1}{}}{\end{adjustwidth}}

-

If you're using one of the KOMA classes, you can use the addmargin or addmargin* environments. The latter is for two sided layouts. The environment takes two arguments, the first being optional. Without the optional argument, the mandatory argument sets the indentation on both sides, while the optional argument specifies the left (or inner, for two sided layouts) indentation.

\documentclass{scrartcl}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\lipsum[2]
\lipsum[3]
\lipsum[4]
\end{document}


-

You can use the \parshape primitive:

\documentclass{report}
\usepackage{lipsum}

\begin{document}

\lipsum[1]

\parshape 1 2cm \dimexpr\linewidth-2cm\relax
\lipsum[1]

\end{document}

-

You can use the plain TeX command \narrower. You can also use \hangindent and \hangafter for a bit more control if you wish.

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\narrower
\lipsum[1]
\end{document}


You can also define a short margin to achieve the opposite effect:

\def\wider{%

-
How do you reverse the \narrower command after the desired part has been modified? –  Ayman Elmasry Nov 23 '11 at 23:07
@AymanElmasry: you can keep the effect local by grouping: {\narrower \lipsum*[1]\par} –  Gonzalo Medina Nov 24 '11 at 2:07
@AymanElmasry You can use {} to keep the effects local as Gonzalo mentioned, normally I use a small macro called \wider. Please see my edit. –  Yiannis Lazarides Nov 24 '11 at 3:52

Just in case somebody ends up here seeking a ConTeXt answer:

\startnarrower[left=2cm, right=3cm]
There was a sigh in the air that grew to a mutter, and a mutter that
grew to a roar, and a roar that passed all sense of hearing, and the
hillside on which the villagers stood was hit in the darkness, and
rocked to the blow.
\stopnarrower


Or, to specify the narrowing for both sides at once:

% 2cm narrower on each side, 4cm in total
\setupnarrower[middle=2cm]
Then a note as steady, deep, and true as the deep C of the organ
drowned everything for perhaps five minutes, while the very roots of the
pines quivered to it. It died away, and the sound of the rain falling on
miles of hard ground and grass changed to the muffled drum of water on
soft earth. That told its own tale.
\stopnarrower


(Example text from Kipling's "The Miracle of Purun Bhagat", from The Second Jungle Book.)

-