一键导入
md2typst
Convert Markdown reports to Typst format, compile to PDF with Korean support and publication-quality figures
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert Markdown reports to Typst format, compile to PDF with Korean support and publication-quality figures
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | md2typst |
| description | Convert Markdown reports to Typst format, compile to PDF with Korean support and publication-quality figures |
| allowed-tools | Bash, Read, Write, Edit, Glob, Grep, Agent |
Convert a Markdown report (.md) to Typst format using the user's personal template, compile to PDF with Korean font support and publication-quality layout.
/md2typst <input.md> [options]
<input.md> — Path to the input Markdown file (required)--output <dir> — Output directory (default: typst/ alongside input file)--lang ko — Language hint (default: auto-detect from content)--send-telegram — Send compiled PDF via Telegram after compilation--no-compile — Only convert, skip compilation<input_dir>/typst/)~/Socialst/Templates/Typst_Template/:
socialst.typ, alias.typ, ORCID_iD.svgsocialst.typ font: Replace the font setting with serif fonts:
set text(font: ("IBM Plex Serif", "Noto Serif CJK KR"))
.md for image references (). For each:
.png files to <output>/plots/.pdf exists, check if a .png sibling exists and copy that insteadplots/<filename>.pngRead the input .md file and convert following these rules:
Generate the Typst preamble:
#import "socialst.typ": *
#import "alias.typ": *
#show: project.with(
title: "<extracted from first # heading or filename>",
authors: (
(name: "Tae-Geun Kim", marks: "a,b", email: "tgkim@fudan.edu.cn",
orcid: "0009-0000-4229-2935"),
),
affiliations: (
(mark: "a", name: "Key Laboratory of Nuclear Physics and Ion-beam Application (MOE), Institute of Modern Physics, Fudan University, Shanghai 200433, China"),
(mark: "b", name: "RIKEN Center for Interdisciplinary Theoretical and Mathematical Sciences (iTHEMS), Wako, Saitama 351-0198, Japan"),
),
date: "<today's date in appropriate format>",
)
// Global table styling
#show table: set align(center)
#set table(align: center + horizon)
// Line spacing
#set par(leading: 1.0em)
#set block(spacing: 1.2em)
| Markdown | Typst |
|---|---|
# H1 | = H1 |
## H2 | == H2 |
### H3 | === H3 |
#### H4 | ==== H4 |
| Markdown | Typst |
|---|---|
**bold** | *bold* |
*italic* | _italic_ |
`code` | `code` (same) |
--- (horizontal rule) | #line(length: 100%) |
Inline math $...$ stays as $...$. Display math $$\n...\n$$ becomes $ ... $ (Typst display math with spaces).
LaTeX → Typst math mappings:
| LaTeX | Typst |
|---|---|
\mathbb{R} | bb(R) |
\mathbf{x} | bold(x) |
\mathrm{text} or \text{text} | upright("text") |
\hat{x} | hat(x) |
\bar{x} | overline(x) |
\tilde{x} | tilde(x) |
\frac{a}{b} | a / b (or (a) / (b) for complex) |
\sum_{j} | sum_j |
\prod | product |
\int | integral |
\partial | partial |
\nabla | nabla |
\exp | exp |
\log | log |
\min | min |
\max | max |
\sin, \cos, \tan | sin, cos, tan |
\sigma | sigma |
\lambda | lambda |
\alpha | alpha |
\beta | beta |
\gamma | gamma |
\delta | delta |
\eta | eta |
\kappa | kappa |
\tau | tau |
\phi | phi |
\pi | pi |
\rho | rho |
\epsilon | epsilon |
\mu | mu |
\nu | nu |
\omega | omega |
\Omega | Omega |
\times | times |
\cdot | dot |
\odot | dot.circle |
\to or \rightarrow | arrow.r |
\leftarrow | arrow.l |
\leftrightarrow | arrow.l.r |
\approx | approx |
\sim | tilde.op |
\geq or \ge | gt.eq |
\leq or \le | lt.eq |
\neq or \ne | eq.not |
\in | in |
\notin | in.not |
\subset | subset |
\infty | infinity |
\langle | angle.l → use lr(angle.l ... angle.r) |
\rangle | angle.r |
\left( ... \right) | lr(( ... )) |
\left[ ... \right] | lr([ ... ]) |
\quad | quad |
\qquad | quad quad |
_{...} | _(...) (parentheses for multi-char subscripts) |
^{...} | ^(...) (parentheses for multi-char superscripts) |
IMPORTANT: Do NOT use \sim → sim (unknown variable error). Use tilde.op instead.
IMPORTANT: Do NOT put multi-letter variable names in math mode without quotes (e.g., $v1$ → error). Use v1 outside math or $"v1"$ inside.
IMPORTANT: \diff is deprecated in Typst → use partial.

→
#figure(placement: auto,
image("plots/figure.png", width: 100%),
caption: [Caption text],
)
Rules:
placement: auto — prevents large whitespace gaps by floating figures to page top/bottom.png extension (not .pdf) — Typst handles PNG better for inline displaywidth: 100% for full-width, width: 80% for smaller figures| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
→
#set text(size: 9pt) // for dense tables, use 8pt
#table(
columns: (auto, auto, auto),
table.header([*Header 1*], [*Header 2*], [*Header 3*]),
[Cell 1], [Cell 2], [Cell 3],
)
#set text(size: 11pt) // restore default
Rules:
#set text(size: 8pt) before large tables (6+ columns), 9pt for medium tables, skip for small tables#set table(align: center + horizon) handles alignment (set in preamble)$...$ as normal| Markdown | Typst |
|---|---|
- item | - item (same) |
1. item | + item (auto-numbered) |
```python
code here
```
→
```python
code here
```
(Same syntax — Typst supports fenced code blocks)
| Markdown | Typst |
|---|---|
[text](url) | #link("url")[text] |
After writing the .typ file:
sim in math: Search for $sim or $sim$ patterns — replace with $tilde.op$$v1$, $v2$ — either remove from math or quotediff → partial: Replace any diff in math with partialcircle.dot: Replace with dot.circle (correct Typst symbol)angle.l/angle.r: Deprecated — wrap with lr() or use chevron.l/chevron.rcd <output_dir> && typst compile main.typ report.pdf 2>&1
If errors occur:
main.typCommon errors and fixes:
unknown variable: xyz → multi-letter name in math mode. Quote it: "xyz" or move outside mathunknown symbol modifier → wrong symbol name. Check Typst symbol referencedeprecated warnings → update to new name (e.g., diff → partial)--send-telegram was specified, send via Telegram:
mcp__plugin_telegram_telegram__reply(
chat_id: "<user's chat_id>",
text: "Typst PDF 보고서입니다.",
files: ["<absolute_path_to_pdf>"]
)
The skill uses ~/Socialst/Templates/Typst_Template/ as the base template. The socialst.typ template provides:
1., 1.1., etc.)(1), (2), etc.)Font override (always applied):
IBM Plex Serif (Latin) + Noto Serif CJK KR (Korean fallback)Layout overrides (always applied):
#set table(align: center + horizon))placement: auto (float to minimize whitespace)width: 80% to keep figures manageablesize: 7pt to fit within page width#outline() (no table of contents) — add manually if needed#bibliography() — add manually with a .bib file if needed