50

Possible Duplicate:
Indenting a whole paragraph
Write text with some fixed amount of space from the margin

I would like to indent a paragraph or two for a specific amount.

The quote environment is not suitable, since indentation width is not configurable.

An article suggested using {\addtolength{\leftskip}{5mm} text}, but that doesn't work for me.

Another article suggested a very hacky way, which involved temporarily modifying global margins.

Is there a clean solution for this?

  • 3
    See http://tex.stackexchange.com/questions/36121/write-text-with-some-fixed-amount-of-space-from-the-margin/ or http://tex.stackexchange.com/questions/35933/indenting-a-whole-paragraph/ – Torbjørn T. Dec 04 '11 at 15:45
  • 1
    Could you elaborate on "doesn't work for me" what did you try exactly and why didn't it work? – Seamus Dec 04 '11 at 15:49
  • 1
    did you try this with \par at the end before closing the group in which the \leftskip is adjusted? – barbara beeton Dec 04 '11 at 15:54
  • @Seamus I tried the exact command quoted, and it didn't affect text layout. – Rok Strniša Dec 04 '11 at 15:55

1 Answers1

61

You may use addmargin environment of either a KOMA-Script class or the KOMA-Script package scrextend. Here an example with a standard class and package scrextend:

\documentclass{article}
\usepackage{scrextend}
\usepackage{lipsum}% for demo only!
\begin{document}

\lipsum[1]
\begin{addmargin}[1em]{2em}% 1em left, 2em right
\lipsum[2]
\end{addmargin}
\lipsum[3]
\end{document}

Results in:

enter image description here

Schweinebacke
  • 26,336
  • 13
    A tip for other sloppy readers: the package is s c r extend, not s r c extend. – ntc2 Mar 20 '14 at 05:59
  • 2
    An alternative is \begin{adjustwidth}{1em}{1em} CONTENT \end{adjustwidth} with \usepackage{changepage}. This worked better in my case because scrextend raised a warning that I could not get rid of using the silence package. The warning was Command \@footnotemark has changed. Check if current package is valid. – Carlos Pinzón Aug 03 '22 at 15:15
  • @CarlosPinzón This warning does not occur with my example. Maybe you are not using an up-to-date version of scrextend. – Schweinebacke Aug 23 '23 at 09:04
  • @ntc2 I wrote scrextend not srcextend. So I do not understand your comment. – Schweinebacke Aug 23 '23 at 09:04
  • 2
    @Schweinebacke, regarding the scr/src comment, he's just warning the readers that the package name is weird, so it is easy to misread scr as src. Your answer is fine, is just to help users notice that (programmers use src very often as short for "source"). Regarding my comment, I'm working with a larger document and I got that issue. I'm just adding that if someone gets stuck in the same place, my comment might help them. We are both just complementing your answer. – Carlos Pinzón Aug 23 '23 at 10:04