Forgot password
 Register account
original poster: 色k

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

[Copy link]

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2022-3-4 23:00

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

它应该用的是mathjax-node

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2022-3-7 04:06
回复 22# hbghlyj

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2022-3-12 02:04
[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{=}}',

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2022-3-12 20:13
回复 26# hbghlyj

国内是 S 横放

S ∽

zhihu.com/answer/187478607

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2022-3-13 05:56
回复 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

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2022-4-23 17:44
在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τ$

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

17

Threads

82

Posts

5

Reputation

Show all posts

uk702 posted 2022-6-3 18:56
Last edited by uk702 2022-6-3 19:06(已删除)

Comment

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

3200

Threads

7827

Posts

52

Reputation

Show all posts

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

QQ图片20220803044150.png

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2022-12-18 00:53

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)

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2023-4-18 06:05
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.

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2023-4-18 07:05
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
现在如果响应为空,代码抛出错误并停止用文字替换图片。

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-16 03:54 GMT+8

Powered by Discuz!

Processed in 0.015492 seconds, 28 queries