Feat: Add tags which can be provided on each theorem instantiation an… #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a tags field to the numbering attachment of the theorem figures. For each instance of a theorem by the document author, they can provide a list of named tags the want to attach to the theorem. These tags will be available to the styling function through params.tags..
I would still need to add tests and some documentation for discoverability of the feature. But before that, I would like to know if you would be open to merging this feature:
Use case for the feature
When each instance of a theorem in your document needs instance-specific metadata to be styled correctly.
For example, I recently prepared for an exam and compiled a collections of theorems we needed to know. I wanted to annotate my theorems with the exam that they were questioned for. The only way this was really possible was by jumbling them up into the name attribute, which was very limiting.
Note this example using my proposed implementation.
The code relies on knowing the theorem name and the exam separately, so it can inject the theorem in between them.
Design and considerations
The proposal at hand:
theorem-kind
function, you may now provide a dictionary of allowed tag values and default values for them.Possible alterations and their downsides:
theorem-kind(..., tags: (exam: (content, str, array), ...)
would clutter code. Also, this is more in line with the (lack of) typing in function signaturesThe implementation at hand is the most conservative one imo