-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible Typst writer extensions #8988
Comments
Rendering a Div with an identifier as a block with a label might make sense, though I'm not sure it's better than what the typst writer currently does (put the label at the beginning of the Div's contents). Abusing the label to represent a class does not seem right. |
Re identifiers, I don't think that the current behavior is correct, because "inserting a label into content attaches it to the closest previous element that is not a space", so in the following Typst fragment:
As for abusing a label to represent a class, if this was not intended then I wonder why show rules can be associated with labels. But anyway, I asked the Typst community and they agree that labels shouldn't be used for styling, and suggest using template functions. In other words, rather than this:
do this:
I'll experiment with the template function approach. |
I've fixed the label issue in commit cc371a9 I will close this issue but if you have particular suggestions for typst writer improvements they could go in separate issues. |
Thanks! BTW, I assume that we agree that something (as yet undetermined) has to be done with the
|
I don't agree that something has to be done with it. It depends what the options are in typst.
because that breaks unless the A more conservative approach would be to hook up this behavior to an attribute like |
One possible advantage of the label approach is that nothing will break if no Typst style is associated with the label (cf CSS). And one possible way round the fact that the
If I understand you correctly, one problem with |
Not necessarily; you could use a small filter to populate |
True. Thanks! |
Please see lvignoli/typst-pandoc#3 for some experimental Typst custom writer updates. I'd like to kick off a discussion here, perhaps resulting in some agreed enhancements to the official Haskell Typst writer.
My central desire was to be able to pass attributes to Typst. For example, with this input:
...the current (3.1.6.1) Typst writer gives this (attributes have been discarded):
...but "my" Typst writer gives this (I've omitted some generated preamble):
Unfortunately, Typst doesn't support more than one label per element, so I've used nested box/block elements to permit this (example below), which works, but is messy (plus there are some edge cases). I've initiated a discussion about that on the Typst Discord server.
Thoughts?
More complex example, illustrating multiple attributes.
The text was updated successfully, but these errors were encountered: