# Change linewidth for the whole document, while keeping fancyhdr wide?

Somebody noticed that \abstract changes the linewidth for the whole document (here).

The problem was the syntax: with correct syntax as below this is avoided.

\begin{abstract}
This is an abstract. This is an abstract.
\end{abstract}


while this keeps the linewith for the rest of the document:

\abstract
This is the abstract


But what if I want to intentionally keep the linewidth the same for the rest of the document, but use correct syntax? Is there a way of knowing the linewidth used in the abstract and setting it manually? This is interesting, if one uses the fancyhdrpackage, and one wants the headers be wider than the text.

-
changepage package provides an environment adjustwidth which uses different margins than the rest of the document. I guess you can enclose the whole document in that environment. –  JLDiaz Mar 16 '13 at 13:45

Increase margins by 0.35in, and add a \fancyhfoffset[L,R]{0.35in}. The latter makes the fancyheader sticking 0.35 inches into the margins.

The only problem left is the abstract, which has to be sorted out manually, by making it looking like original.

\documentclass[fleqn, a4paper]{article}
\usepackage[top=1.5in,bottom=1.5in,left=1.35in,right=1.35in]{geometry}
\usepackage{lipsum}
\usepackage[english]{babel}

\usepackage[numbered,framed]{mcode} % for Matlab code

\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt} % use \pagestyle{fancy} to activate
\renewcommand{\footrulewidth}{0.4pt}
\fancyhfoffset[L,R]{0.35in}

\begin{document}

\pagestyle{fancy}

\small
\begin{center}
\bfseries Abstract \vspace{.5em}
\end{center}
\lipsum[1]
\normalsize

-

abstract is typeset internally using quotation environment. I guess you can put your whole document inside a quotation, except for the abstract, of course.

\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\title{The title}
\author{The Author}
\date{}

\begin{document}
\maketitle
\begin{abstract}
\lipsum[1]
\end{abstract}

\begin{quotation}
\section{First}
\lipsum[2]

\section{Second}
\lipsum[3]
\lipsum[4]
\begin{itemize}
\item Foo
\item Bar
\end{itemize}
\lipsum[5]
\end{quotation}
\end{document}


But probably floats will still use the real margins.

-

It can simply be done using the TeX primitives \leftskip and \rightskip

    \leftskip2.5em
\rightskip\leftskip


Internally that is how lists are built (in a much more complicated way) based on trivlist.

 \documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\title{The title}
\author{The Author}
\date{}
\begin{document}
\maketitle
\begin{abstract}
\lipsum[1]
\end{abstract}

\section{One}

\leftskip2.5em
\rightskip\leftskip

\lipsum[3]
\lipsum[4]

\end{document}

-