Support LaTeX formulas in Markdown cells through pandoc-to-image + unicodeit pipelines
### Problem
I've noticed that LaTeX formulas in Markdown cells are not rendered correctly.
For example, adding the following in a Markdown cell:
```
f(x,y)=\textrelu(xᵢ×yⱼ)\textfori=1\ldotsN₀, j=1\ldotsN₁
dx[i,j]=fₓ'(x,y)[i,j]×dz[i,j]
```
Renders as:
<img width="557" height="81" alt="Image" src="https://github.com/user-attachments/assets/df07f7c7-fa8b-418e-9a6d-d34e0d94897f" />
I've reproduced this error with both the development and latest official releases.
### Expected behavior
I expect LaTeX formulas to be rendered properly as they're on the web.
### Proposed solution
What about we try to convert LaTeX formulas to images? This is the approach used by `presenterm` and it works well, see [this thread](https://mfontanini.github.io/presenterm/features/code/latex.html).
The idea would be that we would trigger image generation for LaTeX code as soon as Markdown cells are to be rendered, and revert back to the source when they can be edited.
That solution will work for LaTeX code within double dollar signs `$$hello$$`. However, LaTeX formulas using single dollar signs `$h$` that are supposed to be rendered inline won't work. For that case, we could use something like [unicodeitplus](https://github.com/HDembinski/unicodeitplus) which will do a best effort approach to rendering LaTeX as unicode characters (works surprisingly well).
### Addendum
Curious to hear your thoughts.
关闭于 2026-05-08 4 条评论