Forgot password
 Register account
View 268|Reply 3

LaTeX delimiter

[Copy link]

3211

Threads

7832

Posts

52

Reputation

Show all posts

hbghlyj posted 2023-2-27 23:32 |Read mode
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

3211

Threads

7832

Posts

52

Reputation

Show all posts

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

3211

Threads

7832

Posts

52

Reputation

Show all posts

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

3211

Threads

7832

Posts

52

Reputation

Show all posts

original poster hbghlyj posted 2023-5-12 06:11
Last edited by hbghlyj 2023-5-12 14:05oijaz.unicode-latex-1.2.0
我做了少量修改:
$type completion.js (954 Bytes, Downloads: 53)
$type extension.js (5.1 KB, Downloads: 51)
$type latex.js (61.43 KB, Downloads: 50)
使用negative lookbehind只替换\不替换\\

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-20 05:40 GMT+8

Powered by Discuz!

Processed in 0.013587 seconds, 28 queries