feat: add Typst support as alternative formula renderer
This PR adds support for Typst as an alternative to KaTeX for formula rendering in Slidev.
Features
- Added a new
formulaRendereroption in frontmatter to choose between 'katex' (default) and 'typst' - Implemented Typst.ts integration for rendering Typst formulas
- Added line highlighting support for Typst formulas
- Created documentation for Typst usage
Usage
To use Typst as the formula renderer, add this to your frontmatter:
---
formulaRenderer: typst
---
Deploy Preview for slidev failed.
| Name | Link |
|---|---|
| Latest commit | dcd87de3df52517386bd6fed3ebbef90d558bc30 |
| Latest deploy log | https://app.netlify.com/projects/slidev/deploys/6831922d4451b20008d374aa |
There is already a community addons for that https://github.com/slidevjs/slidev/pull/2179, have you tried it? If it works well I don't think we need to have it builtin
There is already a community addons for that https://github.com/slidevjs/slidev/pull/2179, have you tried it? If it works well I don't think we need to have it builtin
Well, to be clear these are different features. Consider this slide, which uses both typst and katex:
---
addons:
- slidev-addon-typst
---
Given pair of graphs $(H, G)$, determine *if there exists* an injective map $f: V_H \to V_G$ satisfying:
'''typst
$ (v,v') in E_H <==> (f(v), f(v')) in E_G $
'''
vs this slide, which would use typst exclusively via the proposed change:
---
formulaRenderer: typst
---
Given pair of graphs $(H, G)$, determine *if there exists* an injective map $f: V_H to V_G$ satisfying:
$ (v,v') in E_H <==> (f(v), f(v')) in E_G $
Neither the typst plugin nor MDC apparently supports inline syntax, I don't see how to avoid using katex for inline changes, but this is unfavorable.