Skip to content

Conversation

@nikAizuddin
Copy link

This patch will allow minted environment to be properly marked up. However, I haven't test this patch with verbatim and listings environments.

Nik Mohamad Aizuddin b. Nik Azmi added 2 commits March 18, 2020 01:18
This require "VERBATIMLINEENV=(?:verbatim[*]?|lstlisting|minted)" when
executing latexdiff.
It seems minted is only designed for syntax coloring.
For example, it is difficult to remove latexdiff syntax.
@ftilmann
Copy link
Owner

ftilmann commented Mar 25, 2020

Thanks, this looks interesting but I would need to test that it does not break the other verbatim environments. I have also a few other suggestions:

  1. It is cumbersome to add minted as a runtime option to VERBATIMENV. So you should add this to the default (CONFIG defaults are listed near the end of the file - near l. 5079 in current version). Alternatively you check if minted package has been loaded with
if ( defined($packages{"minted"})) {
...
}

in the set up phase, and add minted at that stage programmatically to VERBATIMLINEENV

  1. It would be great if you provide a simple example of old and new files that exercise the new functionality in directory testsuite (and add this to the list in script "verify" in that directory). This is particularly needed to make sure, future patches don't break the functionality you add. Check out the instructions in the Wiki for running test yourself https://github.com/ftilmann/latexdiff/wiki verbatim and lstlisting tests are included in the test list, so if your patch passes, it's probably good to go.

If you are able to do this things, it would greatly accelerate acceptance of your patch (I still would plan to eventually look into it but it might be much longer until I get round to that).

@nikAizuddin
Copy link
Author

@ftilmann no problem, I'll do according to your suggestions

@ftilmann
Copy link
Owner

Note to myself: Indeed this PR is breaking the standard verbatim environment so will put this on hold for now. minted seems quite a popular package, so still worth keeping open. Probably the easiest would be to hardcode dedicated processing for minted environment, adapting the current processing for the verbatim environments. Not so great because it would lead to some code repetition, but avoiding overly complex RegEx.

Note to others: The original author of PR @nikAizuddin never provided testing examples. I am not sure if he or others are still interested as the PR is >4 yrs old. If yes, ping this thread, and ideally provide working examples of old and new files using minted (MWE or could be more complex).

@ftilmann ftilmann added the On hold Waiting for more input from reporter label Jul 14, 2024
@brasswood
Copy link

I can't believe I implemented this patch myself before looking for this 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

On hold Waiting for more input from reporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants