I have an overleaf project with link below. If you go to chapter two (chapter-2.tex), there are two figures. I want to place say the first one at the top of the page i.e. before the paragraph using options like [ht]. Unfortunately, none of the option except [H] is working right now. But [H] would put the figure after the paragraph. If I put other options the figure simply disappears. Please help me!
https://www.overleaf.com/read/pbdhjthhkydp#c4644c (view only)
https://www.overleaf.com/5139396775rftbrwmqwdfb#0e6fa1 (editable)
Graphics, Figures & Tables ⇒ Struggling to put Figure at the top of the page
- Stefan Kottwitz
- Site Admin
- Posts: 10308
- Joined: Mon Mar 10, 2008 9:44 pm
Struggling to put Figure at the top of the page
Welcome to the forum!
I tested that Overleaf project. When I replaced the [H] option by [htbp!], I also noticed that the figures disappeared. That's because an error occurs (Too many }'s... \color@endbox ->\color@endgroup \egroup ...), that you can see when you open the error log in Overleaf. That error is the reason.
I see that the template and used style file seems to be more than 20 years old, redefining internal float macros etc. I would not use this template/style myself. If you continue using it, you may keep [H] and carefully place figures and tables in the code. Regarding the figure in chapter 2 you want to move, simply move that figure code above the paragraph in your code while keeping the [H].
Btw. within figure and table environments, use the \centering command instead of \center.
Stefan
I tested that Overleaf project. When I replaced the [H] option by [htbp!], I also noticed that the figures disappeared. That's because an error occurs (Too many }'s... \color@endbox ->\color@endgroup \egroup ...), that you can see when you open the error log in Overleaf. That error is the reason.
I see that the template and used style file seems to be more than 20 years old, redefining internal float macros etc. I would not use this template/style myself. If you continue using it, you may keep [H] and carefully place figures and tables in the code. Regarding the figure in chapter 2 you want to move, simply move that figure code above the paragraph in your code while keeping the [H].
Btw. within figure and table environments, use the \centering command instead of \center.
Stefan
LaTeX.org admin