add tag
3 years ago samcarter

Back in the days before TL2020 I’ve been using the xcntperchap package to get access to the number of subsections within each section. This was very useful for creating custom tocs in beamer, e.g. here a fancy example using a mindmap:

However this quick hack no longer works with the current kernel, so I was wondering if there are any alternatives which would give me the number of subsections in each section?

Minimal (non-)working example:

Top Answer
3 years ago Phelype Oleinik

The issue is not exactly in the kernel, but in the L3 programming layer. \c_zero was deprecated a while back, because it’s name doesn’t follow the expl3 naming conventions: it’s an int, but it’s missing the variable type (so we couldn’t have a \c_zero_fp, for example).

Christian was very kind to fix most of his packages after this deprecation (even if not actively maintaining them anymore), but xcntperchap seems to have been forgotten.

To work around the issue you can, although not really recommended, use:

anywhere in your preamble to make \c_zero be the same as \c_zero_int.


For completeness, here’s a full example (exactly the same as yours, with the lines above added):

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.