6

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?

1 Answer 1

15

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

2
  • Thanks. Now is it possible to have the quotation environment give this, with no right indentation?
    – PineApple
    Oct 7, 2011 at 7:55
  • 1
    As you can see, I've commented out the \rightmargin adjustment from the quotation environment definition, thereby not setting it at all.
    – Werner
    Oct 7, 2011 at 8:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .