# [NTG-context] registers: how can I place a command around the whole of the page numbers of an index term?

MF massifr at fastwebnet.it
Thu May 10 12:28:45 CEST 2018

Thanks Wolfgang and sorry if i reply to my mail, since i've downloaded
yours on another PC.

I've found these macros in strc-reg.mkiv, that are called right before
and after the page numbers:

\unexpanded\def\startregisterpages
{\begingroup
\dostarttagged\t!registerpages\empty
\useregisterstyleandcolor\c!pagestyle\c!pagecolor}

\unexpanded\def\stopregisterpages
{\dostoptagged
\endgroup}

And this seems to work:

\let\origstartregisterpages=\startregisterpages%
\let\origstopregisterpages=\stopregisterpages%
\unexpanded\def\startregisterpages{\origstartregisterpages\wordright\bg
roup }
\unexpanded\def\stopregisterpages{\egroup\origstopregisterpages}

\setupregister[index][n=1,alternative=A]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\placeindex
\stoptext

I've also learned about \groupedcommand, which i did not know.
Again, thanks for you help.

Best wishes,
Massi