![](https://secure.gravatar.com/avatar/ac04130d0a62959bfc8bf9e2b7b2b6b4.jpg?s=120&d=mm&r=g)
To meet some formal guidelines, I need to provide a word count of my abstract and a character count of the main text, and a character count of all the text appearing in figure captions. Is this possible (maybe using some lua-magic)? Thank you! Thomas Minimal example: \definestartstop [abstract] [style=bold, after={\blank[big]}] \starttext \title{My title: example of a word and character count} {\strut\tfx Formal guidelines: word count of abstract: $x$, character count of main text: $x$, character count of figure captions: $x$.} \blank \startabstract This is the abstract. Read this and that. \stopabstract % start of the main text Some random text with formulas \startformula y = α + βx + ε, \quad ε \sim N(0,σ^2) \stopformula And there are also figures with captions. \startplacefigure[ location=bottom, title={Residual plot with time $t$ on the x-axis and residuals $e_{jt}$ on the y-axis}, reference={fig:subject-residual}] \externalfigure[residuals][height=.242\textheight] \stopplacefigure And some more text with $x$ and $y$ and $z$, and \placeformula \startformula \startalign \NC a =\NC b \NR \NC c =\NC d \NR \stopalign \stopformula And stop. \stoptext