TeX - LaTeX Asked by DrummerB on December 18, 2020
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.3linewidth]{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.
Use a negative vspace
above the figure and use makebox
:
begin{figure}[p]
vspace*{-2cm}
makebox[linewidth]{
includegraphics[width=1.3linewidth]{images/sequence2.pdf}
}
caption{Sequence diagram}
end{figure}
Answered by DrummerB on December 18, 2020
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.
Answered by Damitr on December 18, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP