I think that this might be a common challange:
In the document I have headlines (h2) that need to be showed as thumb index.
I used an rotated margin box for showing it in the margin area by updating the content whenever the h2 changes. This works perfect with
string-set: title content(text);
Now the challange: For each new h2 the margin box position needs to be changed so that the reader of the printed book can see where a chapter starts and ends with help of the thumb index.
I thought I could use calc() and a counter-increase for the h2 headlines. But counters only give back strings and up to now for the css standard discussions it was refused to make the value accessible as integers. (Discussion of Working Group: https://github.com/w3c/csswg-drafts/issues/1026 )
My question: anyone else who tried to solve it?
Is there a work arround or solution to adjust the rotate margin box position with each chapter?
Here is a picture that illustrates the use case and inteded use of h2 headline and the desired margin box position:
Thanks for your replys