extract-diagrams
Extract Diagrams to SVG
Extract diagrams from source files and convert to SVG for web use.
Format Detection
.typsource → CeTZ extraction (Typst native SVG output).texsource → TikZ extraction (configure at project level with project-specific TEXINPUTS and paths)
CeTZ Extraction (Typst)
Typst can output SVG directly — no intermediate PDF needed.
Step 1: Identify CeTZ diagrams in the .typ file
grep -n '@preview/cetz' $ARGUMENTS
Step 2: For standalone diagram files, compile directly to SVG
typst compile --format svg diagram.typ diagram.svg
Step 3: For diagrams embedded in documents
- Extract the diagram code to a standalone
.typfile - Add necessary imports and page setup
- Compile to SVG:
typst compile --format svg standalone_diagram.typ output.svg
Step 4: Verify SVG files
- Read 2-3 SVG files to confirm valid SVG markup
- Confirm file sizes are reasonable
Step 5: Report results
Source of Truth
- CeTZ: Diagrams are edited in the Typst
.typsource file - TikZ: Configure extraction at project level (see project's extract-diagrams skill)
More from clearsmog/claude-skills
typst
Syntax guide and ecosystem reference for writing Typst (.typ) files. Use this skill when writing, editing, or debugging Typst documents. Covers core syntax, common errors, packages, and best practices.
11deploy
Render and deploy documents to output directory for hosting. Supports Quarto slides and Typst PDFs.
2mindmap
Generate mind map images using mind-elixir. Produces PNG or SVG files from plaintext input. Use when the user needs a mind map, concept map, or topic overview diagram.
2commit
Stage, commit, create PR, and merge to main. Use for the standard commit-PR-merge cycle.
2context-status
|
2proofread
Run the proofreading protocol on documents. Checks grammar, typos, overflow, consistency, and academic writing quality for .tex, .qmd, .typ, and .md files. Produces a report without editing files.
2