Forgot password?
 Create new account
View 1099|Reply 11

关于i.upmath.me

[Copy link]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2024-3-2 23:35:19 |Read mode
Last edited by hbghlyj at 2025-3-30 08:21:28
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{...}

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

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

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

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

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

kuing Posted at 2024-3-3 14:09:19
在 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

可以了。

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

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

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


3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

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

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

abababa 发表于 2021-10-3 01:36
要是这个能用tkz-euclide就更好 ...

i.upmath.me 不支持 tkz-euclide,但是 kroki.io 支持 tkz-euclide.

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-10-9 18:24:05
abababa 发表于 2020-6-9 03:08
另外我很喜欢tkz-euclide这个包,不知道这个能不能也一起在网页里显示。

是的,可以显示。图片链接使用 https://kroki.io/tikz/svg/...
得到以下图片(加载较慢)

Comment

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

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

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

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

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2024-10-9 18:28:52
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

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

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

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

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

手机版Mobile version|Leisure Math Forum

2025-4-20 11:42 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list