Forgot password?
 Create new account
Author: 色k

[666] 图片公式转 LaTeX —— Mathpix Snip

[Copy link]

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-4 23:00:49

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-7 02:10:28
Screenshot 2022-03-06 180941.png
发现mathsnip支持一种非标准的指令:
\lcm
好像是右括号加下划线?什么情况

它应该用的是mathjax-node

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2022-3-7 04:06:30
回复 22# hbghlyj

倒过来的除法符号?第一次见

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-12 01:32:35
左侧的边栏又有新变化了!
今天之前:
Screenshot 2022-03-11 173018.png
今天:
Screenshot 2022-03-11 173209.png

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-12 02:04:03
[b]回复 [url=forum.php?mod=redirect&goto=findpost&pid=43596&ptid=6122]23#[/url] [i]kuing[/i] [/b]
又发现mathsnip中的一个非标准指令
捕获.PNG
\Perp显示出来是双竖线的\perp
$\perp\!\!\!\perp$



$\underline{\ \smash{\small∥}\ }$
好不奇怪


其实我识别的是"平行且等于"这个符号
这个符号好像是只有国内在用...
表示"平行且等于"
在本论坛自定义指令为\pxd
pqd: '\\stackrel{\\smash[b]{/\\!/}}{\\raise-.3ex{=}}',

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-12 19:23:37
好像国内常见的是\backsim $\backsim$而不是\sim $\sim$

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2022-3-12 20:13:58
回复 26# hbghlyj

国内是 S 横放

S ∽

zhihu.com/answer/187478607

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-13 05:56:43
回复 27# kuing
Screenshot 2022-03-12 220425.png
又发现一个非标准的指令被mathsnip支持:
∢        Spherical Angle        #8738;        #x2222;
\varangle (在“近代的欧氏几何学”中表示“有向角”,英文:directed angle,Evan Chen的文章,Mathworld,Briliant wiki)
然而在MS word中,\varangle对应的符号是
∡        Measured Angle        #8737;        #x2221;
更多的角的Unicode

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-13 06:06:32
在MathJax中,
$\angle$(\angle) generates ∠, $\measuredangle$(\measuredangle) generates ∡ and last but not least, $\sphericalangle$(\sphericalangle) generates ∢.

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-3-21 06:51:29
Screenshot_2022_0320_224904.png 请问texpage.com这个「智能识别为LaTeX公式」是否基于Mathpix

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-4-23 17:44:55
在Mathpix snip notes中,希腊字母如果用指令打出来就不能加粗?用Unicode打出来可以加粗
Screenshot 2022-04-23 104222.png Screenshot 2022-04-23 104438.png
  1. $\mathbf\tau$
  2. $\mathbfτ$
  3. $\boldsymbolτ$
Copy the Code
$\mathbf\tau$
$\mathbfτ$
$\boldsymbolτ$

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-5-22 23:39:55
snip又更新了,切换插入原始图片/TeX代码的按钮:
Screenshot 2022-04-24 055320-Laptop-win11-Keyang-li.png

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-5-23 20:31:02
Last edited by hbghlyj at 2022-8-3 20:20:00The best OCR for Chinese and math
1.png

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-6-1 09:14:28
Mathpix snipnote又更新了,多了一个numbered latex选项.
$value[1].jpg

17

Threads

126

Posts

1822

Credits

Credits
1822

Show all posts

uk702 Posted at 2022-6-3 18:56:10
Last edited by uk702 at 2022-6-3 19:06:00(已删除)

Comment

其实编辑器选项有一个删除  Posted at 2022-7-16 20:59

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-7-16 21:03:38
MathPix同步滚动
scroll.gif
这里图片限大小1M,所以只能录制这么短的一段

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-8-4 02:23:34
Insert handwritten equation QQ图片20220803044150.png
Insert handwritten diagram or picture QQ图片20220803044150.png

QQ图片20220803044150.png

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-12-18 00:53:03

Mathpix snipnote所用的修改版MathJax与原装的MathJax的差异

kuing 发表于 2022-3-6 21:06
回复 22# hbghlyj

倒过来的除法符号?第一次见
又发现一个Mathpix识别公式所输出的、不被MathJax支持的、数学模式下
\AA

其实是在TeX文本模式下的angstrom符号.
  1. \documentclass{article}
  2. \begin{document}
  3. Atomic distances are measured using the unit \AA
  4. \end{document}
Copy the Code

Screenshot 2022-12-17 at 16-52-48 Editing Solutions_104f17_Mid_Term-2 - Snip Web.png
而在Mathpix snipnote编辑器文本模式中没有上述符号(原样输出)
Screenshot 2022-12-17 at 17-08-36 Editing Solutions_104f17_Mid_Term-2 - Snip Web.png


另外, Mathpix snipnote编辑器文本模式支持TeX的文本模式的部分符号:
\{ \}
\_
\&
\#
\S
\textbar
\textless \textgreater
\textendash \textemdash
\textexclamdown \textquestiondown
\texttrademark \textregistered
\textbackslash
\pounds
而在Mathpix snipnote编辑器数学模式中没有上述符号(报Undefined control sequence)

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-4-18 06:05:24
Mathpix官方API文档是用Python写的,需要转成Javascript
online converter to convert Python code to JavaScript:
Response: json() method
  1. const APP_ID='APP_ID', APP_KEY='APP_KEY';
  2. function mathpix(img){
  3. text=fetch("https://api.mathpix.com/v3/text", {
  4.     method: 'POST',
  5.     headers: {
  6.         'Content-Type': 'application/json',
  7.         'app_id': APP_ID,
  8.         'app_key': APP_KEY
  9.     },
  10.     body: JSON.stringify({
  11.         "src": img.src,
  12.         "math_inline_delimiters": ["$", "$"],
  13.         "rm_spaces": true
  14.     })
  15. })
  16. .then(response => response.json())
  17. .then((data) =>img.replaceWith(data.text))
  18. .catch(console.error);
  19. }
Copy the Code
成功从网页图片中获取LaTeX代码:
output.gif
其中.catch(console.error)的作用是:如果出现网络错误,它将在控制台中提示错误:
TypeError: NetworkError when attempting to fetch resource.

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2023-4-18 07:05:37
hbghlyj 发表于 2023-4-17 23:05
成功从网页图片中获取LaTeX代码
如果响应为空(可能图像本身是空图像,或者图像太模糊而无法识别),它返回值undefined,结果文档中的图像全部被替换为“undefined”
代码需要改进:
  1. function mathpix(img){
  2. text=fetch("https://api.mathpix.com/v3/text", {
  3.     method: 'POST',
  4.     headers: {
  5.         'Content-Type': 'application/json',
  6.         'app_id': APP_ID,
  7.         'app_key': APP_KEY
  8.     },
  9.     body: JSON.stringify({
  10.         "src": img.src,
  11.         "math_inline_delimiters": ["$", "$"],
  12.         "rm_spaces": true
  13.     })
  14. })
  15. .then(response => response.json()).then(data=>{if(data.text){img.replaceWith(data.text)}else{console.error("Empty response")}}).catch(console.error);
  16. }
Copy the Code
现在如果响应为空,代码抛出错误并停止用文字替换图片。

手机版Mobile version|Leisure Math Forum

2025-4-20 22:16 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list