For my report, I need to add word counts to the title page for different sections, I can do a manual count but hopefully there is a better solution.
This is was my attempt but counters that update later won’t update previous calls to it. Using #total-words will give me the whole documents count but the assignment requires it for each section.
#let ReportCount = counter("ReportCount")
#let selfReviewCount = counter("selfReviewCount")
#text(size: 16pt)[
#table(
columns: (30%,70%),
stroke: none,
[Word Count:],[Work report: #context ReportCount.display() words
(4,000 +/- 10%)\
Self-review: #context selfReviewCount.display() words (700 minimum)\ ]
)]
#pagebreak()
#word-count(exclude: (heading, highlight), total => [
#ReportCount.update(total.words)
Report text
])
#word-count(exclude: (heading, highlight), total => [
#selfReviewCount.update(total.words)
Self review text
])
Any help is appreciated, thanks.