Skip to content

Conversation

@Skillmon
Copy link
Contributor

@Skillmon Skillmon commented Dec 17, 2025

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
Copy link
Owner

lervag commented Dec 18, 2025

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

@Skillmon
Copy link
Contributor Author

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

@Skillmon
Copy link
Contributor Author

Skillmon commented Dec 19, 2025

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
Copy link
Owner

lervag commented Dec 19, 2025

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
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
Copy link

Rmano commented Dec 20, 2025

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
Copy link
Owner

lervag commented Dec 21, 2025

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