I would like to place figures in my document in certain subsections. Normally I would achieve this with float using [H]. But this would mean, that the figures are at fixed points in my text and sometimes this just doesn't look good.

I already found this question: How do I ensure that figures appear in the section they're associated with?

How can I tell LaTeX use subsections as float barriers instead of sections.

  • My eyes keep wanting to pronounce placeins like proteins. :)
    – Kaz
    Jun 11, 2013 at 20:29

2 Answers 2


The placeins package, with the section option, redefines \section. You might succeed with \usepackage{placeins} and

    \gdef\@fb@afterHHook{\@fb@topbarrier \gdef\@fb@afterHHook{}}}%

This will do the same the section option does, but for \subsection instead of \section.

Untested. On a side note, don't use [H]: it's a sure cause for problems in placing floats.

  • This solves my problem with the positioning, but it changes all my section/subsection numbering.
    – user31386
    Jun 11, 2013 at 13:00
  • @DaniWho Sorry, I missed doing a change. Fixed. The \section command should have been \subsection.
    – egreg
    Jun 11, 2013 at 13:04
  • Note that this solution eliminates the \FloatBarrier in \section! It can happen that a float ends between a section title and its first subsection. To avoid this, you need to redefine both.
    – Luis
    Jul 29, 2016 at 17:43
  • this can clearly be used also for subsubsection Oct 10, 2018 at 15:29
  • 1
    @skan That happens if you call \usepackage[section]{placeins}. The answer tells you to call \usepackage{placeins}.
    – egreg
    Aug 18, 2020 at 20:16

If \subsection implicitely calls \FloatBarrier, then also \section should do it:


The following adds the implicit \FloatBarrier to \subsection:

  • Don't you mean "If \section implicitely calls \FloatBarrier, then also \subsection should do it"? Nov 4, 2017 at 21:01
  • 2
    @StrawberryFieldsForever No. Nov 4, 2017 at 21:17
  • I'm wondering whether or not we actually need all these expandafter commands... Apr 24, 2020 at 12:13
  • 1
    @LucEvertzen You will get an infinite recursion without \expandafter, when \subsection is called. Apr 30, 2020 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy