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?
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.
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 [!
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With