Due to the lack of an API in VSCode to adjust line height, rendered formulas may exceed the bounds of the lines they are in. This could result in formulas overlapping with the code. The inline configuration option addresses this issue:
all: Always display the formula rendering result as a decoration within the editor, regardless of its height.
partial: If the formula is too tall and exceeds the line bounds, the formula preview will not be displayed inline.
none: Never display the formula rendering result as a decoration within the editor. Instead, you can hover over the formula code to view the rendered formula in a message box.
If enabled, the extension will automatically detect the tab-width before the first line of formula codes, and margin the same width for the formula preview.
marker: when prefix and suffix are the same, you can just set marker to the same value as prefix and suffix.
strict: if true, when escape characters are before prefix or suffix, the formula will not be captured.
breakable: if true, the extension will capture formulas across multiple lines, otherwise it will only capture formulas in a single line. For breakable: false, when their are no suffix in the same line, the formula will be ignored.
For example, you can define a custom capture rule for Python:
Comment Formula
VSCode Marketplace · GitHub Repository
Features
Markdown
formats by default, that is$$
for block formulas and$
for inline formulas.Configurations
Domain:
comment-formula
· General Settingsinline
Type:
string
Default:
['all']
Enum:
['all', 'partial', 'none']
Due to the lack of an API in VSCode to adjust line height, rendered formulas may exceed the bounds of the lines they are in. This could result in formulas overlapping with the code. The
inline
configuration option addresses this issue:all
: Always display the formula rendering result as a decoration within the editor, regardless of its height.partial
: If the formula is too tall and exceeds the line bounds, the formula preview will not be displayed inline.none
: Never display the formula rendering result as a decoration within the editor. Instead, you can hover over the formula code to view the rendered formula in a message box.languages
Type:
string[]
Default:
['c', 'cpp', 'matlab', 'python']
Enum:
FEATURES
->Programming Language
->ID
.comment-formula.defines
.annotation
Type:
boolean
Default:
true
If disabled, the extension will not render formulas in comments. Just code completion features will be available.
completion
Type:
boolean
Default:
true
If disabled, the extension will not provide code completion for formulas.
multiple
Type:
string
Default:
'after'
Enum:
['before', 'after', 'none']
Place multi-line formulas' preview (decoration) before or after the formula code.
single
Type:
string
Default:
'after'
Enum:
['before', 'after', 'none']
Place single-line formulas' preview (decoration) before or after the formula code.
hidden
Type:
string
Default:
'scope'
Enum:
['scope', 'line', 'none']
When to hide LaTeX codes in the editor:
scope
: when selections are not in LaTeX codes' ranges.line
: when lines of selections are not in LaTeX codes' lines.autotab
Type:
boolean
Default:
true
If enabled, the extension will automatically detect the tab-width before the first line of formula codes, and margin the same width for the formula preview.
defines
Type:
Default:
{}
Define custom languages with
glob
patterns, e.g.:capture
Type:
Default:
{}
WARNING
When
capture
is{}
, it will be replace by the below default value:marker
: whenprefix
andsuffix
are the same, you can just setmarker
to the same value asprefix
andsuffix
.strict
: iftrue
, when escape characters are beforeprefix
orsuffix
, the formula will not be captured.breakable
: iftrue
, the extension will capture formulas across multiple lines, otherwise it will only capture formulas in a single line. Forbreakable: false
, when their are nosuffix
in the same line, the formula will be ignored.For example, you can define a custom capture rule for
Python
:message
message.playground
: Display link of mathjax-playground in hover message. (defult:false
)message.preview
: Display image of formula preview in hover message box. (defult:true
)inspect
Type:
boolean
Default:
false
Enable inspecting performance of formula capturing and rendering. It will display the average time in the status bar.