Re: [NTG-context] Definition of \registerpagerange (Henning Hraban Ramm)
This doesn’t answer your question, but I found:
\setupregister[index][compress=yes] % 14, 15 becomes 14-15 \setupregister[index][compress=text] % 14, 15 becomes 14f.
To change the "f."/"ff." text, you’d use:
\setuplabeltext[de][following:singular=sq.,following:plural=sqq.]
This is defined in tex/context/base/mkiv/lang-txt.lua and addressed in context/base/mkiv/strc-reg.mkiv in the definition of \registerpagerange:
\unexpanded\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class #2:processor content, content todo: -- configurable {\pushcurrentregister{#1}% \edef\p_pagenumber{\registerparameter\c!pagenumber}% \ifx\p_pagenumber\v!no\else \registerpageseparator \global\setconstant\c_strc_registers_page_state\plusone \dostarttagged\t!registerpagerange\empty \dostarttagged\t!registerfrompage\empty \withregisterpagecommand{#2}{#3}{#4}{#5}% \dostoptagged \ifconditional\c_strc_registers_following \ifnum#3=\numexpr#6-1\relax \labeltext{following:\s!singular}% \else \labeltext{following:\s!plural}% \fi \else \registeronepagerangeseparator \dostarttagged\t!registertopage\empty \withregisterpagecommand{#2}{#6}{#7}{#8}% \fi \dostoptagged \dostoptagged \fi \popcurrentregister}
(see https://source.contextgarden.net/tex/context/base/mkiv/strc-reg.mkiv?search=... )
You should be able to combine the two "else" branches. Thank you for answering. I have had looked into this source before and
Am Mittwoch, den 06.05.2020, 06:55 +0200 schrieb ntg-context- request@ntg.nl: tried exactly the same approach you descrived but I am on TeXlive 2019 where this is defined differently: \unexpanded\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class #2:processor content, content todo: -- configurable {\pushcurrentregister{#1}% \edef\p_pagenumber{\registerparameter\c!pagenumber}% \ifx\p_pagenumber\v!no\else \registerpageseparator \global\setconstant\c_strc_registers_page_state\plusone \dostarttagged\t!registerpagerange\empty \dostarttagged\t!registerfrompage\empty \withregisterpagecommand{#2}{#3}{#4}{#5}% \dostoptagged \registeronepagerangeseparator \dostarttagged\t!registertopage\empty \withregisterpagecommand{#2}{#6}{#7}{#8}% \dostoptagged \dostoptagged \fi \popcurrentregister} and, most importantly, does not work with this approach: \unexpanded\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class #2:processor content, content todo: -- configurable { \pushcurrentregister{#1}% \edef\p_pagenumber{\registerparameter\c!pagenumber}% \ifx\p_pagenumber\v!no\else \registerpageseparator \global\setconstant\c_strc_registers_page_state\plusone \dostarttagged\t!registerpagerange\empty \dostarttagged\t!registerfrompage\empty \withregisterpagecommand{#2}{#3}{#4}{#5}% \dostoptagged \ifnum#3=\numexpr#6-1\relax f.% \else \registeronepagerangeseparator \dostarttagged\t!registertopage\empty \withregisterpagecommand{#2}{#6}{#7}{#8}% \fi \dostoptagged \dostoptagged \fi \popcurrentregister} May it be that parameters have changed since then? Best regards Stefan
participants (1)
-
Hynek, Stefan