Skip to content

yfzhao20/vscode-ultra-math-preview

Repository files navigation

Ultra Math Preview for VS Code

Visual Studio Marketplace Installs Visual Studio Marketplace Version GitHub

Real-time math preview for LaTeX and markdown. Powered by MathJax and KaTeX.

Usage

Install this extension, and then put your cursor into math block in markdown(.md) or latex(.tex) file. Then you will get real-time preview:

And when you input math formula, the preview will update:

Enjoy and rate five-stars ⭐⭐⭐⭐⭐ ~

Configurations & Commands

  • You can define macros and ⚠ MANUALLY update by executing umath.preview.reloadMacros (Ultra Math Preview: Reload Macros). "Automatically updating macros" has been disabled, because it can affect peformance.

  • Or you can set macros in setting.json

  • You can use command umath.preview.toggleMathPreview(Ultra Math Preview: Toggle Math Preview) to enable or disable math preview.

  • Background color and foreground color will change with Theme. If it goes invalid, execute umath.preview.reloadPreview(Ultra Math Preview: Reload Preview) Command.

  • You can set preview panel on the top/bottom of math block by umath.preview.position (Umath > Preview: Position) option.

  • You can set the renderer as MathJax/KaTeX by umath.preview.renderer (Umath > Preview: Renderer).

  • You can set Custom CSS in umath.preview.customCSS (Umath > Preview: Custom CSS).

  • You can press Escape to close live preview panel.

Dependency

  • Extension: HyperScopes Booster (yfzhao.hscopes-booster)
    • to get TextMate scope of text.
    • now you can uninstall draivin.hscopes (HyperScopes) if no extension depends on that.

Todo

  • Add cursor to "Position"(umath.preview.position) options.
  • Automatically adjust preview position.
  • Add escape keybinding for closing preview panel.
  • Support user-defined CSS style
  • Support more environments.
  • Fix alignment bug