/extract-tikz
Extract TikZ diagrams from Beamer source, compile to PDF, convert to SVG with 0-based indexing. Use when updating TikZ diagrams for Quarto slides.
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill extract-tikz --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/extract-tikz
Context preview
The summary Claude sees to decide when to auto-load this skill.
Extract TikZ diagrams from Beamer source, compile to PDF, convert to SVG with 0-based indexing. Use when updating TikZ diagrams for Quarto slides.
SKILL.md
extract-tikz.SKILL.mdname: extract-tikz
description: Extract TikZ diagrams from Beamer source, compile to PDF, convert to SVG with 0-based indexing. Use when updating TikZ diagrams for Quarto slides.
argument-hint: "[LectureN, e.g., Lecture2]"
allowed-tools: ["Read", "Bash", "Glob"]
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.
Steps
Step 0: Freshness Check (MANDATORY)
**Before compiling, verify that `extract_tikz.tex` matches the current Beamer source.**
1. Find the Beamer source: `ls Slides/$ARGUMENTS*.tex` 2. Extract all `\begin{tikzpicture}` blocks from Beamer 3. Compare with `Figures/$ARGUMENTS/extract_tikz.tex` 4. If ANY difference exists: update extract_tikz.tex from the Beamer source 5. If extract_tikz.tex doesn't exist: create it from scratch
Step 1: Navigate to the lecture's Figures directory
cd Figures/$ARGUMENTS
Step 2: Compile the extract_tikz.tex file
TEXINPUTS=../../Preambles:$TEXINPUTS xelatex -interaction=nonstopmode extract_tikz.tex
Step 3: Count the number of pages
pdfinfo extract_tikz.pdf | grep "Pages:"
Step 4: Convert each page to SVG using 0-BASED INDEXING
**CRITICAL: PDF pages are 1-indexed, but output SVG files are 0-indexed!**
PAGES=$(pdfinfo extract_tikz.pdf | grep "Pages:" | awk '{print $2}')
for i in $(seq 1 $PAGES); do
idx=$(printf "%02d" $((i-1)))
pdf2svg extract_tikz.pdf tikz_exact_$idx.svg $i
doneStep 5: Sync to docs/ for deployment
cd ../..
./scripts/sync_to_docs.sh $ARGUMENTS
Step 6: Verify SVG files
- Read 2-3 SVG files to confirm they contain valid SVG markup
- Confirm file sizes are reasonable (not 0 bytes)
Step 7: Report results
Source of Truth Reminder
TikZ diagrams MUST be edited in the Beamer `.tex` file first, then copied verbatim to `extract_tikz.tex`. See `.claude/rules/single-source-of-truth.md`.
Read more
name: extract-tikz description: Extract TikZ diagrams from Beamer source, compile to PDF, convert to SVG with 0-based indexing. Use when updating TikZ diagrams for Quarto slides. argument-hint: "[LectureN, e.g., Lecture2]" allowed-tools: ["Read", "Bash", "Glob"]
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.
Steps
Step 0: Freshness Check (MANDATORY)
**Before compiling, verify that `extract_tikz.tex` matches the current Beamer source.**
1. Find the Beamer source: `ls Slides/$ARGUMENTS*.tex` 2. Extract all `\begin{tikzpicture}` blocks from Beamer 3. Compare with `Figures/$ARGUMENTS/extract_tikz.tex` 4. If ANY difference exists: update extract_tikz.tex from the Beamer source 5. If extract_tikz.tex doesn't exist: create it from scratch
Step 1: Navigate to the lecture's Figures directory
cd Figures/$ARGUMENTS
Step 2: Compile the extract_tikz.tex file
TEXINPUTS=../../Preambles:$TEXINPUTS xelatex -interaction=nonstopmode extract_tikz.tex
Step 3: Count the number of pages
pdfinfo extract_tikz.pdf | grep "Pages:"
Step 4: Convert each page to SVG using 0-BASED INDEXING
**CRITICAL: PDF pages are 1-indexed, but output SVG files are 0-indexed!**
PAGES=$(pdfinfo extract_tikz.pdf | grep "Pages:" | awk '{print $2}')
for i in $(seq 1 $PAGES); do
idx=$(printf "%02d" $((i-1)))
pdf2svg extract_tikz.pdf tikz_exact_$idx.svg $i
doneStep 5: Sync to docs/ for deployment
cd ../.. ./scripts/sync_to_docs.sh $ARGUMENTS
Step 6: Verify SVG files
- Read 2-3 SVG files to confirm they contain valid SVG markup
- Confirm file sizes are reasonable (not 0 bytes)
Step 7: Report results
Source of Truth Reminder
TikZ diagrams MUST be edited in the Beamer `.tex` file first, then copied verbatim to `extract_tikz.tex`. See `.claude/rules/single-source-of-truth.md`.
📌 文档结构(2026-07-22 起): 本文件是中文默认入口 —— banner + badges + 信任面 + 9 阶段流水线速览 + 76 行合集总表。 每个合集的完整描述、按用途分组、精确数字、验证方法在 docs/CONTENT_ZH.md(扩展正文,总表行内的 → 直接跳转到对应锚点)。 English version: README-en.md · 中文扩展正文:docs/CONTENT_ZH.md · README-zh-CN.md 已弃用(重定向占位) 🌐 语言: English |
Other skills on auto-empirical-research-skills.
- /pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven + fixest + sandwich + lmtest + clubSandwich + AER + ivreg + did + bacondecomp + HonestDiD + eventstudyr + rdrobust + rddensity + Synth + gsynth + synthdid
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill - /00-Full-empirical-analysis-skill_StatsPAI
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics paper (AER / QJE / JPE / ReStud / AEJ) with DID / RD / IV / SCM / DML / matching, written-out estimating equation + identifying assumption, Table 1 /
Open skill - /00.1-Full-empirical-analysis-skill_Python
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /00.2-Full-empirical-analysis-skill_Stata
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill

