tags:

views:

330

answers:

5

I have a Latex document where I need to change the margins of only a few pages (the pages where I'm adding a lot of graphics).

In particular, I'd like to change the top margins (\voffset). I've tried doing:

\addtolength{\voffset}{-4cm}

% Insert images here

\addtolength{\voffset}{4cm}

but it didn't work. I've seen references to the geometry package, but I haven't found how to use it for a bunch of pages, and not for the whole document.

Any hints?

+2  A: 

I've used this in beamer, but not for general documents, but it looks like that's what the original hint suggets

\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}

Then to use it

\begin{changemargin}{-1cm}{-1cm}

don't forget to

\end{changemargin}

at the end of the page

I got this from http://www.tex.ac.uk/cgi-bin/texfaq2html?label=chngmargonfly

ansate
+1  A: 

For figures you can use the method described here :
http://texblog.net/latex-archive/layout/centering-figure-table/
namely, do something like this:

\begin{figure}[h]
\makebox[\textwidth]{%
        \includegraphics[width=1.5\linewidth]{bla.png}
    }
\end{figure}

Notice that if you have subfigures in the figure, you'll probably want to enter into paragraph mode inside the box, like so:

\begin{figure}[h]
\makebox[\textwidth]{\parbox{1.5\textwidth}{ %
\centering
\subfigure[]{\includegraphics[width=0.7\textwidth]{a.png}}
\subfigure[]{\includegraphics[width=0.7\textwidth]{b.png}}
\end{figure}

For allowing the figure to be centered in the page, protruding into both margins rather than only the right margin.
This usually does the trick for images. Notice that with this method, the caption of the image will still be in the delimited by the normal margins of the page (which is a good thing).

shoosh
+1  A: 

A slight modification of this to change the \voffset works for me:

\newenvironment{changemargin}[1]{
  \begin{list}{}{
    \setlength{\voffset}{#1}
  }
  \item[]}{\end{list}}

And then put your figures in a \begin{changemargin}{-1cm}...\end{changemargin} environment.

Noah
+1  A: 

The changepage package (maintained but not written by me) is probably the closest you'll get to having a "pre-made" solution.

Will Robertson
I'll give it a try. Thanks!
pgb
+1  A: 
\par\vfill\break % Break Last Page

\advance\vsize by 8cm % Advance page height
\advance\voffset by -4cm % Shift top margin
% Start big page
Some pictures
% End big page
\par\vfill\break % Break the page with different margins

\advance\vsize by -8cm % Return old margings and page height
\advance\voffset by 4cm % Return old margings and page height
Alexey Malistov