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

Allow loading preambles from file #61

Open
kimhanm opened this issue Jul 8, 2024 · 1 comment
Open

Allow loading preambles from file #61

kimhanm opened this issue Jul 8, 2024 · 1 comment

Comments

@kimhanm
Copy link

kimhanm commented Jul 8, 2024

Add an option to define the typst preambles in a file, similar to obsidian-latex-suite plugin.
See artisticat1/obsidian-latex-suite#39, and artisticat1/obsidian-latex-suite@3d8f31f.

@kimhanm
Copy link
Author

kimhanm commented Oct 25, 2024

There is a workaround to get typst to load a preamble from a file within the vault.
In the preamble blocks, put

#set text(fill: white, size: SIZE)
#set page(width: WIDTH, height: HEIGHT)

#import "./../../../../../../path/to/typst-preamble.md":*

the ../ are there to ensure that the preamble loads even if the file is not in the same directory as the preamble, and a few extra doesn't seem to impact it.

If you save the preamble as a .typfile, you won't get a bunch of #let tags in your database, but it will allow you to link macro definitions to your notes.

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

1 participant