Skip to content

gpsaggese/helpers / .claude/skills/slides.convert_to_typst

slides.convert_to_typst

Verified

Convert markdown slides to Typst-compatible format via pandoc

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
  • Say in the output file how it was generated, with this comment right after the metadata-comment block:
    // Generated by `.claude/skills/slides.convert_to_typst/SKILL.md`
    

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

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$

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)
      

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"
    
  • The output file says that it was generated by .claude/skills/slides.convert_to_typst/SKILL.md
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 197kUpdated Claude CodeCodexVerifiedInstall