Graphics, Figures & Tables ⇒ Struggling to put Figure at the top of the page
Struggling to put Figure at the top of the page
https://www.overleaf.com/read/pbdhjthhkydp#c4644c (view only)
https://www.overleaf.com/5139396775rftbrwmqwdfb#0e6fa1 (editable)
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10330
- Joined: Mon Mar 10, 2008 9:44 pm
Struggling to put Figure at the top of the page
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