syntax include syntax/tex.vim syn region displaymaths matchgroup=mkdMaths start = "\\\\\[" end="\\\\\]" contains=@texMathZoneGroup syn region inlinemaths matchgroup=mkdMaths start = "\\\\(" end="\\\\)" contains=@texMathZoneGroup hi def link mkdMaths SpecialComment
The vim documentation ( :help syn-include ) actually points this out quite clearly (although perhaps with an example):
If the top-level syntax elements in the included syntax file must be contained within a region in the inclusion syntax, you can use ": include syntax":
n:sy[ntax] include [@{grouplist-name}] {file-name}
If you want to include a specific top-level syntax element "foo" in the syntax file, you need to have contains=@foo in the syn region command.
All syntax elements declared in the included file will have the "contained" flag added. In addition, if a list of groups is specified, all the top-level syntax elements in the included file will be added to this list.
Therefore, the name @tex grouplist-name did not need to be indicated in my question. If I had large TeX areas in my documents, this would require guidance because it gives access to the included syntax file namespace, so that contains=@tex will highlight the entire region according to all the rules of the included syntax file.
aaren source share