TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently working on generating the pentest-reports of the company I work for with tex.

I came across the totcounter package which I use for the overview table of the findings. there i'm adding three counters per host in a table:


This tex-table gets generated by a ruby script which reads a nmap-report. so I get a lot counters...

the problem I now have is that I get an error:

No room for a new \counter ...

Is there a maximum number of counters in TeX?

share|improve this question
Can you use e-TeX? If so, load the etex package to get around 32k registers (otherwise you're stuck with 256). (Note: there are some registers needed for the allocation system itself, so the total available is lower than might be implied.) – Joseph Wright Jun 18 '14 at 11:07
Or do the counters in ruby and simply write the results into the tex file. – Thruston Jun 18 '14 at 11:14
etex works. thanks. cant use ruby - since i increment the counters with the findings i write in tex.... – red667 Jun 18 '14 at 11:52
up vote 8 down vote accepted

The maximum number of count registers:

  • TeX: 0 to 255 (28-1)
  • e-TeX: 0 to 32767 (215-1)
  • LuaTeX: 0 to 65535 (216-1)


  • Package etex makes the additional count registers available for LaTeX:

  • In LaTeX 100 or more count registers are already allocated or reserved and not available for \newcount/\newcounter. Thus about 147 count registers are free after class report is loaded.

Overview table problem

Possible solutions/workarounds:

  • \usepackage{etex}

  • If the overview table comes after the tables, then the maximum values can also be stored in macros without the need for .aux files and additional LaTeX runs. Then a limited set of counters can be reused for the different tables.

  • The needed values for the overview can be written into the .aux file. Then they are available at the next LaTeX run.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.