-
Notifications
You must be signed in to change notification settings - Fork 344
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
Typst: 1.6 introduces Pandoc interpolated variable to typst-template.typ
rather than typst-show.typ
#10212
Comments
Thanks for opening this. I don't want to promise that we'll take the PR sight unseen, because I'd like to know the full consequences first. We currently don't prioritize making the Typst LSP happy at all in templates, but that's roughly because we haven't considered it. I think we still want our templates to be well-structured for our goals first, and I don't know how far we'd go in the other direction. But if there are changes that make your use case better and don't really affect the overall structure of our templates (or maybe even improves it!), I think we would be happy making the change. |
This change makes sense to me. I wasn't aware of the convention of introducing variables in |
Thank you for the replies. Focusing on what's best for Quarto makes a lot of sense to me. (If you wanted to make the Typst LSP + everyone else happy, it'd be an unwinnable battle...) As the template itself itself is really building a big function call, I think that, generally, passing Pandoc variables to Typst (in I'll open a PR so that you can see it in context and be able to run any checks or other things. There are no hurt feelings if you decide that it's not best for the default template. On the default note, I plan to open a discussion over the holiday with some specific thoughts on improving the default template. For example, things like |
Thanks @christopherkenny! Looking forward to your contributions! |
Fixed by #10220 |
Bug description
A change in this commit introduces one Pandoc interpolated variable into
typst-template.typ
. While this is technically fine, as it really is a Pandoc template and valid code, this should probably be done intypst-show.typ
with all other Pandoc variables. As a bonus, this is makes Typst LSPs angry, because it makes the Pandoc-ness more apparent, and makes editing Typst templates a bit messier.Happy to PR in the minor changes necessary discussed below, if that's useful. I would have just opened a PR, but I didn't know if this was an intentional choice.
Finally, apologies if you view this more as a Feature Request as it technically isn't a bug, just a slightly off behavior. Happy to move to discussions if that's preferable.
Steps to reproduce
Create a Typst format with
And give it a name.
Line 64 of
typst-template.typ
now looks like below, which introduces a pandoc variable into the file.For testing completeness, this is just a document with an abstract, but any will do:
Expected behavior
All other partials introduce variables in
typst-show.typ
. I would expect to see:In the article definition in
typst-template.typ
Within the
article
body:In
typst-show.typ
:Actual behavior
No variables in Typst are created, the Pandoc interpolated variable is dropped into the article definition like so:
Your environment
(Replicates on IDE: Positron / OS: Windows 11 as well, as this is tied to the template.)
Quarto check output
The text was updated successfully, but these errors were encountered: