Graphics, Figures & TablesLimited Number of floating Objects

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
SkZ
Posts: 3
Joined: Wed Dec 05, 2012 5:23 pm

Limited Number of floating Objects

Post by SkZ »

I need to include a lots of figures in my thesis. Only for the photometric catalogue chapter I have to include 34-38 figures, but after the 18th figure if I try to include another one the compiler starts to give errors. I use Kile on a Kubuntu 11.10 system.

The code for the figures are generated by a script so it's the same with only the names changed

Code: Select all

\begin{figure}[!hp]
\centering
\includegraphics[width=.9\textwidth]{fig/Ctlg-NGC6553-c}
\includegraphics[width=.9\textwidth]{fig/Ctlg-NGC6553-f}
\caption{The $\Ks{}$ vs $J-\Ks{}$  color-magnitude diagrams (CMD) for NGC6553. \emph{Top}: CMD of the inner part of the cluster. \emph{Bottom}: CMD of an external annular comparison field.}\label{fig:Ctlg-NGC6553}
\end{figure}

\begin{figure}[!hp]
\centering
\includegraphics[width=.9\textwidth]{fig/Ctlg-NGC6558-c}
\includegraphics[width=.9\textwidth]{fig/Ctlg-NGC6558-f}
\caption{The $\Ks{}$ vs $J-\Ks{}$  color-magnitude diagrams (CMD) for NGC6558. \emph{Top}: CMD of the inner part of the cluster. \emph{Bottom}: CMD of an external annular comparison field.}\label{fig:Ctlg-NGC6558}
\end{figure}
 
when I try to add the images for NGC6558 , I get

Code: Select all

<fig/Ctlg-NGC6544-c.eps>
File: fig/Ctlg-NGC6544-f.eps Graphic file (type eps)
 <fig/Ctlg-NGC6544-f.eps>
File: fig/Ctlg-NGC6553-c.eps Graphic file (type eps)
 <fig/Ctlg-NGC6553-c.eps>
File: fig/Ctlg-NGC6553-f.eps Graphic file (type eps)

<fig/Ctlg-NGC6553-f.eps>

! LaTeX Error: Too many unprocessed floats.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.181 \begin{figure}[!hp]
                         
You've lost some text.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Undefined control sequence.
\latex@xfloat ...vf \fi \global \setbox \@currbox 
                                                  \color@vbox \normalcolor \...
l.181 \begin{figure}[!hp]
                         
The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Missing number, treated as zero.
<to be read again> 
                   \color@vbox 
l.181 \begin{figure}[!hp]
                         
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.)

File: fig/Ctlg-NGC6558-c.eps Graphic file (type eps)
<fig/Ctlg-NGC6558-c.eps>
File: fig/Ctlg-NGC6558-f.eps Graphic file (type eps)
! Undefined control sequence.
\@largefloatcheck ->\ifdim \ht \@currbox 
                                         >\textheight \@tempdima -\textheigh...
l.186 \end{figure}
                  
The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Missing number, treated as zero.
<to be read again> 
                   >
l.186 \end{figure}
                  
A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.)

! Undefined control sequence.
<argument> \@currbox 
                     
l.186 \end{figure}
                  
The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Argument of \@xnext has an extra }.
<inserted text> 
                \par 
l.186 \end{figure}
                  
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce this error. If you simply proceed now, the `\par' that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Removing any image, the errors disappear.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Limited Number of floating Objects

Post by Stefan Kottwitz »

Hi,

welcome to the board!

You can increase the number of floats which can be handled by LaTeX if you load the morefloats package:

Code: Select all

\usepackage[maxfloats=40]{morefloats}
A value of 256 should be the maximum, but probably a memory problem would occur before this number can be reached.

Stefan
LaTeX.org admin
SkZ
Posts: 3
Joined: Wed Dec 05, 2012 5:23 pm

Limited Number of floating Objects

Post by SkZ »

Thanks!

But LaTeX complains.
The option `maxfloats=100' was not declared in package `morefloats', perhaps you misspelled its name.
but it works, so it accepts the option.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Limited Number of floating Objects

Post by localghost »

An alternative could be to place \clearpage after e.g. every tenth float (see Section 3 of the morefloats manual).


Best regards and welcome to the board
Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Limited Number of floating Objects

Post by Stefan Kottwitz »

Perhaps you have an older version of that package installed. An earlier version used a fixed value of 36, so doubling the number.

Btw. without the package you could use \clearpage or \cleardoublepage in the document to print out the unprocessed floats, so the number of stored floats would not get too high.

Stefan
LaTeX.org admin
SkZ
Posts: 3
Joined: Wed Dec 05, 2012 5:23 pm

Re: Limited Number of floating Objects

Post by SkZ »

I think the same: removing the option I get no errors.
Maybe I'll update the package since the old just extend to 36 (according to the pdf, and I have 38 clusters, but now only 31 figures ready).
Thanks again for the help
Post Reply