# How to find the lost text part when having “Float(s) lost” error

I've lost some text. I don't know if theres something missing, so how can I find it? I'm not in the mood to compare the chapter1.tex to the pdf file by reading both. Chapter 1 (chapter1.tex) is rather long but it's the only hint I got.

[35]

! LaTeX Error: Float(s) lost.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

l.215 \include{chapter1}

? H You've lost some text. Try typing to proceed. If that doesn't work, type X to quit.

So... Whats your coping strategy with that error? (Except not making the error)

• It will be a figure or table or something, so if you are expecting 10 figures and you only got 9.... it had just finished outputting page 35 (the [35] in your snippet) which should also give a clue. Don't put floating environments in minipages or other non-floating boxes. – David Carlisle Oct 26 '12 at 15:33
• I'm seeing this too. I'm using the AGU latex template, and everything works perfectly on draft mode, but I get this error, and one of my tables goes missing when not on draft mode. Even more annoying, this is the second of two nearly identical tables, and the first one works fine. Extremely frustrating. – naught101 Nov 16 '12 at 1:32
• @naught101 i found the cause by binary search. comment out, recompile, check, repeat... It was pretty frustrating. iirc the cause was a incorrectly closed doublequote. – helt Nov 16 '12 at 8:24
• uhh. thats loong ago... en.wikipedia.org/wiki/Binary_search_algorithm :) -- Instead of checking one line after an other, i comment out a large portion of text, check if the error is gone and then i comment back in the half of the previously disabled markup. by doing so, you need less runs. still too many, but less. – helt Apr 8 '14 at 15:48
• @DavidCarlisle: For the record (and for future visitors): This includes non-obvious floats within a box - in my case, the error occurred because of TODO callouts from the todonotes package. – O. R. Mapper Oct 5 '15 at 15:11

FWIW, my Float(s) lost error seemed to have been due to introducing a todo in a footnote probably because the package I use for adding todos uses marginpar internally.

• That also was the reason for my Float(s) lost error. – user35915 Jul 11 '16 at 11:27
• I my case the error was caused by a todo inside a wrapfigure. – ralien Mar 8 '18 at 11:13
• Is there a solution to this? That will allow the todo to still be tied to the figure? – argentum2f Feb 15 '19 at 17:36
• I had the same issue with todo inside a figure. +1 to the question of @argentum2f – Toivo Säwén Mar 7 '19 at 15:17
• For me: todo in al algoritm environment from the algorith2e package. – Jens Wagemaker Mar 28 '19 at 11:49

It will be a figure or table or other package-defined float type (eg algorithm). so if you are expecting 10 figures and you only got 9.... it had just finished outputting page 35 (that is the page numbered 35, not necessarily the 35th output page) (the [35] in your snippet) which should also give a clue.

Don't put floating environments in minipages or other non-floating boxes as this is the usual cause for lost floats.

The following example shows one way of visualising the lost floats. The Lost floats error is given as usual but if you carry on, each is lost float is output on an un-numbered page on its own before the document is resumed.

The example loses a couple of figures that were in a box, and a totdo note that was in a marginpar in a box. All three get output at the point of the error (a \clearpage) producing

\documentclass[a5paper]{article}

\usepackage{graphicx,todo}

\makeatletter
\let\old@error\@latexerr
\def\zzfl@error{Float(s) lost}

\def\@latexerr#1{%
\def\tmp{#1}%
\ifx\tmp\zzfl@error
\def\@elt##1{{%
\let \protect\noexpand
\shipout\vbox{\hbox{LOST FLOAT}\hbox{\fbox{\box##1}}}}}%
\@currlist\@dbltoplist
\let\@elt\relax
\fi
\old@error{#1}}
\makeatother

\begin{document}

xx

\begin{figure}

abc
\caption{dd}

\end{figure}

\parbox{4cm}{zzzz\marginpar{aa\todo{this}}}

\parbox{5cm}{a\begin{figure}
zzzz
\caption{zzzz}

\end{figure}}

\parbox{5cm}{a\begin{figure}
\includegraphics[height=1cm]{example-image-a}
\caption{wwwwwww}
\end{figure}}

\clearpage

some more text

\end{document}

• A note: a marginpar which appears inside another box is another example of something that this can happen with. – Joel Aug 25 '15 at 2:26

The error message hints that a figure or a table are lost, but I saw this a few times with no text or float loss.

The problem may be that a float is used inside a box. What makes it tricky to nail is the fact that the error might not arise immediately, but only after text is added elsewhere. Try replacing \marginpar with \marginnote (of the marginnote package) as suggested in Floats lost error.

My Float(s) lost error occured, similar to confused00's answer, because of a todo in a table.

I faced the same error using todonotes on beamer and confused00's explanation was right. If you're ok with inline comments, use \todo[inline]{comment} and the error should disappear.

• I'm a bit nicer here. I believe there is no single correct and short answer. I.e. a full answer would be very verbose. I therefore upvote any solving strategy there might be. – helt Mar 14 '17 at 19:35

I also had the same error, but have not used any todonotes nor footnotes. It is a very reference and citation-heavy document as ThomasH mentioned, but recompiling didn't help.

By playing around a bit I found that the figure itself was the problem, i.e. the pdf that I wanted to import as the figure. I generated/exported it from CorelDRAW and although it could be opened in adobe reader and seemed absolutely fine, it caused "Float(s) lost" problem when being imported into LaTex (LuaLaTex). I found out by trying to import another pdf figure in place of the one I added last and the error was gone.

I managed to get rid of the error by making the margins of the page in CorelDRAW larger before exporting the figure as a pdf. Then it didn't cause the problems and could be imported into LaTex as a figure.

So, the problem could lie with the figure file you are trying to import.

Edit: I should mention that the figure that caused the problem was NOT the same figure that was lost.

If you have a very reference- and citation-heavy document (say, a thesis or scientific paper), the error can sometimes resolve itself on a second compilation when suddenly all your ? get converted to actual text (Chapter 1 or Jones et al. (1986)). It's not necessarily a great idea to depend on that, but it just means that you might get away with compiling twice instead of trying to hunt down the error.

Just that you can snicker about me TeX noob: I put a begin/end figure inside a begin/end definition clause from a math package, which caused this error too. "Because it felt nicer." Captain Obvious says: Don't.