I look for a way to show the first and last values of a counter in the header, like in this question, but for ConTeXt.
If we, at a page break, are in the middle of a problem, I could live with the reference number to be either to the one starting before the current page, or to the first new one on the current page.
If there is only one problem on the page, I would prefer Problem X instead of Problem X-X.
Question Is there a (simple) way of doing this in ConTeXT?
My try:
I found this question, which looks like it could solve my problem, but I have a counter and not a marking with my enumeration. With the naive
\setuppapersize[A6][A5,landscape]
\setuparranging[2SIDE]
\setupheadertexts[{Problem \getnumber[problem][first]--\getnumber[problem][last]}]
\defineenumeration[problem][
text=Problem,
]
\starttext
\dorecurse{4}{\startproblem[problem:\recurselevel]
\samplefile{ward} We are now in problem
\in[problem:\recurselevel]\stopproblem}
\stoptext
I get the following, unwanted, output (I would expect the left page to have header "Problem 1–2" and the right one to have "Problem 3–4"):
Perhaps the question could be reformulated as:
Question Is there a way to automatically connect a marking to use with the enumeration counter to obtain what I look for?


\directconvertedcounter{problem}{number}instead of\rawcountervalue[problem]to respect thenumberconversionof the enumeration (here there is none, so it doesn't matter). – Henri Menke Mar 05 '19 at 20:34