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
Markdownformats by default, that is$$for block formulas and$for inline formulas.Configurations
Domain:
comment-formula· General SettingsinlineType:
stringDefault:
['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
inlineconfiguration 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.languagesType:
string[]Default:
['c', 'cpp', 'matlab', 'python']Enum:
FEATURES->Programming Language->ID.comment-formula.defines.annotationType:
booleanDefault:
trueIf disabled, the extension will not render formulas in comments. Just code completion features will be available.
completionType:
booleanDefault:
trueIf disabled, the extension will not provide code completion for formulas.
multipleType:
stringDefault:
'after'Enum:
['before', 'after', 'none']Place multi-line formulas' preview (decoration) before or after the formula code.
singleType:
stringDefault:
'after'Enum:
['before', 'after', 'none']Place single-line formulas' preview (decoration) before or after the formula code.
hiddenType:
stringDefault:
'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.autotabType:
booleanDefault:
trueIf 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.
definesType:
Default:
{}Define custom languages with
globpatterns, e.g.:captureType:
Default:
{}WARNING
When
captureis{}, it will be replace by the below default value:marker: whenprefixandsuffixare the same, you can just setmarkerto the same value asprefixandsuffix.strict: iftrue, when escape characters are beforeprefixorsuffix, 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 nosuffixin the same line, the formula will be ignored.For example, you can define a custom capture rule for
Python:messagemessage.playground: Display link of mathjax-playground in hover message. (defult:false)message.preview: Display image of formula preview in hover message box. (defult:true)inspectType:
booleanDefault:
falseEnable inspecting performance of formula capturing and rendering. It will display the average time in the status bar.