## LaTeX forum ⇒ Text Formatting ⇒ Center figures out of margin

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
MakezHD
Posts: 10
Joined: Thu Jan 21, 2016 8:19 pm

### Center figures out of margin

I have some figures that are very big, so I placed them in landscape mode.

They are still too big for landscape mode so they get out of the page's margin. The problem is that the figure looks like it has a big blank space in the upper part of the page, so I would like to center the figure so that the distance between the figure and the upper and lower borders are the same.

I need y1 and y2 distances to be the same.

\begin{landscape}\begin{figure}[htbp] \begin{center} \centering \textbf{----------}\par\medskip \scalebox{0.9}{\frame{\includegraphics[clip, trim=0cm 11cm 0cm 1cm]{figs/-------.pdf}}} \caption{\textit{---------} \label{-----------} \end{center} \end{figure}\end{landscape}

Stefan Kottwitz
Posts: 9388
Joined: Mon Mar 10, 2008 9:44 pm
You can remove both the figure environment and the center environment. figure is for floating, referencing, captions, but you don't use it anyway. Instead of \begin{center} and \end{center} just keep \centering, otherwise you get unnecessary space before and after it. \centering is for pure centering, while \begin{center} ... \end{center} is for displaying centered paragraphs within surrounding text, that's why it brings vertical space around.

Seems like you want also "vertical" centering in landscape mode. You could add \vspace*{\fill} before and after it to achieve that.

Stefan

MakezHD
Posts: 10
Joined: Thu Jan 21, 2016 8:19 pm
Stefan Kottwitz wrote:You can remove both the figure environment and the center environment. figure is for floating, referencing, captions, but you don't use it anyway. Instead of \begin{center} and \end{center} just keep \centering, otherwise you get unnecessary space before and after it. \centering is for pure centering, while \begin{center} ... \end{center} is for displaying centered paragraphs within surrounding text, that's why it brings vertical space around.

Seems like you want also "vertical" centering in landscape mode. You could add \vspace*{\fill} before and after it to achieve that.

Stefan

If I remove figure I cannot add a caption right? I need the image to be a figure so it has a caption and it appears in the ToC.

rais
Posts: 200
Joined: Sun Nov 16, 2014 8:51 pm
MakezHD wrote:If I remove figure I cannot add a caption right? I need the image to be a figure so it has a caption and it appears in the ToC.

try loading the capt-of package and use its \captionof command.

KR
Rainer