This can depend on two reasons:
- too many packages;
- a programming error, such as saying
\newdimen inside the definition of a command.
In case 1, load
\usepackage{etex}
just after the \documentclass line. In case 2, correct the definition.
If you're loading morefloats or manyfoot, then add
\reserveinserts{28}
just after loading etex; this is necessary to accomplish with the needs of those packages.
Note
This trick has to do with the allocation mechanism of insertion classes, that use "high" numbered registers; for example the insertion class \@mpfootnotes uses the registers with number 254 and the last allocated one uses 234. An insertion class reserves the registers of type \count, \dimen, \skip, \box and, of course, \insert with the assigned number. Conversely, commands such as \newcounter or \newlength start from 11 upwards.
When the last allocated counter or length corresponds to number 233, the next request would result (with ordinary LaTeX) in the No room message. By loading etex, in this case the system will allocate instead the first free register in the extended pool, that is, from 256 to 32767.
The packages morefloats and manyfoot allocate 18 and 10 insertion classes; but, depending on the loading order, this could cause clashes; say that packages loaded before them allocate \count registers up to 220: there will be no room for the new insertion classes.
The command \reserveinserts{28} fools the allocation mechanism by pretending that registers from 206 to 233 are already occupied, so a request for a new register, when the last allocated one was 217, will go directly to the extended pool. In this way, morefloats and manyfoot can do their allocations safely, by occupying slots that are surely free, independently on the package loading order (the allocation commands are conveniently patched so as to not interfere with the process of insertion class allocation).
As Stephen remarks in a comment, if morefloats is loaded with more than 18 additional floats (which is the default), then the argument to \reserveinserts should be modified accordingly. Just add 10 to the number of floats for morefloats in case you also use manyfoot.