Extract Tikz
Extract TikZ diagrams from Beamer `.tex` source, compile each to a standalone PDF, and...
Install
npx skills add pedrohcgs/claude-code-my-workflow --skill extract-tikz -g -a claude-code -y- Repository
- pedrohcgs/claude-code-my-workflow1.7k
- Category
- Documents
- Updated
- 1mo ago
- License
- MIT
- Context cost
- Lightabout 1,055 tokens
- Runs scripts
- No, instructions only
What it does
Extract TikZ diagrams from Beamer `.tex` source, compile each to a standalone PDF, and convert to SVG with 0-based indexing. Use when user says "extract the tikz", "regenerate the diagrams", "rebuild the SVGs", "sync tikz to quarto", or after editing TikZ blocks in a Beamer deck that also has a Quarto mirror.
Extract TikZ Diagrams to SVG
Extract TikZ diagrams from the Beamer source, compile to multi-page PDF, and convert each page to SVG for use in Quarto slides.
Creating a brand-new diagram instead of extracting? Use
/new-diagram, it scaffolds fromtemplates/tikz-snippets/with the prevention rules pre-applied.
Steps
Step 0: Freshness Check (MANDATORY)
Before compiling, verify that extract_tikz.tex matches the current Beamer source.
- Find the Beamer source:
ls Slides/$ARGUMENTS*.tex - Extract all
\begin{tikzpicture}blocks from Beamer - Compare with
Figures/$ARGUMENTS/extract_tikz.tex - If ANY difference exists: update extract_tikz.tex from the Beamer source
- If extract_tikz.tex doesn't exist: create it from scratch
Step 1: Prevention pre-check (MANDATORY, halt on violation)
Before compiling, verify every \begin{tikzpicture} block in Figures/$ARGUMENTS/extract_tikz.tex satisfies the prevention rules in .claude/rules/tikz-prevention.md. The pre-check is a small Python script shared with /new-diagram so both skills enforce identical behavior:
python3 scripts/check-tikz-prevention.py "Figures/$ARGUMENTS/extract_tikz.tex"
What it checks:
- P3,
scale=Xwithout node scaling. Barescale=shrinks coordinates but not text. Allowed forms:scale=X, every node/.style={scale=X}orscale=X, transform shape. The checker parses the full\begin{tikzpicture}[...]options block even when it spans multiple lines. - P4, Directional keyword on edge labels. Every edge label (
nodeinside a\draw) must carryabove,below,left,right, or a compound (e.g.above left).midwayalone is a path position, not a direction. The checker scans the full\draw ...;statement so\drawon one line andnode[...]{...}on the next line are still linked.


