Forgot password?
 Register account
View 1256|Reply 11

关于i.upmath.me

[Copy link]

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2024-3-2 23:35 |Read mode
Last edited by hbghlyj 2025-3-30 08:21
kuing 发表于 2021-11-16 07:27
对了,这个不能用 \tikz{...},必须用 tikzpicture 环境
不能用\tikz{...}的原因是,Templater.php第38、46行$formula中查找\begin{tikzpicture}
如果有找到\begin{tikzpicture},才加tikz包,如果没有找到就不加.

根据这个原理,可以在注释中写一个\begin{tikzpicture}
  1. %\begin{tikzpicture}
  2. \tikz
  3. \draw[domain=0:360,samples=50]plot({cos(\x)+sqrt(3)*sin(\x)+2},{-cos(\x)+sqrt(3)*sin(\x)+2});
Copy the Code
这样$formula包含了\begin{tikzpicture},所以加了tikz包,就可以使用\tikz{...}

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2024-3-3 01:43
那我的 js 里也可以加一个:
如果代码里有 \tikz,就往代码最前面加一个 %\begin{tikzpicture} 这样?

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2024-3-3 02:41
kuing 发表于 2024-3-2 17:43
那我的 js 里也可以加一个:
如果代码里有 \tikz,就往代码最前面加一个 %\begin{tikzpicture} 这样? ...
在1#測試通過了

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2024-3-3 14:09
在 zdy3pc.js 的 tikz 那段的 var str = item.textContent; 之后加了一句
  1.     if(str.match(/\\tikz/)){str += "%\\begin{tikzpicture}";}
Copy the Code

test:

  1. [tikz]\tikz{\draw(0,0)circle(1cm);}[/tikz]
Copy the Code
可以了。

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2024-10-9 04:24
Last edited by kuing 2024-10-9 04:50刚才将 js 改写为 PHP 时测试发现,\tikz 现已直接支持,不需要上面的方式了。
(就是开始改写时未考虑这一点,就忽然发现居然不用考虑了)

也学楼主那样去看 upmath 的代码,发现:
github.com/parpalak/i.upmath.me/blob/master/lib/Templater.php#L60
这里的 $test_command 里如今有了 '\\tikz'                => 'tikz',


3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2024-10-9 18:22

将 tkz-euclide 包含在论坛中的方法

abababa 发表于 2021-10-3 01:36
要是这个能用tkz-euclide就更好 ...
i.upmath.me 不支持 tkz-euclide,但是 kroki.io 支持 tkz-euclide.

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2024-10-9 18:24
abababa 发表于 2020-6-9 03:08
另外我很喜欢tkz-euclide这个包,不知道这个能不能也一起在网页里显示。
是的,可以显示。图片链接使用 https://kroki.io/tikz/svg/...
得到以下图片(加载较慢)

Comment

图挂了  Posted 2025-3-30 14:17

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2024-10-9 18:24
abababa 发表于 2020-6-9 03:08
另外我很喜欢tkz-euclide这个包,不知道这个能不能也一起在网页里显示。
tkz-euclide 可以通过调用 kroki.io 来支持,因此可以在此论坛上使用而无需转换为其他格式。

请参阅此帖子:forum.php?mod=viewthread&tid=12675

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2024-10-9 18:28
kuing 发表于 2024-10-8 20:24
刚才将 js 改写为 PHP 时测试发现,\tikz 现已直接支持,不需要上面的方式了。
(就是开始改写时未考虑这一 ...

parpalak 在7月15日添加了对 \tikz 命令的支持,并向 documentclass 添加了 dvisvg 选项以启用 SVG 渐变。
github.com/parpalak/i.upmath.me/commit/a41d38 … 6f42aa8b482cdb7c5581

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

kuing Posted 2024-10-14 17:50
hbghlyj 发表于 2024-10-14 17:33
https://tex.s2cms.ru/ 与 https://i.upmath.me/ 相同
还以为可以多一个备胎,其实就一镜像站吧?

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

 Author| hbghlyj Posted 2025-3-30 08:20
kuing 发表于 2024-10-14 09:50
还以为可以多一个备胎,其实就一镜像站吧?
kroki.io是一个备用轮胎
kroki.io/tikz/svg/eNqdWP9u2zYQ_nt5Cv6RAHEmy0p … zX-j2HE3uv5C-z8rLv95

Mobile version|Discuz Math Forum

2025-6-4 17:28 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit