Org babel for typst. It can generate image or pdf, and inserts link to them.
If you are not familiar with org-babel, links below might be useful.
Along with this package, you also need typst/typst cli command
(leaf ob-typst
:el-get Cj-bc/ob-typst)Write typst in code block
#set text(fill: white, size: 25pt)
= Hello!
This is sample typst snippet with formula $y = x^2 + 2x + 3$.Calling C-c C-c (org-ctrl-c-ctrl-c) on it converts it into image,
saves to temporary file, and inserts link to it.
If you are using png or svg, you can press C-c C-x C-v
(org-toggle-inline-images) to preview image in the buffer.
You can specify file name for the generated image/pdf by :outfile argument:
= Hello Sample file!
This file should be at _images/sample.png_You can define default page rule (defines page size, etc)
ob-typst/default-rules-alist that will be automatically inserted when
no relevant rule is written in the snippet.
By default, It sets page rule and width and height are auto so
that it won’t be too big.
#set page(width: auto, height: auto, margin: 0.3em)It defines default file format to use when :outfile is not specified.
It defines default rules for settable elements.


