Describe the issue
Nested dot2tex highlighting only works when the dot2tex environment is in a document environment. That is not the case when e.g. a chapter is written in a separate file an included with \input.
Steps to reproduce
```tex
%\begin{document} % works with this surrounding environment
\begin{dot2tex}[circo,tikzedgelabels,options=-t raw]
digraph G {
edge [lblstyle="above, sloped"];
b1[label="$B1$",shape="box"];
b2[label="$B2$"];
b3[label="$B3$",shape="doublecircle"];
b1 -> b2[label="$5$"]
b2 -> b3[label="$6$"]
}
\end{dot2tex}
%\end{document}
```
Output from VimtexInfo
System info
OS: Linux 4.19.50
Vim version: NVIM v0.3.7
Has clientserver: true
Servername: /tmp/nvim9TEfF2/0
vimtex project: minimal
base: minimal.tex
root: /home/timo/tmp/reprod
tex: /home/timo/tmp/reprod/minimal.tex
out: /home/timo/tmp/reprod/minimal.pdf
log: /home/timo/tmp/reprod/minimal.log
aux: /home/timo/tmp/reprod/minimal.aux
fls: /home/timo/tmp/reprod/minimal.fls
compiler: latexmk
backend: nvim
output: /tmp/nvim9TEfF2/1
configuration:
continuous: 1
callback: 1
latexmk options:
-verbose
-file-line-error
-synctex=1
-interaction=nonstopmode
latexmk engine: -pdf
viewer: Zathura
xwin id: 0
qf: LaTeX logfile
config:
ignore_filters:
LaTeX Warning: Marginpar on page \d\+ moved.
fix_paths: 1
packages:
default: 1
default: 1
document class: minimal
I'm sorry, but you're example is not an example of the issue. Can you please update? I.e., for me, your example seems to have the correct syntax highlighting.
I'm sure I remember writing something of the lines of "then delete \begin{document} and it doesn't highlight anymore", but apparently I didn't. Updated.
Ok. For me, this actually still works in both cases. Please see the minimal example I've pushed in c7cbc9d.
You're right. Again, I remember seeing the issue in the example I provided, but I must've been confused. Sorry.
Its not actually due to the document environment, but due to having a preceding chapter. Here's a new example:
\chapter{test} % works without this line, same goes for (sub)section but not for arbitrary commands like emph
\begin{dot2tex}
digraph G {
b1 -> b2
}
\end{dot2tex}
Ah, there it is. It should be fixed now.
Thank you!
No problem :)