General ⇒ How to force placing the figure in the given section?
How to force placing the figure in the given section?
How to force placing the figure anywhere but in the given (sub)section? The figure's option [h] is to strong.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to force placing the figure in the given section?
A \clearpage (or \cleardoublepage) command right after the float environment should do the trick. Replace the [h] option at least with [!ht] or [!hb], because it is overwritten by the compiler anyway (mostly with [!ht], see log file).
Best regards
Thorsten¹
Best regards
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
Re: How to force placing the figure in the given section?
Than you very much for the advices. Unfortunately placeins does not work (I have learned how it works using: http://www.let.rug.nl/alfa/tex/tetex30/ ... aceins.txt). But the ...{figure}[!ht] fully suffices to solve my problem though I have probably not understood the meaning of \clearpage (in Thorsten advice) and simply I did not use it.
I am going to test why placeins does not work.
Thank you both for replies to my question. Marek.
I am going to test why placeins does not work.
Thank you both for replies to my question. Marek.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to force placing the figure in the given section?
The \clear(double)page command forces the output of all float environments defined up to this point.Marek wrote:[...] But the ...{figure}[!ht] fully suffices to solve my problem though I have probably not understood the meaning of \clearpage (in Thorsten advice) and simply I did not use it. [...]
The package defines the \FloatBarrier command which restricts the floating of these environments. Refer to the package documentation to learn more.Marek wrote:[...] I am going to test why placeins does not work. [...]
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