Skip to content

Add macrocode as special case for syntax highlighting#3243

Closed
Skillmon wants to merge 1 commit into
lervag:masterfrom
Skillmon:special_case_macrocode
Closed

Add macrocode as special case for syntax highlighting#3243
Skillmon wants to merge 1 commit into
lervag:masterfrom
Skillmon:special_case_macrocode

Conversation

@Skillmon

@Skillmon Skillmon commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Inside a DTX file the macrocode environment has a very special meaning as it starts and ends the portions of the file which will be added to the exported file.

For that reason this PR adds a highlighting group for % \begin{macrocode} (and \end) and links it to Special.

@lervag

lervag commented Dec 18, 2025

Copy link
Copy Markdown
Owner

Thanks! Can you give an example .dtx file for this as well?

@Skillmon

Copy link
Copy Markdown
Contributor Author

What do you exactly need the example .dtx file to contain?

@Skillmon

Skillmon commented Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

Or rather: What do you need it for? Just as an example why the macrocode environment is special? Or for some tests? Should it be a minimal valid standalone .dtx file?

@lervag

lervag commented Dec 19, 2025

Copy link
Copy Markdown
Owner

Ah, sorry, I need it for testing. I like to have a simple test file for more or less any feature. I can add the file myself, I just need to have some example of a relevant dtx file that uses the macrocode environment.

@Skillmon

Copy link
Copy Markdown
Contributor Author

In that case, doesn't get more authoritative than the LaTeX kernel (though their .dtx files are big and probably more trouble than you'd need):

As a simpler example, from one of my own smaller packages:

@Rmano

Rmano commented Dec 20, 2025

Copy link
Copy Markdown

Identfirst? 😜 (The joke on Tex.sx chat is that it's the smallest package possible...)

https://mirrors.ctan.org/macros/latex/required/tools/indentfirst.dtx

lervag added a commit that referenced this pull request Dec 21, 2025
@lervag

lervag commented Dec 21, 2025

Copy link
Copy Markdown
Owner

Thanks! I added test files myself and merged this.

@lervag lervag closed this Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants