A VSCode Extensions to preview LaTex formulas within the line of your editor.
This project is based on vscode-iconify and uses markdown-it and markdown-it-mathjax3 to render formula.
You are supposed to write formula between $$
and $$
by default.
Fonts in the image are from monaspace.
- The formula will be rendered in the message box when it is too large in
partial
inline mode, exceeding the line-height of your editor, similar to the second formula shown above- Note that multi-line formula won't be rendered in inline mode due to its height, you can simply hover it for a preview in the message box.
comment-formula.inlineColor
: The color of the rendered formula inline the editor. Default isauto
.comment-formula.messageColor
: The color of the rendered formula in the message box. Default isauto
.comment-formula.inline
: The inline mode of the rendered formula. Default ispartial
.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.
comment-formula.symbol
: The symbol to wrap formula. Default is\\$
.\\$
:$$x^2$$
@
:@@x^2@@
#
:##x^2##
comment-formula.style
: Style of formula code inline the editor. Options areunderline
,bold
,italic
,line-through
andnone
. Default isbold
.comment-formula.enableLanguages
: Enable comment-formula in these languages. LanguageId Reference. Default is["c", "cpp", "python", "java"]
.
For example:
{
"comment-formula.inlineColor": "#667466",
"comment-formula.messageColor": "auto",
"comment-formula.inline": "partial",
}
- 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.
- Install this extension in VSCode may takes a long time, please be patient or try install it again. Installing it using
.vsix
file also works.