oxedyne/fe2o3/fe2o3_austenite/tests/fixtures/eval/general/counters_state.typ
689 bytes, 1 run
created by r1870400018:63880, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | // Counters, state and context queries across pages. |
| 2 | #set page(width: 220pt, height: 160pt, margin: 20pt) |
| 3 | #set heading(numbering: "1.") |
| 4 | #let st = state("seen", 0) |
| 5 | #let ctr = counter("mine") |
| 6 | = One |
| 7 | #st.update(x => x + 1) #ctr.step() |
| 8 | #context [#metadata((counter(heading).get(), st.get(), ctr.get(), here().page())) <probe>] |
| 9 | #pagebreak() |
| 10 | = Two |
| 11 | #st.update(x => x + 10) #ctr.step() #ctr.step() |
| 12 | #context [#metadata((counter(heading).display(), st.get(), ctr.get(), counter(page).get(), st.final())) <probe>] |
| 13 | == Two point one |
| 14 | #context [#metadata(query(heading).map(h => (h.body, h.level, h.location().page()))) <probe>] |
| 15 | #context [#metadata(query(selector(heading).before(here())).len()) <probe>] |