On Thu, Dec 04, 2025 at 03:51:52PM +0000, Werner LEMBERG wrote: > > The documentation says the following. > > ‘@thissectionnum’ > Expands to the number of the current section. > > Assuming we are in the second section of chapter three, this value > should be 2. However, `texinfo.tex` does something else: > `@thissectionnum` holds a string that combines the chapter and section > number with a full dot inbetween, i.e., ‘3.2’. > > IMHO this is a bug. If the variables held numerical values, it would > be easy to synthesize such a string with > > ``` > @thischapternum.@thissectionnum > ```
That would be a change in behaviour. These commands appear to have been introduced in 2007 and we should not change them. It would usually be more useful to put the full section number (including the chaper number) in the header or footer of a page. If it is really useful to be able to use the section number component on its own in a header or a footer, we should use a new command for this. > The opposite, namely to extract the numerical value of the section > number from this string, is possible with some TeX trickery, but this > is against the spirit of the Texinfo language. > > BTW, the documentation of `@thissection` is also misleading: the given > example doesn't show the chapter number (followed by a full dot). Thanks, I have changed it.
