Search code examples
latexmemoir

LaTeX, ntheorem package and memoir document class: no room for new \count error


So I want to use memoir document class and the ntheorem package with the thmmarks option. When I try and compile a file like this, I get "no room for a new \count" errors. What can I do about this?

ntheorem with thmmarks option works fine in article, and ntheorem works alright in memoir as long as I don't try and use the thmmarks option...

To reformulate the question: Is there a way to, I don't know, cut out parts of the memoir class definitions that I don't use to free up some \counts for ntheorem thmmarks? Or is there a way to alter how many \counts LaTeX allows so that there are enough to share?

(I'm fully aware that insisting on using memoir for typesetting a theorem-heavy document is a little perverse, but what the heck.)


Solution

  • See the TeX FAQ entry about this error: No room for a new “thing”.

    With any modern LaTeX installation, you're going to be using eTeX. Thus, based on that FAQ entry, you should be able to fix the problem by inserting

    \usepackage{etex}
    

    immediately after your \documentclass line. If that's insufficient, try also adding the \reserveinserts{n} line suggested there with some appropriate number of additional inserts (which I guess you can find by trial and error), to reserve additional space. (A bit of Google-searching on reserveinserts ntheorem indicates that this is a common problem with the ntheorem package, and finds a suggestion of 10 as a reasonable value, though you may need more.)

    If that works, you might also write to the Memoir class author, and suggest that he add a note to this effect in the manual.

    This thread also suggests an alternate method of loading the ntheorem package that may help, if \reserveinserts doesn't do the trick: http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2009-03/msg00531.html