Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language highlight for dtx file #1973

Open
SwitWu opened this issue Jul 2, 2023 · 1 comment
Open

Language highlight for dtx file #1973

SwitWu opened this issue Jul 2, 2023 · 1 comment
Labels
enhancement-request A request for an enhancement to be developed.

Comments

@SwitWu
Copy link

SwitWu commented Jul 2, 2023

.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 SwitWu added the enhancement-request A request for an enhancement to be developed. label Jul 2, 2023
@tancnle
Copy link
Collaborator

tancnle commented Jul 4, 2023

@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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement-request A request for an enhancement to be developed.
Projects
None yet
Development

No branches or pull requests

2 participants