Indenting a whole paragraph
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]
\begin{adjustwidth}{2cm}{}
\lipsum[1]
\end{adjustwidth}
\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}}
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}
Perhaps the easiest way to do that is to use \begin{quote} ... \end{quote}
environment. It has a pretty similar effect:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{quote}
\lipsum[2]
\end{quote}
\lipsum[3]
\end{document}