ftilmann / latexdiff

Compares two latex files and marks up significant differences between them. Releases on www.ctan.org and mirrors
GNU General Public License v3.0
506 stars 72 forks source link

Support for `mqty` (physics package) and similar latex3/xparse syntax #262

Open LecrisUT opened 2 years ago

LecrisUT commented 2 years ago

The syntax for mqty is like \mqty(A&B\\C&D). The issue is that latexdiff incorrectly picks up the \\ as a breakline between math lines so we get something like \DiffADD{\mqty(A&B}\\\DiffADD{C&D)} which breaks compilation.

The correct behavior would be to allow for additional delimiter tokens beyond {} like ()[]<> etc. for a command declared by \declaredocumentcommand{ d<token1><token2> and similar latex3/xparse syntax. It would be excessive for the mqty case to handle individual subitems, so for this situation a mbox or similar protector would be sufficient.