I'm working with a lot of images and not much text. When I compile the LaTeX document usually I have an image in every page and a lot of white space between them. These are pages from my LaTeX document.
I would like to have more images in a single page and text between an image and the other so ultimately I would like to have no white space in my document. So far I've try different approaches. Put figures together in a single page:
\begin{figure}
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{figureB}
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{figureA}
\end{figure}
Use wrapfigure
:
\begin{wrapfigure}{r}{\textwidth}
\includegraphics[width=\textwidth]{figureA}
\end{wrapfigure}
Using [H]
with float
package. But at the end all this attempts require me to struggle with the figure dimension to fit them otherwise white areas reappear. Are there any way to make TeX automatically choose the dimension of the image for minimizing the white space and maximizing the image dimension? Or alternatively: How can I minimize the white space in other ways?
This is a MWE with the first solution, however I don't know if is better to make a single figure with figure B and C or with A and B or C and D you can download the sample images here:
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{G M}
\title{Is possible to make LaTeX automatically choose the image size to minimize white space?}
\begin{document}
\maketitle
\lipsum[1-2]
\begin{figure}
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{FigureA.jpg}
\end{figure}
\begin{figure}
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{FigureB.jpg}
\caption{This image and caption is okay but the next image-caption go out of the page, this is because this caption is to long and the image width is fixed to textwidth I know if I don't write this in this caption this don't happen, I've write this caption so long to show you what happen to me many times \ldots}
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{FigureC.jpg}
\caption{Oh no this caption can't be see goes out of the page \ldots How can I fix it?}
\end{figure}
\lipsum[3-5]
\begin{figure}
\includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{FigureD.jpg}
\end{figure}
\end{document}
figure
environments - especially if you want to mix text and images to fill up pages. It would be helpful to have a Minimum Working Example.