Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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

share|improve this answer
    
Thanks. Now is it possible to have the quotation environment give this, with no right indentation? –  PineApple Oct 7 '11 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 '11 at 8:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.