找回密码
 快速注册
搜索
查看: 56|回复: 3

LaTeX delimiter

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-2-27 23:32 |阅读模式
The regular expression \\\[(.*?)\\\]|\\\((.*?)\\\)|\$\$(.*?)\$\$|\$(.*?)\$ will match LaTeX formulas.

You can test it at regex101.com/

Screenshot 2023-02-27 at 15-36-29 regex101 build test and debug regex.png

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-2-27 23:35
建议论坛公式编辑器像regex101这样的效果, 把LaTeX公式背景高亮
可以研究一下regex101如何实现这样的效果

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-4-13 22:27
我发现 regex101 文本编辑器是一个带有 contenteditable="true" 的 <div>
背景高亮是使用 <canvas> 实现的。
Screenshot 2023-04-13 152522.png

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-5-12 06:11
本帖最后由 hbghlyj 于 2023-5-12 14:05 编辑 oijaz.unicode-latex-1.2.0
我做了少量修改:
$type completion.js (954 Bytes, 下载次数: 0)
$type extension.js (5.1 KB, 下载次数: 0)
$type latex.js (61.43 KB, 下载次数: 0)
使用negative lookbehind只替换\不替换\\

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 15:19

Powered by Discuz!

× 快速回复 返回顶部 返回列表