38

I have a big figure that takes up a full page. I'd like to include it in my latex document on a separate page, centered horizontally and vertically.

I managed to put it on a separate page (or it is simply doing that because of the size). Horizontal centering also works using \centerline, even though the figure is wider than the text.

The only problem left is that I can't center it vertically. No matter what I try it won't let me go over the top margin. I tried \vspace*{-2cm} or ${}$\vspace*{-2cm}, but only the caption was moved (onto the figure..).

My current code:

\begin{figure}[p]
    \makebox[\linewidth]{
        \includegraphics[width=1.3\linewidth]{images/sequence2.pdf}
    }
    \caption{Sequence diagram}
\end{figure}

EDIT:

Here is the result (I put a black border around the page, and covered the area of the figure with a gray box). The top margin is slightly larger than the bottom margin. And the figure's caption is below the page number. I'd just like to move the figure and caption up by 1-2 cm.

enter image description here

4
  • Instead of \centerline{...}, does \makebox[\linewidth]{...} provide a solution?
    – Werner
    Nov 27, 2012 at 18:54
  • Unfortunately not. It looks thee same. I posted an image in my question.
    – DrummerB
    Nov 27, 2012 at 19:22
  • I now see that your actual image is too large. Just add \vspace*{1cm} below \caption to move the image upward 1cm.
    – Werner
    Nov 27, 2012 at 19:24
  • Adding a \vspace at the end was simply ignored. However a negative \vspace above the figure and \makebox now work. Thanks for helping!
    – DrummerB
    Nov 27, 2012 at 19:38

2 Answers 2

33

Another option is to use pdfpages package as reported here.

For this add the following line in the preamble:

\usepackage{pdfpages}

Now you need to create a pdf with exact size of your LaTeX document. For this I used Inkscape, but you can use any other tool. In case you do not know what is the exact size of page in pixels, just open the pdf with Inkscape. This will give you titlepage, you can see the height and width of page in Inkscape. Let's say the size of page is 765x990 pixels. Now resize the image that you want to this size and embed it in this page. Save the file as pdf in Inkscape.

Now in the main LaTeX file use the following command

\includepdf{input.pdf}

I am attaching a screenshot of my document below.

LaTeX Full Page Image

4
  • 1
    Would you like to elaborate more? Providing a concrete example will be great not only for the OP, but also for future readers. Jan 30, 2014 at 10:58
  • 1
    IMHO, thats all. It is really that simple.
    – Christian
    Mar 1, 2014 at 21:48
  • 1
    This is a very clean solution, only complaint I would have is that you can not include captions/lables
    – puk
    Jun 12, 2018 at 19:02
  • The problem is, the next image overlaps with it
    – hola
    Sep 23, 2018 at 9:37
23

Use a negative \vspace above the figure and use \makebox:

\begin{figure}[p]
    \vspace*{-2cm}
    \makebox[\linewidth]{
        \includegraphics[width=1.3\linewidth]{images/sequence2.pdf}
    }
    \caption{Sequence diagram}
\end{figure}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .