0

I want to insert a picture with this code below. But, before that picture, I write some paragraphs and those paragraphs are almost at the bottom part of the page (the picture is bigger than the remaining space). Then, when I compile it comes like the picture below.

\begin{figure}[h]
    \begin{center}
        \includegraphics[width=10cm]{baganRL.jpg}
        \caption{Interaksi antara agen dan lingkungan pada \textit{Finite Markov Decision Processes}}\label{baganMDP}
    \end{center}
\end{figure}

enter image description here

the last paragraph before the picture.

enter image description here

position of the picture is on the new page and at the center of that page.

Louisa V
  • 13
  • 2
  • Welcome to TeX.SX! Please provide a compilable minimal working example, and maybe also have a loot at this question and the related answers. – Jasper Habicht Dec 15 '21 at 16:17
  • 1
    you have used [h] so have prevented the figure being placed at the top (t) or bottom (b) of a page you also omitted p which prevents it being placed on a foat page but it was eventually forced on to a float page as an emergency recovery. try [htbp] to allow more options. – David Carlisle Dec 15 '21 at 16:19
  • @DavidCarlisle I already tried your advice, but it still doesn't work – Louisa V Dec 15 '21 at 16:23
  • @JasperHabicht I don't know how to provide the MWE because it is my thesis. I mean, should I post all the script? – Louisa V Dec 15 '21 at 16:24
  • 2
    figures float by design but it is not possible to debug the placement of a specific figure unless you provide an example. If you use [ht] then it will go at teh top of the current or next page unless you ahve something you have not shown that stops that – David Carlisle Dec 15 '21 at 16:24
  • 2
    @LouisaV don't post your thesis the words (and the image) are not needed you can use \rule{2cm}{3cm} instead of \includegraphics and use one two three... one two three... as the words, just arrange that a page has the same general for as your real cas, and the image does not appear where you expect. – David Carlisle Dec 15 '21 at 16:26
  • @DavidCarlisle I'm sorry before. I don't know how to explain it, because the picture is literally at the end of the page and before the picture is some paragraphs. But I still didn't understand what should I do. So, maybe I will make the picture smaller. But I wanna say thank you so much for helping me. – Louisa V Dec 15 '21 at 16:32

1 Answers1

0

To big for the comment ...

An MWE which reproduce your problem can be:

\documentclass{article}
\usepackage{graphicx}

%---------------- Show page layout. Don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \usepackage{lipsum}% For dummy text. Don't use in a real document

\begin{document} \lipsum[1-3]

\begin{figure}[hbt]  % if here is enough space for image, 
                    % it will follow above text, if not
                    % it will be moved to top of the next page
\centering

\includegraphics[height=54mm]{example-image-duck} % I haven't your image, % therefore a example image is used \caption{Interaksi antara agen dan lingkungan pada \textit{Finite Markov Decision Processes}} \label{baganMDP} \end{figure}

\lipsum[4-6] \end{document}

and in is image at the bottom of page since after point of its inserting into text is enough space for it. For example, if the image is one millimeter higher, it will be moved to the top of the next page.

This MWE you should adopted to your document. Used preamble as well image size is unknow to us so please test above example with your document preamble and image.

If you will have around image large white space, than your image has this space around it. This can you test by inserting image in frame:

\frame{\includegraphics[height=55mm]{example-image-duck}}

If white space between image and frame is bigger then few point (width of \fboxsep), than you need firs trim out this space with dome graphicx tool.

A case, when on page is enough space for figure:

enter image description here

A case, when on page is not enough space for figure (it is one milimeter higher as before:

enter image description here

(red lines indicate page layout)

Zarko
  • 296,517