ts-paper-figure

Generate grounded, critique-refined, editable vector figures for LaTeX research papers.

1.1k|19|Updated Jun 18, 2026
One-click install
npx skills add https://github.com/Spark-To-Paper-Skills/spark-to-paper-skills --skill ts-paper-figure-spark-to-paper-skills
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-paper-figure
Source: https://github.com/Spark-To-Paper-Skills/spark-to-paper-skills/tree/main/skills/ts-paper-figure
Command: npx skills add https://github.com/Spark-To-Paper-Skills/spark-to-paper-skills --skill ts-paper-figure-spark-to-paper-skills

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Academic papers need publication-quality figures, but AI-generated diagrams often come out as flat box-and-arrow flowcharts with garbled labels, fabricated content, or non-editable raster pixels. This Skill fills empty LaTeX figure placeholders with real, grounded, editable vector figures. ## Core Features & Use Cases - Grounded image-model rendering: Designs a concrete visual blueprint, grounds every schematic on a real top-venue paper's main figure fetched via WebSearch and fetch_reference_figures.py, then renders through the official PaperBanana pipeline or the built-in gen_image.py image-model client. - Enforced multi-round vision critique: Claude inspects each rendered PNG with its own vision over at least 2 logged rounds, checking faithfulness, readability, richness, and integrity before approval. - Editable vector output: Approved PNGs are redrawn as native SVGs by the sibling ts-figure-svg skill and converted to vector PDFs; matplotlib is used only for real measured-data results plots. - Use Case: While compiling a journal paper, each \fbox placeholder in sections/*.tex is classified by section, rendered with the appropriate engine, critiqued, vectorized, and inserted as an extension-less \includegraphics with a manifest entry. ## Quick Start Fill every empty figure placeholder in my paper's LaTeX sections with grounded, publication-quality figures and insert them as editable vector PDFs.

Frequently Asked Questions about ts-paper-figure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate figures for a LaTeX paper automatically?

Run the figure stage after the review stage: it scans sections/*.tex for \fbox placeholders, classifies each by section, renders it via an image model or matplotlib, critiques the result over at least two vision rounds, and inserts an extension-less \includegraphics pointing to a vector PDF.

What image model does the figure generation script use?

The model is fixed by the TS_FIG_MODEL environment variable, defaulting to gpt-image-2, with credentials from TS_FIG_API_KEY and TS_FIG_BASE_URL in the repo .env file. The script never substitutes another model and stops with an unset-env error if configuration is missing.

When does the skill use matplotlib instead of an image model?

Matplotlib is used only for real measured-data results plots in the results section of data-aware papers, via plot_results.py with figures4papers styling. Every other figure type, including architecture, concept, and schematic diagrams, is rendered by the image model.

Can the generated figures be edited after rendering?

Yes. Approved PNGs are redrawn as native SVGs by the ts-figure-svg skill with at least four audited repair rounds, then converted to vector PDFs. Matplotlib plots are born vector through the finalize function, and a DrawAI hybrid fallback keeps labels as editable text.

Why does figure generation fail with an unset env error?

The gen_image.py script returns 'unset env' when TS_FIG_API_KEY or TS_FIG_BASE_URL is missing from the environment or .env file. Set these variables in the repo-root .env, or decline figure generation so the orchestrator skips free-form figures while keeping matplotlib plots.

What happens if no suitable reference figure is found for grounding?

Grounding is mandatory for free-form schematics, so the skill searches again with refined WebSearch queries when candidates are low-tier or off-topic. If a genuine multi-query search finds nothing suitable, it stops and asks the user rather than rendering an ungrounded figure.