Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Python LaTeX Docstring RendererNew to Visual Studio Code? Get it now.
Python LaTeX Docstring Renderer

Python LaTeX Docstring Renderer

cryogenic

|
1 install
| (0) | Free
Renders LaTeX for Python docstrings in hover tooltips
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Python LaTeX Docstring Renderer

A lightweight VS Code extension that renders LaTeX mathematical expressions directly inside Python IntelliSense hover tooltips—augmenting Pylance without replacing existing type signatures or documentation formatting.

Features

  • Inline Math: $...$, \(...\), and Sphinx/reStructuredText :math:`...` .
  • Display Math: $$...$$, \[...\], Sphinx/reStructuredText .. math:: blocks, and standalone LaTeX environments (matrix, bmatrix, pmatrix, vmatrix, align, align*, aligned, cases, equation, gather, etc.).
  • Language Server Integration: Extracts exact raw LaTeX from Python docstrings via Go-to-Definition (falling back to existing hover Markdown from Pylance or other Python language servers when needed) without replacing type signatures or documentation.
  • Unobtrusive: Returns no extra hover content when a docstring contains no LaTeX, and skips inline code spans, fenced code blocks, doctests (>>>), and currency heuristics ($10–$20).
  • Theme-Aware SVGs: Renders crisp, self-contained SVGs via lazy-loaded MathJax (mathjax-full) using VS Code's default hover text color on a transparent background.
  • Graceful Fallback: Malformed or unsupported LaTeX falls back to raw code formatting without breaking valid expressions in the same docstring.
  • Zero Python Dependencies: Runs entirely inside the VS Code extension host with an in-memory LRU render cache.

Extension Settings

Setting Type Default Description
pythonLatexDocstring.enabled boolean true Enable or disable LaTeX rendering in Python hover tooltips.
pythonLatexDocstring.displayMode "full" \| "mathOnly" "full" Show the full formatted docstring with math rendered in-place (full) or only the rendered math expressions (mathOnly).
pythonLatexDocstring.foregroundColor string "" Override SVG foreground text color (e.g. #d4d4d4). Empty auto-detects from the active VS Code theme.
pythonLatexDocstring.backgroundColor string "" Override SVG background color (e.g. #1e1e1e). Empty uses a transparent background.
pythonLatexDocstring.scale number 1.0 Scale factor applied to rendered math SVGs (0.5–3.0).
pythonLatexDocstring.showErrorHint boolean true Show a subtle *(LaTeX error)* hint next to malformed expressions that fall back to raw text.

Development

# Type-check, lint, and bundle
npm run compile

# Run fast pure-TypeScript unit tests (Mocha)
npm run test:unit

# Run VS Code extension host integration tests
npm test

# Build production bundle
npm run package
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft