Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Svelte KaTeX PreprocessorNew to Visual Studio Code? Get it now.
Svelte KaTeX Preprocessor

Svelte KaTeX Preprocessor

samplekit

|
87 installs
| (0) | Free
Syntax highlighting for KaTeX in Svelte HTML comments and JS template literals.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Syntax Highlighting for Math in Svelte Templates

This extension adds syntax highlighting to – and snippets for – the @samplekit/preprocess-katex NPM package.

The NPM package allows you to write math (via KaTeX) directly in Svelte templates without disrupting other tools like svelte-check, Prettier, ESLint, TypeScript, etc.

Examples

In Svelte Markup

Without Extension

KaTeX display in HTML comment without extension.

With Extension

KaTeX display in HTML comment with extension.

In JS Tagged Template Literal

Without Extension

KaTeX in template literal without extension.

With Extension

KaTeX in template literal with extension.

Supported Syntax

The supported syntax matches that of the NPM package's preprocessor.

In Svelte markup, use <!-- \[ \] --> for display mode and <!-- \( \) --> for inline mode.

For JS tagged template literals, use katex` or latex` (case insensitive).

Links

  • Docs
  • Extension on the VSCode Marketplace
  • Extension Source
  • Companion NPM Package
  • Companion Package Source
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft