Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have concluded that the package float allows figures to float within the section they belong to. However for one particular section I need to restrict the floating to the subsection (without forcing the exact location).

http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Custom_Floats I think this is the description of what I need, but I can't work further with it.

outer counter - the presence of this parameter indicates that the counter associated with this new float should depend on outer counter, for example 'chapter'.

I need to set that outer counter to be subsection rather than section which is the default. however I only need that for one specific section. Everywhere else floats can float...

Seeing this:

\newfloat{type}{placement}{ext}[outer counter]

I have tried and replaced figure for figuresubsec on the cases I needed and used this:

\newfloat{figuresubsec}{htbp}{floats-ext}[subsection]

however the pictures do appear but don't move to their subsection and they don't appear in the list of figures.

share|improve this question
    
similar issues are disused here: Keeping tables/figures close to where they are mentioned –  Splashy Nov 9 '10 at 17:07
add comment

1 Answer

up vote 18 down vote accepted

Use the \FloatBarrier command of the placeins package.

EDIT: Counters associated with a float may influence float numbering, e.g. "Table 1.3" (third table in section 1 of an article) instead of "Table 3" (third table in an article). Those counters bear no direct relationship to float placement. (In the LaTeX standard book class, there's one indirect relationship: The \chapter command acts as a float barrier.)

EDIT2: The \newfloat command is used to create new types of floats, e.g. "maps" besides tables and figures. These "maps" may be listed in a "list of maps", but (unless you do some hacking) won't appear in the list of figures.

share|improve this answer
2  
placeins has a sections option that places a \FloatBarrier before each section command, so that \usepackage[section]{placeins} does what the qner wants. –  Charles Stewart Nov 3 '10 at 7:18
    
@Charles Stewart: The OP seems to want a \FloatBarrier for subsections (and only within one particular section), and I don't think there's a package option for that. –  lockstep Nov 3 '10 at 7:24
    
@lockstep: And, indeed, for one particular subsection - I had misread the qn. –  Charles Stewart Nov 3 '10 at 9:24
    
\FloatBarrier can be placed anywhere in the code, so it worked just fine. I'll keep in mind the automation \usepackage[section]{placeins} for the future –  Splashy Nov 8 '10 at 3:13
    
@lockstep: in book class, '\subsection' is the float barrier (or at least it seems to be) –  Splashy Nov 9 '10 at 14:50
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.