zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
26.09k stars 1.78k forks source link

(Feature request) Auto formula convert within markdown between "$". #4784

Open AppleRabbitDENG opened 4 weeks ago

AppleRabbitDENG commented 4 weeks ago

Describe feature

e.g. 如果你有两个离散随机变量 $X$ 和 $Y$ 的联合概率分布 $P(X, Y)$,那么 $X$ 的边缘分布可以通过对 $Y$ 的所有可能值求和来计算: $ P(X = x) = \sum_{y} P(X = x, Y = y) $ 同理,$Y$ 的边缘分布是: $ P(Y = y) = \sum_{x} P(X = x, Y = y)

should auto convert to: 如果你有两个离散随机变量 $X$ 和 $Y$ 的联合概率分布 $P(X, Y)$,那么 $X$ 的边缘分布可以通过对 $Y$ 的所有可能值求和来计算: $P(X = x) = \sum{y} P(X = x, Y = y)$ 同理, $Y$ 的边缘分布是: $P(Y = y) = \sum{x} P(X = x, Y = y)$

whenever i paste some markdown code or import markdown

Additional Information

No response

Nriver commented 4 weeks ago

Trilium-py can handle it well https://github.com/Nriver/trilium-py?tab=readme-ov-file#advanced-usage--upload-markdown-files

image

lhx332251335 commented 3 weeks ago

While my solution might not fully meet your requirements, I have made a widget that performs a similar function. It adds a button to the center pane that converts math formulas wrapped in single dollar signs ($) and double dollar signs ($$) into HTML format. You can find the details and the script in #4792 .

image image