1

I added this line to my document to redefine l@chapter later:

\let\oldlchapter\l@chapter

Now latexdiff creates this, which doesn't compile:

\let\oldlchapter\DIFadd{\l@chapter
}

What can I do to fix this?

  • 2
    For people to be able to analyze the problem, you should provide two simple documents, one with the \let-statement and one without it, that result in this erroneous code. Apart from that, it is to be expected that latexdiff (and any other program with this functionality) fails at some point; marking differences in macro definitions in a way that does not break the code is probably beyond that point. – gernot Jan 2 '17 at 9:08
1

First of all, latexdiff is designed to work with LaTeX document syntax, not raw TeX commands such as \let. In this case, a small change to latexdiff leads to the correct behaviour (see below - this has been implemented in the development version of latexdiff on GitHub and will be contained in versions 1.2.1 up (not yet released as of January 3, 2017).

More generally, use environment \DIFnomarkup (which you need to define to do nothing) to protect TeX commands from processing by latexdiff. see latexdiff manual or man pages for a more detailed explanation.

Required change to latexdiff:

Find the line:

  my $cmdoptseq='\\\\[\w\d\*]+'.$extraspace.'(?:(?:<'.$abrat0.'>|\['.$brat0.'\]|\{'. $pat_n . '\}|\(' . $coords .'\))'.$extraspace.')*';

and add one @ character such that it reads:

  my $cmdoptseq='\\\\[\w\d@\*]+'.$extraspace.'(?:(?:<'.$abrat0.'>|\['.$brat0.'\]|\{'. $pat_n . '\}|\(' . $coords .'\))'.$extraspace.')*';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.