AGENT SKILL
slides.convert_to_typst
Convert markdown slides to Typst-compatible format via pandoc
使用场景演示文稿
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- model
- haiku
- description
- Convert markdown slides to Typst-compatible format via pandoc
03 SKILL.md 正文
Goal
- Convert a markdown slides file to Typst presentation format
- Preserve structure, content, and formatting
- Output clean, well-formatted markdown code suitable for conversion to Typst
Workflow
Read Input File
- Read the markdown slides file (e.g.,
lectures.md)
Apply Conversion Rules
- Systematically fix math, unicode, and formatting
Validate Output
- Verify no content loss and structure preserved
Output File
- Write converted markdown with same base name
Quality Checks
- All slide headers and hierarchy preserved
- No content deleted or truncated
- All math expressions wrapped (
$...$) - No unicode math characters remain
- Operators properly formatted with
op() - Code blocks and lists intact
- File is valid markdown
Conventions
LaTeX Custom Commands
- Replace presentation-specific commands with Typst equivalents:
$\EE$->$bb(E)$(blackboard E)$\VV$->$bb(V)$(blackboard V)$\Pr$->$Pr$(remove backslash)
Variables and Math Expressions
- Wrap all variables, parameters, and math expressions in
$...$:- Bad (unwrapped, renders as plain text):
Randomly permute the values of x_j across all samples - Good (wrapped in math mode):
Randomly permute the values of $x_j$ across all samples - Bad (unwrapped function notation):
Compute f(x) and g(x) - Good (wrapped in math mode):
Compute $f(x)$ and $g(x)$
- Bad (unwrapped, renders as plain text):
Unicode to LaTeX
- Replace unicode math characters with LaTeX:
Ω->$\Omega$→->$\to$≤->$\leq$×->$\times$
Subscripts and Superscripts
- Use math mode for all subscripts/superscripts:
- Bad (unicode subscript or bare caret, invalid Typst math): P₀ or P^n
- Good (math mode syntax):
$P_0$or$P^n$
Math Operators
- Use
op()for named operators in Typst:- Bad (named operator unwrapped, Typst renders it as variables):
$g^* = arg min_(g in G)$ - Good (wrapped with
op()):$g^* = op("arg min")_(g in G)$ - Also:
$max_i x_i$->$op("max")_i x_i$
- Bad (named operator unwrapped, Typst renders it as variables):
Plain Numbers and Currency
- Do NOT wrap pure numbers in math mode:
- Bad:
The house costs $50k because it has 4 bedrooms ($+\$30$k) - Good:
The house costs \$50k because it has 4 bedrooms (+\$30k)
- Bad:
Block Formulas
- Use Typst code blocks for complex multi-line formulas:
$ Pr(X_1 , ... , X_n) = product_(i = 1)^n Pr(X_i | "Parents"(X_i)) $
Verification
- [ ] Make sure that the converted slides render correctly, e.g.,
> gen_slides.py -i <FILE> --notes_to_pdf_args="--skip_action open_pdf"
04 同仓库更多 Skills
tutorial_in_60_mins.propagate_docker_changes
Sync tutorial and class-project Docker files to match project_template
★ 0
tutorial_in_60_mins.merge_markdown
Merge the content of a markdown file into a Jupyter notebook
★ 0
tutorial_in_60_mins.format
Format a directory to follow the "Learn X in 60 Minutes" tutorial conventions
★ 0
tutorial_in_60_mins.create
Create a tutorial directory for the Learn X in 60 Minutes conventions
★ 0
todo.reorg_in_progress
Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage
★ 0
todo.reorg_headers
Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage
★ 0