You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write #[= asdf] #lab instead for now, this is a current limitation in how label attachment is parsed. The compiler can correctly associate the label-specific <asdf> syntax with the entire heading, but as far as it knows = asdf #lab could be =asdf 5 (which would be part of the heading) or =asdf test (which would also be), so it disambiguates by having lab be part of the heading body, and thus it points to asdf (inside the heading) instead of the whole heading.
It's not a bug per se as the label is contained within the heading and there's not much the compiler can change about it at the parser stage. The only possible solution I'm aware of is to not allow variable labels to be attached via markup at all. We might do that. But even that would probably not completely eliminate the confusion.
I've had this issue as well, and found it quite confusing. You can find my experience in discussion #4043.
In my case I wrongly assumed the issue was with the dynamic label (built from a variable).
Both the documentation and the error codes were not very clear as to what was happening in this case.
What I tried seemed very intuitive to me, so I'm guessing more people will hit this issue.
If this is not fixable, maybe at least the error/help messages could be clearer?
Description
Reproduction URL
No response
Operating system
Linux
Typst version
The text was updated successfully, but these errors were encountered: