Skip to content
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 blocks for globals variables #19

Open
feelingnothing opened this issue Aug 9, 2023 · 3 comments
Open

Typst blocks for globals variables #19

feelingnothing opened this issue Aug 9, 2023 · 3 comments

Comments

@feelingnothing
Copy link

Not familiar with the codebase of typst or this plugin, but is this possible? Would be great to have some file-scoped globals, or, for example, some typst inside the settings for wide-scoped things.

@fenjalien
Copy link
Owner

Do you mean defining a variable in one code block then importing it from another? I was thinking implementing that at some point.
There are also preambles in the settings...

@feelingnothing
Copy link
Author

Preamble is great. I think that there should be either a switch in the settings that lets you define all blocks in the file as a scope, so that you can use variables from other blocks (kinda like jupyter notebook), or a special kind of block that makes it global on file scope

@fenjalien
Copy link
Owner

Defining something in the frontmatter would be possible that then affects all code blocks in the same file. However this won't work for math blocks as they don't have any idea which file they are in when created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants