Forgot password?
 Create new account
View 102|Reply 3

如何在 SVG 图表中包含 MathJax SVG

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2024-9-10 03:56:20 |Read mode
除了 <foreignObject> 之外,还有一种方法:用 <g transform="translate(x,y)"> 包裹

这种方法不需要指定 MathJax 公式的高度和宽度,比 <foreignObject> 简便

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

 Author| hbghlyj Posted at 2024-9-10 03:59:47

在 SVG 图表中包含 MathJax

在 SVG 图表中包含 MathJax $A(0,0),B(u_1,0),C(u_2,x_1),D(x_2,x_1)$.
方法如下:

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

 Author| hbghlyj Posted at 2024-9-10 04:06:32
除了包在 <g transform="translate(x,y)"> 中,我们还可以将 MathJax SVG 的属性 x 和 y 设置为所需的对应值,因此不需要包 <g> 元素


3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

 Author| hbghlyj Posted at 2024-9-10 04:22:15
另一种方法是使用 CSS 绝对定位。latex2js.com/ 使用了这种方法。这需要包一个 <div> 元素
$x(t)$
$f(t)$
$g(t)$
$y(t)$
$h(t)$
$X_k = \frac{1}{p} \sum \limits_{n=\langle p\rangle}x(n)e^{-ik\omega_0n}$

手机版Mobile version|Leisure Math Forum

2025-4-20 22:02 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list