# How to prevent float before subsection? [closed]

I have the problem that alot of my floats show up before the subsection they are in.

I did read about placeins and \FloatBarrier here: How do I ensure that figures appear in the section they're associated with?

But this seem to only work for floats showing up in the next section but not for floats showing up in the last subsection.

My academic advisor wants all floats to be in the same subsection. There is no "but it's okay as long as they are in the same section".

I'm using LuaTex + scrreprt documentclass.

## closed as unclear what you're asking by Andrew Swann, egreg, user13907, Mensch, Stefan PinnowAug 28 '16 at 16:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Revolutionary idea: Just don't use the figure environment ;-) You can use \captionof{figure}{your caption text} instead of \caption (requires the caption (sic!!!) package. It's one of the greatest misunderstandings of LaTeX users that graphics must be in figure environments and tabulars in table environments. – user31729 Aug 22 '16 at 17:59
• @ChristianHupfer In which environment should i put the includegraphic instead? – Spen Aug 22 '16 at 18:13
• In no environment ;-) \includegraphics{yourfilename}\captionof{figure}{your caption text} (or the other way round if you prefer the caption above the figure). Neither graphics nor tabular environments require an outer floating environment. The only exception is \begin{center}...\end{center}, perhaps – user31729 Aug 22 '16 at 18:15
• @DiaaAbidou: Well, I have another opinion on this, because I using LaTeX for educational purposes and in that way floating figures and tables is confusing readers. – user31729 Aug 22 '16 at 18:22
• You might also try increasing the number of floats allowed per page. See tex.stackexchange.com/questions/161754/… – John Kormylo Aug 23 '16 at 4:13