Grisely / packages

Packages for Typst.
Apache License 2.0
3 stars 4 forks source link

Acrostiche: Index broken when using `used_only` flag for long documents #9

Closed koopa1338 closed 1 week ago

koopa1338 commented 1 week ago

I was able to reproduce the issue like this:

When compiling the document I get a warning:

warning: layout did not converge within 5 attempts
 = hint: check if any states or queries are updating themselves

This in itself isn't really an issue but the consequence is that the flag used_only will not work properly anymore and the index will only display one acronym definition.

Grisely commented 1 week ago

I could reproduce. I will look into it. I just recently introduced the used_only flag, and I do believe it is an important feature, but I must not have ironed out all the kinks yet. Thank you for this report.

Grisely commented 1 week ago

I think I found the source of the issue and possibly a way to solve it. The problem seems to be using the update function of a state inside a context and passing it a value instead of updating outside of a context and passing a function as described in this post on the forum. The fix works on a non-acrostiche version of the problem but I still need to find a way to integrate it in the package without breaking everything else or reverting to the old state system, hopefully.