Inspiration

Mathematics proofs are often conceptually geometric but presented as dense symbolic text. We created VisTeX as a way to keep the rigor of LaTeX while making geometric intuition immediate, and the proof writing process more interactive and visual-based.

What it does

VisTeX is a VS Code extension that links LaTeX source, compiled PDF, and interactive Plotly visualizations in one workflow.

  • Detects custom \begin{viz}...\end{viz} blocks in .tex files.
  • Opens a synced PDF viewer with inline visualization markers.
  • Renders interactive 2D/3D plots (surface, curve, contour, parametric).
  • Provides AI-assisted generation of visualization blocks from proof context.
  • Supports AI overlay layers (for example critical/singular points) on top of base plots.
  • Includes an iterative proof-figure workflow:
  • Select proof text and generate TikZ proof illustrations.
  • Re-prompt the generator iteratively to refine layout, labels, and style until the figure matches the intended explanation.

How we built it

We built VisTeX as a TypeScript VS Code extension with a webview-based rendering stack.

Extension host and commands: command registration and orchestration in extension.ts commands include open viewer, refresh, suggest visualization, and suggest overlay

Parsing layer: LaTeX viz block and layer parsing

Plot generation: LaTeX-like math normalization and Plotly trace generation

Webview experience: PDF + Plotly interactive UI

AI suggestion pipeline: context extraction from proof/editor state in proofContext.ts prompt construction, OpenAI-compatible calls, and output sanitization in aiSuggestionService.ts

For the demo flow, we use context_proof.tex as the canonical proof and generate multiple compatible viz blocks when the proof provides multiple visualizable equations.

Challenges we ran into

Preventing malformed LaTeX in viz block options from breaking compilation. Avoiding over-annotation: early AI overlays sometimes marked visually interesting but mathematically invalid “critical points.” Balancing flexibility with reliability: users want creative suggestions, but hackathon demos demand predictable outputs. Keeping popup labels readable and consistent (we moved to plain text labels to avoid formatting artifacts).

Accomplishments that we're proud of

End-to-end proof-to-visualization loop inside VS Code, not a separate app. Context-aware AI generation that can produce multiple viz blocks in a single action when the proof supports it. Stronger prompt/validation rules for correctness and compatibility. Overlay support that now distinguishes singular points from critical points. Improved demo readiness with a robust sample proof pipeline around context_proof.tex.

What we learned

One-shot generation is rarely enough for mathematical communication. Iterative prompting with fast feedback is essential for usable proof diagrams. Validation and constraints are as important as model quality.

What's next for Vistex

Make iterative TikZ editing more conversational and stateful. Add side-by-side diff/preview between figure iterations. Improve automatic extraction of key proof claims to propose better first-pass visuals. Add stronger symbolic/numeric verification for generated overlay points.

Built With

Share this project:

Updates