Graphics, Figures & TablesVertically center an image in landscape format

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Luftentfeuchter
Posts: 1
Joined: Tue Oct 07, 2014 6:20 pm

Vertically center an image in landscape format

Post by Luftentfeuchter »

Hello everyone!

I want to center an image vertically in landscape format.
Here's what I've got up to now:

Code: Select all

\documentclass[12pt]{scrartcl}
\usepackage{rotating}

\begin{document}
\thispagestyle{empty}

\begin{sidewaysfigure}
\centering
\includegraphics[width=\linewidth]{testimage}
\caption{caption of the image}
\label{Label1}
\end{sidewaysfigure}

\end{document}
But the distance to the top of the page is less than to the bottom margin.
Has anybody got an idea?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Vertically center an image in landscape format

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

The image is vertically centered within the text body. To see it, add this line:

Code: Select all

\usepackage{showframe}
The bottom margin is just twice as big as the top margin, which is a good practice. This makes you think it is not centered. You would need to change the margins. But I assume, once your document contains more text, it looks better centered to the text body of the pages, not to the margins or the paper but shifted if seen next to the text.

Stefan

PS: I noticed your German name: you are very welcome to post on our German language partner site TeXwelt.de. We are also happy to see questions there.
LaTeX.org admin
Post Reply