Hi,
I insert pictures via the menu bar into my text, when I render to pdf I get one or two images in the right position, but then other ones just disappear and pop up pages later completely arbitrary as it seems. When I compile I do not get any error messages.
Has anybody got any idea how this can happen? Very frustrating. Here is how I embedd them. This one works once, then I do it again a few lines later and it doesnt. Makes no sense!
\begin{figure}[hp]
\centering
\includegraphics[scale=0.50]{D:/MSc/Project/images/AI/images/gaussian.jpg}
\label{fig:gaussian_blur}
\end{figure}
Graphics, Figures & Tables ⇒ Images appear in random places!?
NEW: TikZ book now 40% off at Amazon.com for a short time.

Images appear in random places!?
This is because the "p" in the option "hp" tells LaTeX that if the figure can't be placed here (not enough room), it should be placed on a special page for floats later on. You might try !ht or !hb instead.
The placement commands are (copied from lshort):
h = here at the very place in the text where it occurred. This is useful mainly for small floats.
t = at the top of a page
b = at the bottom of a page
p = on a special page containing only floats.
! = without considering most of the internal parameters, which could stop this float from being placed. (Basically tells it to try harder to place it where you next say to.)
If you list more than one, it tries one, and if I can't do it, it then tries the next option. So \begin{figure}[!hb] will try really hard to place it here, and if that doesn't work, it'll then try to place it at the bottom of the page, and so on.
The placement commands are (copied from lshort):
h = here at the very place in the text where it occurred. This is useful mainly for small floats.
t = at the top of a page
b = at the bottom of a page
p = on a special page containing only floats.
! = without considering most of the internal parameters, which could stop this float from being placed. (Basically tells it to try harder to place it where you next say to.)
If you list more than one, it tries one, and if I can't do it, it then tries the next option. So \begin{figure}[!hb] will try really hard to place it here, and if that doesn't work, it'll then try to place it at the bottom of the page, and so on.
Re: Images appear in random places!?
Thank you that is very kind - I think i fixed it now with a combination of your comments and some /newpage commands in the right places.
However I still have a strange issue with the centering othe images - they seem to be centered in most cases but not if I am in a subsection and two /begin{enumerate} down, i.e.
Section 1 - image centers fine
Section\Subsection 1.1 - image centers fine
Section\Subsection 1.1\Item 1 - image centers fine
Section\Subsection 1.1\Item 1\Item a - image is leftbound?
How do I always get it to be at the center of the page, no matter what section i am in?
However I still have a strange issue with the centering othe images - they seem to be centered in most cases but not if I am in a subsection and two /begin{enumerate} down, i.e.
Section 1 - image centers fine
Section\Subsection 1.1 - image centers fine
Section\Subsection 1.1\Item 1 - image centers fine
Section\Subsection 1.1\Item 1\Item a - image is leftbound?
How do I always get it to be at the center of the page, no matter what section i am in?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Images appear in random places!?
In a list environment you should not use a float environment because the image is not supposed to float. Use the \captionof command provided by the caption package and put the image into a center environment. The image then will be centered according to the current line width.
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10