1

Why is it that, when I insert my figure with \begin{figure}, it is placed at the beginning of the paper ?
enter image description here

5
  • 1
    Take a look at those similar questions : original , duplicate with simple answer.
    – Rphad
    May 9, 2020 at 17:07
  • 1
    The only purpose of using the figure environment is to allow the figure to be moved to help with page breaking. May 9, 2020 at 17:31
  • 1
    For a really good read about LaTeX's floats: tex.stackexchange.com/a/39020/117050
    – Skillmon
    May 9, 2020 at 18:12
  • @DavidCarlisle could you elaborate ?
    – Rphad
    May 9, 2020 at 21:57
  • \includegraphics includes the image. You haven't shown any code but presumably you wrapped it in \begin{figure}..\end{figure} that environment doesn't do anything to do with including images, it just marks the region as a float that can be moved and re-inserted at another place to help with page breaking. May 9, 2020 at 22:16

2 Answers 2

3

You need to specify [H] like the code below

\begin{figure}[H]
    \centering
    \includegraphics[width=0.95\textwidth]{image.png}
    \caption{Caption.}
    \label{fig:image1}
\end{figure}

Add \usepackage{float}

2
  • 2
    You should mention that by default [H] will give an error ! LaTeX Error: Unknown float option `H'. May 10, 2020 at 16:33
  • 1
    Your answer is misleading. In the case, that ina document preamble you load package float (which define H), figure can still appear at the top of page (for example, if on the page is not enough space for figure, it is pushed to the next page and left empty space on the previous).
    – Zarko
    Oct 9, 2020 at 5:41
0

So, the way i fixed this was by using center instead of figure:

\begin{center}
\centering
\includegraphics[width=0.95\textwidth]{image.png}
\caption{Caption.}
\label{fig:image1}
\end{center}
3
  • Using center and \centering is redundant
    – user263192
    May 11, 2022 at 14:26
  • What happens with the \caption? Does it still print correctly as a figure caption?
    – Werner
    May 11, 2022 at 15:59
  • Thank you mayba can help another May 12, 2022 at 18:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .