typst-paper

from bahayonghang/my-claude-code-settings

我的Claude Code配置,包括commands,skills等

4 stars0 forksUpdated Jan 26, 2026
npx skills add https://github.com/bahayonghang/my-claude-code-settings --skill typst-paper

SKILL.md

Typst 学术论文助手

核心原则

  1. 绝不修改 @cite@ref@label、数学环境内的内容
  2. 绝不凭空捏造参考文献条目
  3. 绝不在未经许可的情况下修改专业术语
  4. 始终先以注释形式输出修改建议
  5. Typst 编译速度快(毫秒级),适合实时预览

统一输出协议(全部模块)

每条建议必须包含固定字段:

  • 严重级别:Critical / Major / Minor
  • 优先级:P0(阻断)/ P1(重要)/ P2(可改进)

默认注释模板(diff-comment 风格):

// <模块>(第<N>行)[Severity: <Critical|Major|Minor>] [Priority: <P0|P1|P2>]: <问题概述>
// 原文:...
// 修改后:...
// 理由:...
// ⚠️ 【待补证】:<需要证据/数据时标记>

失败处理(全局)

工具/脚本无法执行时,输出包含原因与建议的注释块:

// ERROR [Severity: Critical] [Priority: P0]: <简要错误>
// 原因:<缺少工具或路径无效>
// 建议:<安装工具/核对路径/重试命令>

常见情况:

  • Typst 未安装:建议通过 cargo install typst-cli 或包管理器安装
  • 字体缺失:使用 typst fonts 查看可用字体
  • 文件不存在:请用户提供正确 .typ 路径

模块(独立调用)

模块:编译

触发词: compile, 编译, build, typst compile, typst watch

Typst 编译命令:

命令用途说明
typst compile main.typ单次编译生成 PDF 文件
typst watch main.typ监视模式文件变化时自动重新编译
typst compile main.typ output.pdf指定输出自定义输出文件名
typst compile --format png main.typ其他格式支持 PNG、SVG 等格式
typst fonts字体列表查看系统可用字体

使用示例:

# 基础编译(推荐)
typst compile main.typ

# 监视模式(实时预览)
typst watch main.typ

# 指定输出目录
typst compile main.typ --output build/paper.pdf

# 导出为 PNG(用于预览)
typst compile --format png main.typ

# 查看可用字体
typst fonts

# 使用自定义字体路径
typst compile --font-path ./fonts main.typ

编译速度优势:

  • Typst 编译速度通常在毫秒级(vs LaTeX 的秒级)
  • 增量编译:只重新编译修改的部分
  • 适合实时预览和快速迭代

中文支持:

// 中文字体配置示例
#set text(
  font: ("Source Han Serif", "Noto Serif CJK SC"),
  lang: "zh",
  region: "cn"
)

模块:格式检查

触发词: format, 格式检查, lint, style check

检查项目:

类别检查内容标准
页边距上下左右边距通常 1 英寸(2.54cm)
行间距单倍/双倍行距根据期刊要求
字体正文字体与大小Times New Roman 10-12pt
标题各级标题格式层次清晰,编号正确
图表标题位置与格式图下表上,编号连续
引用引用格式一致性数字/作者-年份格式

Typst 格式检查要点:

// 页面设置
#set page(
  paper: "a4",  // 或 "us-letter"
  margin: (x: 2.5cm, y: 2.5cm)
)

// 文本设置
#set text(
  font: "Times New Roman",
  size: 11pt,
  lang: "en"
)

// 段落设置
#set par(
  justify: true,
  leading: 0.65em,
  first-line-indent: 1.5em
)

// 标题设置
#set heading(numbering: "1.1")

常见格式问题:

  • ❌ 页边距不一致
  • ❌ 字体混用(中英文字体未分离)
  • ❌ 图表编号不连续
  • ❌ 引用格式不统一

模块:语法分析(英文)

触发词: grammar, 语法, proofread, 润色, article usage

重点检查领域:

  • 主谓一致
  • 冠词使用(a/an/the)
  • 时态一致性(方法用过去时,结果用现在时)
  • Chinglish 检测

输出格式:

// GRAMMAR(第23行)[Severity: Major] [Priority: P1]: 冠词缺失
// 原文:We propose method for...
// 修改后:We propose a method for...
// 理由:单数可数名词前缺少不定冠词

常见语法错误:

错误类型示例修正
冠词缺失propose methodpropose a method
主谓不一致The data showsThe data show
时态混乱We proposed... The results showsWe proposed... The results show
Chinglishmore and moreincreasingly

模块:长难句分析

触发词: long sentence, 长句, simplify, decompose, 拆解

触发条件:

  • 英文:句子 >50 词 或 >3 个从句
  • 中文:句子 >60 字 或 >3 个分句

输出格式:

// 长难句检测(第45行,共67词)[Severity: Minor] [Priority: P2]
// 主干:[主语 + 谓语 + 宾语]
// 修饰成分:
//   - [关系从句] which...
//   - [目的状语] to...
// 建议改写:[简化版本]

拆分策略:

  1. 识别主干结构
  2. 提取修饰成分
  3. 拆分为多个短句
  4. 保持逻辑连贯性

模块:学术表达

触发词: academic tone, 学术表达, improve writing, weak verbs

英文学术表达:

❌ 弱动词✅ 学术替代
useemploy, utilize, leverage
getobtain, achieve, acquire
makeconstruct, develop, generate
showdemonstrate, illustrate, indicate

中文学术表达:

❌ 口语化✅ 学术化
很多研究表明大量研究表明
效果很好具有显著优势
我们使用本文采用
可以看出由此可见

输出格式:

// EXPRESSION(第23行)[Severity: Minor] [Priority: P2]: 提升学术语气
// 原文:We use machine learning to get better results.
// 修改后:We employ machine learning to achieve superior performance.
// 理由:用学术替代词替换弱动词

模块:翻译(中译英)

触发词: translate, 翻译, 中译英, Chinese to English

翻译流程:

步骤 1:领域识别 确定专业领域术语:

  • 深度学习:neural networks, attention, loss functions
  • 时间序列:forecasting, ARIMA, temporal patterns
  • 工业控制:PID, fault detection, SCADA

步骤 2:术语确认

| 中文 | English | 领域 |
|------|---------|------|
| 注意力机制 | attention mechanism | DL |
| 时间序列预测 | time series forecasting | TS |

步骤 3:翻译并注释

// 原文:本文提出了一种基于Transformer的方法
// 译文:We propose a Transformer-based approach
// 注释:"本文提出" → "We propose"(学术标准表达)

步骤 4:Chinglish 检查

中式英语地道表达
more and moreincreasingly
in recent yearsrecently
play an important roleis crucial for

常用学术句式:

中文English
本文提出...We propose... / This paper presents...
实验结果表明...Experimental results demonstrate that...
与...相比Compared with... / In comparison to...
综上所述In summary / In conclusion

模块:参考文献

触发词: bib, bibliography, 参考文献, citation, 引用

Typst 参考文献管理:

方法 1:使用 BibTeX 文件

#bibliography("references.bib", style: "ieee")

方法 2:使用 Hayagriva 格式

#bibl

...
Read full content

Repository Stats

Stars4
Forks0