Closed bn-peters closed 3 days ago
This only fails because the excluded command is used in math mode with --math-markup=COARSE (default) ot WHOLE options. For a quick work-around you could try --math-markup=FINE, which work on the test document but might cause trouble with more complex equations. The math markup has it's own list of unsafe commands and generally treats everything as safe so ignores the safecmd list and safecmdexcl lists.
I have now added a patch, so that commands explicitly excluded with --exclude-safecmd
are also added to the list of unsafe math commands, so the example above will still fail without options, but should run with --exclude-safecmd=mycommand
. Please let me know if the word you are trying to exclude is a standard command in a widely-used package, and then it can be added to the preset for unsafe math commands (or you could do a pull request by modifying the following line l. 357):
my @UNSAFEMATHCMD=('qedhere','intertext','begin','end' );
PS: Unfortunately now ever evolving github security does not let me push to my own repository. I hope I will get this fixed; otherwise I find another way to send you the patch.
Ok figured this out faster than expected. I hope the fix works for you.
I'm trying to prevent
latexdiff
from placing certain commands inside ofDIFadd
s to work around another issue (#287). For example, say I'm trying to diff the following two files:Both when running
latexdiff 1.tex 2.tex
or❯ latexdiff --exclude-safecmd=mycommand 1.tex 2.tex
I get (abbreviated)Is there a way to ensure that
\mycommand
is never placed inside of a\DIFadd
?