#Automatic paragraph numbering

3 messages · Page 1 of 1 (latest)

fervent bramble
#

I saw a post on reddit asking about this. I was curious and I tried this:

#let parcount = counter("paras") #show par: it => [ #parcount.step() #parcount.display(). #it ]
But the compiler crashes! The same is true even for

#show par: it => [ X #it ]

although [ #it #it ] for instance works, and shows each par twice.

tranquil lark
valid hazel
#

note the reason your show rule is recursive is because [X #it] is itself a new paragraph, even if it doesn't recurse on the original one