[Tex/LaTex] Indentation inside a new environment

indentationminipagespacing

I want to have my text lines in a new environment indented from the left, as happens within

\begin{minipage}{...}
\end{minipage}

The reason not to use a minipage inside the environment definition is to enable page breaking within the environment. How can I achieve that?

Best Answer

Best is to use the adjustwidth environment offered by the changepage package. It has the following format:

\begin{adjustwidth}{<leftmargin>}{<rightmargin>}
  ...
\end{adjustwidth}

The contents is indented from the left by <leftmargin> and from the right by <rightmargin>, as expected, and allows for page breaking:

\documentclass{article}
\usepackage{changepage}% http://ctan.org/pkg/changepage
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\lipsum[1-2]
\begin{adjustwidth}{3em}{0em}
  \lipsum[3-6]
\end{adjustwidth}
\lipsum[7]
\end{document}

Adjustwidth


Here is a little bit of a hack: The standard quotation environment (which typesets it's contents as a list) offered by LaTeX might be of some help here. Using this as foundation, the following MWE provides the shiftpar environment. The optional argument specifies the left margin indent (default is 1.5em, taken directly from the quotation environment definition):

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\makeatletter
\newenvironment{shiftpar}[1][1.5em]
  {\list{}{%\listparindent #1%
    \itemindent\parindent
    \leftmargin#1
%    \rightmargin\leftmargin
    \parsep\z@\@plus\p@}%
    \item\relax}
  {\endlist}
\makeatother

\begin{document}
\lipsum[1-2]
\begin{shiftpar}[3em]
  \lipsum[3-6]
\end{shiftpar}
\lipsum[7]
\end{document}

Shifting a paragraph

Related Question