GeneralHow to force placing the figure in the given section?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Marek
Posts: 20
Joined: Wed Jan 30, 2008 3:36 pm

How to force placing the figure in the given section?

Post by Marek »

How to force placing the figure anywhere but in the given (sub)section? The figure's option [h] is to strong.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

How to force placing the figure in the given section?

Post by Stefan Kottwitz »

Hi Marek,

the placeins package may be useful.

Stefan
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to force placing the figure in the given section?

Post by localghost »

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¹
Marek
Posts: 20
Joined: Wed Jan 30, 2008 3:36 pm

Re: How to force placing the figure in the given section?

Post by Marek »

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.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to force placing the figure in the given section?

Post by localghost »

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 \clear(double)page command forces the output of all float environments defined up to this point.
Marek wrote:[...] I am going to test why placeins does not work. [...]
The package defines the \FloatBarrier command which restricts the floating of these environments. Refer to the package documentation to learn more.
Post Reply