How can I get my table or figure to stay where they are, instead of going to the next page?
We can still influence where we'd like the figure to appear, though. If you add [hbt!] after the \begin , like this:
\beginfigure>[hbt!]
this then tells LaTeX to place the image right here (as close to the position in the source code as possible); or if that's not possible (e.g. it's too large to fit on the current page) at the top of the next page, or bottom of the next page. The exclamation mark ! is important: it tells LaTeX "please really respect my choices here".
However, if your figure is quite tall and there is not enough space on the current page (e.g. if it's already near the end of the current page), then the figure will still be moved to the top of the next page. In this case you might try moving your \begin[hbt!]. \end code a few paragraphs earlier in the code, where there is still more available on the current page at that point.
If that still doesn't work, and your figures/tables have then floated on ahead to appear after the next \section heading, you may prefer them to still appear at the end of the current section. You may then issue a \clearpage before the next \section to insert a pagebreak, which will also output all floats in the queue, before the next \section heading is printed on a new page.
Alternatively, have a look at the placeins package, where you can add \FloatBarrier before the next \section —or automate this by using the section package option, i.e. write \usepackage[section] in your preamble.
- Documentation Home
- Learn LaTeX in 30 minutes
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in L a T e X
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
- Font sizes, families, and styles
- Font typefaces
- Supporting modern fonts with X Ǝ L a T e X
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class
Advanced TeX/LaTeX