rouge icon indicating copy to clipboard operation
rouge copied to clipboard

Language highlight for dtx file

Open SwitWu opened this issue 2 years ago • 1 comments

.dtx file is a special LaTeX file used in literate programming in which all % characters at the beginning of code lines are not regarded as comment characters. In vscode with the LaTeX-workshop plugin (switch the language in the lower status bar to DocTeX) the code (take docstrip.dtx for example) is rendered as follows: image

How to make rouge support this language?

SwitWu avatar Jul 02 '23 08:07 SwitWu

@SwitWu We can add .dtx as an extension in the Tex lexer and that will allow Rouge to highlight .dtx. From a cursory look, think the existing Tex lexer does not pick up all the extra nuances introduced in .dtx so we might also want to extend it.

Screenshot 2023-07-04 at 6 12 45 pm

By the way, I could not access the link above but this works for me https://tug.ctan.org/macros/latex/base/docstrip.dtx/

tancnle avatar Jul 04 '23 08:07 tancnle