From a47452744f83d52c5aff1540750ff39cb17a28a2 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:35:35 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 ++++++ README.md | 3 ++ plugin.lock.json | 52 +++++++++++++++++++++++ skills/typst-physica/SKILL.md | 53 ++++++++++++++++++++++++ skills/typst-physica/example_physica.typ | 40 ++++++++++++++++++ skills/typst-physica/examples.typ | 36 ++++++++++++++++ 6 files changed, 196 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 plugin.lock.json create mode 100644 skills/typst-physica/SKILL.md create mode 100644 skills/typst-physica/example_physica.typ create mode 100644 skills/typst-physica/examples.typ diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..4d15ffb --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "Typst", + "description": "Typst文档编写SKILLS", + "version": "0.0.0-2025.11.28", + "author": { + "name": "Dongdong Kong", + "email": "kongdd.sysu@gmail.com" + }, + "skills": [ + "./skills/typst-physica" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3418ed7 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Typst + +Typst文档编写SKILLS diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..7f90913 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,52 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:kongdd/Skills_for_Your_AI_Student:typst", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "65edb7727c62e1b505e7d22b5b9b3c0f7e1fa78d", + "treeHash": "1011e000ccdd74ff53760c9de415719cbec5b2bca9b552608410d20458335269", + "generatedAt": "2025-11-28T10:19:56.227560Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "Typst", + "description": "Typst文档编写SKILLS" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "bc8f69a6f14ca2bdbda9d1ae10945b2d40ea6ebdbcc8fbb4be23e945fbb7d37b" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "57ed3996ea71bb92281480cf2089cb385ab53dc7203e55913e7f348936c177d6" + }, + { + "path": "skills/typst-physica/examples.typ", + "sha256": "f29c070d485af884731333a127b9933966faee31d5682c9e77858b93a1822853" + }, + { + "path": "skills/typst-physica/example_physica.typ", + "sha256": "a3aeff09aa965d57419261a9a3d9a206652c5b730c1f59afe7c6eb33a1b66bf9" + }, + { + "path": "skills/typst-physica/SKILL.md", + "sha256": "16a786b033af36f7421bb12f4d9fffcc8cb2782d74c989709d201fe4fd418634" + } + ], + "dirSha256": "1011e000ccdd74ff53760c9de415719cbec5b2bca9b552608410d20458335269" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/typst-physica/SKILL.md b/skills/typst-physica/SKILL.md new file mode 100644 index 0000000..9380abd --- /dev/null +++ b/skills/typst-physica/SKILL.md @@ -0,0 +1,53 @@ +--- +name: typst-physica +description: typst公式中的微分、偏微分方程编写,latex公式转typst。 +--- + + +# 引用包 + +应在typst文档的开头,引用包。公式编写、文档排版,依赖`modern-cug-report`。 + +用于如果已经引用了`modern-cug-report`,则无需再重复添加了。 + +```typst +#import "@local/modern-cug-report:0.1.3": * +#show: doc => template(doc, footer: "CUG水文气象学2025", header: "") +``` + + +# 偏微分方程 + +- `(∂ theta) / (∂ t)` + + `\frac{\partial \theta}{\partial t}`采用typst编写会非常简单,`pdv(theta, t)` + + ```typst + (partial.diff theta) / (partial.diff t) // 是错误写法 + pdv(theta, t) // 正确写法 + ``` + +- `(d theta) / (d t)`则是:`dv(theta, t)` + + +# text + +typst公式中的本文需要使用引号: + +```typst +q_(infiltration) // 错误 +q_("infiltration") // 正确 +``` + +# fraction + +- latex的`\frac{y}{x}`,写成typst则是`y/x`; + + 若分子、分母有多个变量,则用括号括起来。例如latex的`\frac{y z}{x}`,写成typst则是`(y z) / x` + + +# 排版 + +- 一级标题之前空两行,凸显章节的层次感。 + +- 第一个一级标题,不用空两行。 diff --git a/skills/typst-physica/example_physica.typ b/skills/typst-physica/example_physica.typ new file mode 100644 index 0000000..38fc995 --- /dev/null +++ b/skills/typst-physica/example_physica.typ @@ -0,0 +1,40 @@ +// Copyright 2023 Leedehai +// Use of this code is governed by a MIT license in the LICENSE.txt file. +// For a manual on this package, see physica-manual.pdf. + +#import "@local/modern-cug-report:0.1.3": * +#show: doc => template(doc, footer: "CUG水文气象学2025", header: "") + +// #import "physica.typ": * + +#show: super-T-as-transpose // Render "..^T" as transposed matrix + +$ + A^T, curl vb(E) = - pdv(vb(B), t), + quad + tensor(Lambda, +mu, -nu) = dmat(1, RR), + quad + f(x,y) dd(x, y), + quad + dd(vb(x), y, [3]), + quad + dd(x, y, 2, d: Delta, p: and), + quad + dv(phi, t, d: upright(D)) = pdv(phi, t) + vb(u) grad phi \ + H(f) = hmat(f; x, y; delim: "[", big: #true), + quad + vb(v^a) = sum_(i=1)^n alpha_i vu(u^i), + quad + Set((x, y), pdv(f, x, y, [2,1]) + pdv(f, x, y, [1,2]) < epsilon) \ + -1/c^2 pdv(, t, 2)psi + laplacian psi = (m^2c^2) / hbar^2 psi, + quad + ket(n^((1))) = sum_(k in.not D) mel(k^((0)), V, n^((0))) / (E_n^((0)) - E_k^((0))) ket(k^((0))), + quad + integral_V dd(V) (pdv(cal(L), phi) - partial_mu (pdv(cal(L), (partial_mu phi)))) = 0 \ + dd(s, 2) = -(1-(2G M)/r) dd(t, 2) + (1-(2G M)/r)^(-1) dd(r, 2) + r^2 dd(Omega, 2) +$ + +$ + "clk:" & signals("|1....|0....|1....|0....|1....|0....|1....|0..", step: #0.5em) \ + "bus:" & signals(" #.... X=... ..... ..... X=... ..... ..... X#.", step: #0.5em) +$ diff --git a/skills/typst-physica/examples.typ b/skills/typst-physica/examples.typ new file mode 100644 index 0000000..3802596 --- /dev/null +++ b/skills/typst-physica/examples.typ @@ -0,0 +1,36 @@ +#import "@local/modern-cug-report:0.1.3": * +#show: doc => template(doc, footer: "CUG水文气象学2025", header: "") + + +== 1 Richards方程 + +Richards方程: + +$ pdv(theta, t) = nabla dot [K(theta) nabla H] + S $ + +其中: +- $theta$:体积含水量 [L^3/L^3] +- $t$:时间 [T] +- $S$:源汇项 [1/T] + +总水头 $H$ 由基质势 $h$ 和重力势 $z$ 组成: +$ H = h + z $ + + +== 2 质量守恒定律 +对于土壤控制体积,质量守恒方程为: +$ pdv(rho theta, t) + nabla dot (rho q) = rho S $ + +假设水密度 $rho$ 为常数,简化为: +$ pdv(theta, t) + nabla dot q = S $ + + +== 3 上边界层条件 + +上边界通常受大气条件控制,主要包括: + +*降雨入渗条件:* +$ -K(theta) pdv(H, z) |_(z=0) = q_("infiltration") $ + +*蒸发条件:* +$ -K(theta) pdv(H, z) |_(z=0) = q_("evaporation") $