I am using the pdflscape package to insert landscape pages in my document. On one of these I would like to have a figure that is vertically centered on the page, but I can't find how to do it.
MWE:
\documentclass{article}
\usepackage{graphicx}
\usepackage{pdflscape}
\begin{document}
A portrait mode page...
\begin{landscape}
\begin{figure}[!h]
\centering
\fbox{\includegraphics[width=\linewidth]{VUB_logo.pdf}}
\caption{Some caption}
\end{figure}
\end{landscape}
Another portrait mode page...
\end{document}
This results in something like this (only landscape page shown):
While what I would like is this:
(note the vertical centering)
Best Answer
I would do it using a
\parbox
which has the maximum height (i.e.\textwidth
because of the rotation) and contains some\vfill
macros before and after the content to push it into the middle. Note that in such cases you shouldn't use thefigure
floating environment but add the captions using\captionof{figure}
(capt-of
orcaption
package). The float only interferes here. Because the content has already the maximum width you don't need to center it horizontally. This can however be done using the[c]
option of the\parbox
.I also compensated for the
\fbox
dimension to not generate an overfull box.