# Figure appears in the middle of my longtable [closed]

I have a latex file with a 'longtable' in it, which spans a couple of pages. I added a new figure earlier in the document, and now, the figure appears in the middle of my longtable - i.e. it splits it in two. Obviously I don't want this to happen.

I am having difficulty supplying a MWE, because the text and figures are part of an academic document which I cannot share, but when I remove parts of the text, everything gets shuffled around and the problem goes away.

• Figures you can replace with example-image provided by package graphics, instead real text you can use \lipsum from package lipsum. Without seeing the MWE, which show your problem is difficult to help you. Wild guess: see if figure option [!ht] can help, or option [H] – Zarko Jul 26 '17 at 13:49
• \clearpage will force the figure to print immediately (and start a new page). You can turn off top floats temporarily using \def\topfraction{0} inside a group. – John Kormylo Jul 26 '17 at 15:21
• Did you try the suggestions of Zarko and John Kormylo? Can you give some feedback? If you need more fine control over the text length then \lipsum, try either different paragraphs if lipsum \lipsum[2] or just copy and paste text as often as needed - but without seeing some code that produces the problem, its really hard to try to help you. – user36296 Jul 29 '17 at 18:46
• I would also suggest trying to supply an MWE with dummy text, dummy figures and dummy data in the table, otherwise recreating the problem in this instance is close to impossible. For dummy table data, you could use a free only service like mockaroo, which is able to generate realistic data that can easily be exported. From a CSV export to a LaTeX table is as easy as automatically replacing "," with " & " and "\n" with "\\\n". How text and figures can be replaced was already covered in the previous comments. – Big-Blue Jul 29 '17 at 21:00

You could use the package float and use the H option.

\usepackage{float}
...
\begin{documment}
\begin{figure}[H]