Description
Is your feature request related to a problem? Please describe it.
I would like to have syntax highlighting for parts in a different language than LaTeX when using the LaTeX package "robust-externalize" (ctan, github).
Example file: https://github.com/jlelong/vscode-latex-basics/blob/main/test/colorize-fixtures/robust-externalize.tex
The test file misses \usepackage{robust-externalize}
which is probably important for vimtex. Hence I added it manually:
VimTeX misses highlighting for c
, bash
and python
.
Describe the solution you'd like
A similar solution to the way support was added in LaTeX Workshop in its Textmate LaTeX grammar:
jlelong/vscode-latex-basics#79
which renders the file in Visual Studio Code as following:
To recap the most important things:
- 'robust-externalize' allows user to define custom presets for any language. This means the inclusion mechanism must work similar to fenced code in markdown files by matching the specified language.
- The environments are
CacheMeCode
,PlaceholderPathFromCode
,PlaceholderFromCode
,SetPlaceholderCode
. - The naming scheme of presets or placeholders should follow this
<lang>
(examplepython
)<lang> <variant>
(examplepython print code and result
)<version> <lang> <variant>
(examplemy python matplotlib
)__<LANG>_<STRING>__
- The names occur as the first argument in the curly braces after the opening of an environment.
Describe alternatives you've considered
Switching editor or using tree-sitter injections. Both are not viable. The latter does not work with vimtex.