liwenjun2721 / comment-formula

A VSCode Extensions to preview LaTex formulas within the line of your editor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Comment Formula

Introduction

A VSCode extension to render LaTeX formula in comment. Now you can use it in python.

This extension is modified from vscode-iconify and use markdown-it and markdown-it-mathjax3 to render formula.

Feature and Usage

You are supposed to write formula between $$ and $$. Now just support write formula in one-line comment in python.

Fonts in the image are from monaspace.

In partial inline mode, if the formula is too large(height is much higher than the line-height in your editor), hover the formula and you can find it's rendered in the message box, just like the second formula in the above example.

Configuration

  • comment-formula.inlineColor: The color of the rendered formula inline the editor. Default is auto.
  • comment-formula.messageColor: The color of the rendered formula in message. Default is auto.
  • comment-formula.inline: The inline mode of the rendered formula. Default is partial.
    • all: Render all formula in inline mode.
    • none: You can just hover on the formula to preview it.
    • partial: Render formula in inline mode if the formula isn't too large.

For example:

{
  "comment-formula.inlineColor": "#667466",
  "comment-formula.messageColor": "auto",  
  "comment-formula.inline": "partial",
}

Known Issues

  • When you install or enable this extension, you may find that ms-python's connection to server got closed. Just restart VSCode and it will be fine.

About

A VSCode Extensions to preview LaTex formulas within the line of your editor.

License:MIT License


Languages

Language:TypeScript 100.0%