language-latex icon indicating copy to clipboard operation
language-latex copied to clipboard

support for .dtx commented code.

Open jessexknight opened this issue 4 years ago • 0 comments

Different from #36 and PR126

Background

.dtx files are "documented tex files" which compile to produce .cls / .sty files and .pdf documentation from the same source. In .dtx files, the uncommented code is added to the .cls / .sty, while commented code is recompiled separately to produce the .pdf documentation. It's a bizarre system but it's the standard documentation approach for tex packages. Reason I bring it up: the commented code is valid tex code, and I wish we could highlight it (in a new scope). Currently, it is all treated as comment.

Issue

Commented code in .dtx files is not highlighted.

Request

  1. Add a new scope to identify: .dtx file name and line starts with %
  2. Highlight the line as standard tex code.
  3. Allow users to style the scope, e.c. all italics / different background color.

Hope this makes sense! I might try this myself but I've never worked with grammars before...

jessexknight avatar Jul 26 '20 22:07 jessexknight