Graphics, Figures & Tablessideways figure and caption to stretch to fill page

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
lauraf
Posts: 29
Joined: Tue Jan 13, 2009 12:44 pm

sideways figure and caption to stretch to fill page

Post by lauraf »

Hi all,

I am relatively new to LaTeX so I don't really know where to start with this one...

I have two (sub)figures, landscape. I would like the figures and associated caption to stretch to fill the width of the text on the page. Of course, I could adjust the size of the figures with the height/width options in the includegraphics commands, but (a) this is tedious and (b) if I change the caption, I have to readjust the size of the figures, which is tedious.

Is there a way to get the size of the figure to automatically adjust to fill the width of the page?

Many thanks!
Laura

Code: Select all

\documentclass[a4paper, 11pt]{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{rotating}


\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO]{Header text}

\begin{document}

\begin{sidewaysfigure}
\centering
\subfloat[Subcaption]{\includegraphics[height=0.5\textheight{file}}
\hfill
\subfloat[Subcaption]{\includegraphics[height=0.5\textheight]{file}}
\caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean hendrerit dui. Proin interdum semper augue. Quisque consequat, lacus eget euismod interdum, lorem sapien rutrum augue, quis lacinia justo augue quis mauris. Etiam vel ante in dui malesuada iaculis. Maecenas arcu sem, tristique sed, mollis in, elementum at, ipsum. Aenean imperdiet. Donec libero. Ut diam. Vestibulum id dui quis libero auctor congue. Cras tortor. Fusce a lorem in tellus fringilla lobortis. Suspendisse ac risus. Suspendisse a est non nisi gravida sodales. Suspendisse potenti. Sed iaculis diam sed justo. Integer dapibus leo a nisl. Nunc dui eros, faucibus et, luctus non, ornare sed, mi. Morbi vitae metus eu felis condimentum aliquam. Aliquam placerat.}
\label{fig:plot}
\end{sidewaysfigure}


\end{document}
Attachments
file.png
file.png (23.69 KiB) Viewed 4410 times

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply