3

Why in plain TeX it says "New counters are allocated starting with 23, 24, etc. Other registers are allocated starting with 10"? I want to know what's the difference between counters and registers in TeX. If anyone could enlighten me on this that will be highly appreciated.

7

First of all counters in plainTeX are registers!

New counters are allocated starting with 23, because the lower register numbers are already in use. From the documentation of plainTeX:

% The following counters are reserved:
%   0 to 9  page numbering
%       10  count allocation
%       11  dimen allocation
%       12  skip allocation
%       13  muskip allocation
%       14  box allocation
%       15  toks allocation
%       16  read file allocation
%       17  write file allocation
%       18  math family allocation
%       19  language allocation
%       20  insert allocation
%       21  the most recently allocated number
%       22  constant -1

So most of the reserved counter registers are needed to manage the allocation of registers. And that is the reason why other types of registers does not need such a lot of reserved register. For other registers with ten reserved registers those reserved registers are for free temporary usage.

  • But how to explain Other registers are allocated starting with 10? – Jiapan Feb 10 '17 at 9:15
  • @Jiapan -- just rephrase the comment above the list as "The following counters (registers) are reserved:". – barbara beeton Feb 10 '17 at 9:52
  • @Jiapan: Each register is of different kind and for a different purpose and counters, i.e. number registers are needed a little bit more — you need more of numbers for common tasks then other registers, such as boxes or tokens etc. – Marcel S. Feb 10 '17 at 23:51
  • 1
    @Jiapan: Also, do not forget that plainTeX is just a bunch of macros over virgin TeX. If you create different set of macros you may perhaps need more box registers for your macros and leave only those above, say, \box30 to users, whilst leaving them all the number registers — counters — above, say, \count15 – Marcel S. Feb 10 '17 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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