How can I change the margins for only part of the text?

Here is how you can do it. Put the following in the preamble (before \begin{document})

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist 

then in the text you can use

\begin{changemargin}{<arg>}{<arg>} 
\end{changemargin} 

where <arg> is the distance you want to include on the margin (the first one defines the right-hand side margin, and the second defines the left-hand side one).

So, for example, to add 0.5 cm to the margins on either side, you would have:

\begin{changemargin}{0.5cm}{0.5cm} 
%your text here  
\end{changemargin}

This is exactly how the command

\begin{quote}
\end{quote}

is defined, but with the set to 1cm. The command quote can be used without having to load any packages, by the way.


There are several packages available on CTAN to do this. changepage looks promising but you can find other alternatives by searching for "margins" or "changepage" on ctan search.

With the changepage package, you can use the adjustwidth environment as follows:

\begin{adjustwidth}{left amount}{right amount}
\lipsum[2]
\end{adjustwidth}

For example, to remove 100pt from the margin on both sides, you would use

\begin{adjustwidth}{100pt}{100pt}

With either one of the KOMA-Script classes or the package scrextend (which is part of KOMA-Script), you can use the addmargin environment.

\documentclass{article}

\usepackage{scrextend}

\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\blindtext

% Syntax: \begin{addmargin}[<left indentation>]{<indentation>}
\begin{addmargin}[4em]{1em}
\blindtext
\end{addmargin}

\blindtext

\end{document}

enter image description here

Tags:

Indentation