Render LaTeX math written in your code comments — right in the Visual Studio editor. Any inline
$...$ or display $$...$$ math inside a comment is typeset in place, with no marker prefix
required.
// mass–energy equivalence: $E = mc^2$
/* Gaussian integral: $$\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$$ */
/// The area of a circle is $\pi r^2$.
Features
- No marker needed — just write ordinary
$...$/$$...$$. There's no//tex:tag or special syntax to remember. - Every language — works in any language that classifies comments (C#, C++, C, F#, Python, and more). Math in real code and string literals is left untouched.
- Inline and display math —
$...$flows within the sentence;$$...$$is set off as a block, indented with extra spacing. - Edit in place — move the caret into a formula and the raw LaTeX reappears so you can edit it; it re-renders when you move away.
- Matches your editor — glyphs are tinted to your comment color and sized to your comment font, in both light and dark themes.
- Lightweight — pure in-process rendering (WpfMath), no browser or external process.
Usage
Type math between dollar signs inside any comment:
| Syntax | Result |
|---|---|
$E = mc^2$ |
inline formula |
$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$ |
display (block) formula |
Prose and currency stay as text — // it costs $5 and $10 today is not rendered as math.
Requirements
- Visual Studio 2022 (17.x) or later, including Visual Studio 2026.
- Any edition: Community, Professional, or Enterprise, on x64 or ARM64.
Notes
- Coverage is the common LaTeX-math subset (fractions, sums, integrals, matrices, Greek letters, accents, etc.). Unsupported commands simply stay as plain text rather than erroring.