Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force two figures to stay on the same page in LaTeX?

I have two images that I want to display on a page as figures. Each eats up little less than half of the space available so there's not much room for any other stuff on that page, but I know there is enough space for both of the figures. I tried to place the figures with [ht] and [hb], both [h] and both [ht] but still I can't get those two images on the same page but instead at least few paragraphs between them.

How do I force those two figures to stay on the same page?

like image 703
Kusti Avatar asked Nov 24 '09 08:11

Kusti


People also ask

How do I put two figures on the same page in LaTeX?

The "Figure 5 and Figure 6" you manually added can be done automatically by Latex, by adding \label{<your label>} inside of each figure then writing \ref{<your label>} or \cref{<your label>} (with the cleveref package) in the text. The label is of course, arbitrary.

How do you make a figure stay in LaTeX?

In general text you can force a LaTeX image to stay where it is placed in the code using the [! h] command in the figure environment. A slight modification of this which allows the image to move to the top of the next page if there is an overhang is the [!

How do I put images together in LaTeX?

Including images in your LaTeX document requires adding: \usepackage{graphicx} to the beginning/preamble of your document. \includegraphics{ } command tells LaTeX to insert the image. To upload an image, click the upload button, and upload your image file.

How do I combine multiple figures in LaTeX?

Multiple subfigures can be put in multiple rows by adding a \newline after one row is complete. For example, if you have four figures and you want to put them in 2x2 style, put \newline after two subfigures which will be placed in the first rwo. The command will create a new row for rest of the subfigures.


1 Answers

You can put two figures inside one figure environment. For example:

\begin{figure}[p] \centering \includegraphics{fig1} \caption{Caption 1} \includegraphics{fig2} \caption{Caption 2} \end{figure} 

Each caption will generate a separate figure number.

like image 145
Rob Hyndman Avatar answered Nov 20 '22 23:11

Rob Hyndman